Skip to content

fix(ui-eventlog): use truncateUtf16Safe for event payload truncation#102735

Closed
lzyyzznl wants to merge 1 commit into
openclaw:mainfrom
lzyyzznl:fix/truncateUtf16Safe-ui-eventlog2
Closed

fix(ui-eventlog): use truncateUtf16Safe for event payload truncation#102735
lzyyzznl wants to merge 1 commit into
openclaw:mainfrom
lzyyzznl:fix/truncateUtf16Safe-ui-eventlog2

Conversation

@lzyyzznl

@lzyyzznl lzyyzznl commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

One .slice(0, 120) truncation site in the Event Log UI may cut UTF-16 surrogate pairs in half when the event payload text contains multi-byte characters such as emoji.

Why This Change Was Made

ui/src/pages/overview/event-log.ts uses raw .slice(0, 120) for event payload display truncation. Replacing with truncateUtf16Safe ensures truncated output is always valid Unicode.

User Impact

Truncated event payload text in the overview UI remains valid Unicode at existing size limits. No behavioral changes for ASCII-only content.

Evidence

  • Mechanical replacement: .slice(0, 120) to truncateUtf16Safe
  • truncateUtf16Safe is already used in other UI files
  • No runtime behavior change for ASCII or valid Unicode input

Generated with Claude Code

@clawsweeper

clawsweeper Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

This PR is superseded by an older, stronger open PR that owns the same Overview Event Log UTF-16 truncation bug with a presenter helper, regression test, and accepted real behavior proof.

Root-cause cluster
Relationship: superseded
Canonical: #102625
Summary: This PR and the canonical PR address the same Overview Event Log payload preview surrogate-boundary bug; the canonical PR is the stronger open landing path.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Canonical path: Use #102625 as the canonical landing path for this bug because it includes the same production fix plus regression coverage and accepted real behavior proof.

So I’m closing this here and keeping the remaining discussion on #102625.

Review details

Best possible solution:

Use #102625 as the canonical landing path for this bug because it includes the same production fix plus regression coverage and accepted real behavior proof.

Do we have a high-confidence way to reproduce the issue?

Yes from source inspection: current main renders Overview Event Log payload previews with raw .slice(0, 120), and the existing UTF-16 helper tests show surrogate-boundary truncation is a real string-level failure mode. I did not run live UI proof for this duplicate PR.

Is this the best way to solve the issue?

No for this branch as the best landing path: the code change is plausible, but #102625 is the better solution because it centralizes the preview formatter and adds regression proof.

Security review:

Security review cleared: The diff only imports an existing internal text-normalization helper and changes UI display truncation; no security or supply-chain surface is added.

AGENTS.md: found and applied where relevant.

What I checked:

Likely related people:

  • steipete: Local blame ties the current Event Log file and raw preview slice to the recent overview UI cleanup merged through improve(ui): remove the Roundness appearance setting #102641. (role: recent area contributor; confidence: high; commits: 06b33f54627c; files: ui/src/pages/overview/event-log.ts, ui/src/pages/overview/view.ts)
  • zhangguiping-xydt: Authored the stronger open canonical PR that covers the same Event Log truncation bug with a presenter helper, regression test, and real behavior proof. (role: canonical fix author; confidence: high; commits: 25a9f1109af6; files: ui/src/lib/presenter.ts, ui/src/pages/overview/event-log.ts, ui/src/pages/overview/event-log.test.ts)

Codex review notes: model internal, reasoning high; reviewed against 6621ead871a9.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jul 9, 2026
@steipete

steipete commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Thanks for the fix. I’m closing this as superseded by #102625. Its reviewed head covers the same Overview event-log surface, reuses the existing UI truncation helper directly, and adds a DOM-level boundary regression without creating another one-use production adapter.

@steipete steipete closed this Jul 9, 2026
@steipete

steipete commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

The canonical fix in #102625 has now landed as 763ef215e05f7d7a041560e52fe8114af2b3776f.

It covers the same Overview event-log payload boundary, uses the canonical Control UI truncation helper, and includes a DOM-level surrogate-boundary regression backed by exact-head CI and Chromium proof. Keeping this PR closed as superseded. Thank you again for the contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants