Skip to content

fix(ui): prevent overlapping text in collapsed user messages - #134833

Merged
steipete merged 1 commit into
mainfrom
steipete/fix-user-bubble-reveal-layout
Sep 1, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/fix-user-bubble-reveal-layout

Conversation

@steipete

@steipete steipete commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Resolves a problem where text in long, collapsed Control UI user messages can overlap when a browser reveals a later paragraph inside the preview. The failure was reproduced independently with synthetic history and a browser scrollIntoViewIfNeeded operation after reload.

Reload alone was clean in the isolated reproductions. The trigger is revealing content inside the collapsed preview. The exact historical payload and browser version from the original report were not retained; the regression demonstrates the same visual bug class with a synthetic fixture.

Why This Change Was Made

The legacy five-line clamp compresses later Markdown paragraph boxes, while overflow: hidden still permits browser-driven internal scrolling. Revealing those paragraphs exposes text that overlaps neighboring paragraphs. A bounded five-chat-line-height preview preserves the full natural Markdown layout instead, reusing the existing overflow observer, chevron, and expansion path.

This removes the legacy box/clamp declarations without adding another renderer, measurement path, dependency, or configuration option. Production LOC is +3/-3 (net zero). Tests are +168/-7. No Gateway, provider, protocol, or persistent-state changes are included.

User Impact

Long user prompts remain readable when browser reveal operations bring later text into view. The compact preview, complete expanded prompt, short user messages, assistant messages, and adjacent transcript positioning remain covered.

Evidence

  • Failing-first desktop (1280×900) and mobile (390×844) regressions reproduce the overlap on the original CSS. Text-line bottoms exceed their paragraph boxes: 181px versus 163px on desktop, and 180.3125px versus 162.3125px on mobile.
  • After the CSS repair, 15 tests passed across user-bubble disclosure, transcript disclosure anchoring, and Markdown alignment. A final four-test disclosure rerun passed after a type-safe adjustment to the adjacent-bubble assertions.
  • Scoped check:changed, formatting, and git diff --check passed. Independent blocking-priority review found no actionable findings.
  • Attached before/after captures were inspected in full and contain only synthetic fixture data. They come from real isolated Chromium pages rendering the built Control UI against the repository's mocked Gateway transport, with no application DOM/state injection.

Focused behavior proof:

OPENCLAW_CAPTURE_UI_PROOF=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=900000 node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/chat-user-bubble-disclosure.e2e.test.ts ui/src/e2e/chat-transcript-disclosure-anchor.e2e.test.ts ui/src/e2e/chat-markdown-alignment.e2e.test.ts

Scoped checks:

node scripts/check-changed.mjs -- ui/src/styles/chat/text.css ui/src/e2e/chat-user-bubble-disclosure.e2e.test.ts

One initial local cold-build attempt hit the runner's 300-second no-output watchdog during global setup, before assertions. The completed proof used the existing build-inactivity allowance shown above; no product timeout or test assertion deadline was changed. That build-progress issue is a separate tooling follow-up.

Browser proof covers isolated Chromium at desktop and mobile viewport sizes. Other browser engines and physical mobile devices were not tested. The focused patch, disclosure owner, direct renderer callers, Markdown path, virtualizer, test files, and mocked Gateway harness are unchanged on the selected current-main base; hosted CI validates the published head.

Desktop before: browser reveal exposes overlapping collapsed paragraphs

Desktop after: revealed paragraphs retain natural readable layout

Mobile before: revealed collapsed text overlaps

Mobile after: revealed text remains readable within the compact preview

@clawsweeper

clawsweeper Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Sep 1, 2026
@steipete
steipete marked this pull request as ready for review September 1, 2026 04:54
@steipete

steipete commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready proof for head 2ea7a0fb8aafe2e8f203a65fe814d51df8c396b9.

The collapsed-user-message CSS was the owner: the legacy line clamp compressed hidden paragraph boxes, and browser descendant reveal exposed overlapping text. The fix clips the natural Markdown layout to five chat line heights and keeps the existing overflow observer and expand/collapse path. Exactly two files changed: production +3/−3 (net 0) and tests +168/−7. Short users, assistants, complete expansion, adjacent bubbles, transcript anchoring, and Markdown alignment remain covered.

Failing-first desktop/mobile tests failed against the original CSS, then 15 tests in 3 suites passed, followed by a final 4-test disclosure pass. Commands:

OPENCLAW_CAPTURE_UI_PROOF=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=900000 node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/chat-user-bubble-disclosure.e2e.test.ts ui/src/e2e/chat-transcript-disclosure-anchor.e2e.test.ts ui/src/e2e/chat-markdown-alignment.e2e.test.ts
node scripts/check-changed.mjs -- ui/src/styles/chat/text.css ui/src/e2e/chat-user-bubble-disclosure.e2e.test.ts
git diff --check

The final focused rerun used the first command with only chat-user-bubble-disclosure.e2e.test.ts. Fresh isolated Codex autoreview was clean at P0. The frozen patch and affected owners/callers were unchanged when transplanted onto current main. CI run 33471599143, attempt 1 passed on this exact head, including all 14 UI E2E shards, the real-Gateway UI lane, and the required gate. Native review validation and OPENCLAW_TESTBOX=1 scripts/pr prepare-run 134833 passed without changing the head.

Inspected synthetic proof already attached to this PR: desktop before → after; mobile before → after.

Limits: reload alone was clean; the exact original historical payload/browser version was not retained. Visual proof uses isolated Chromium desktop/mobile viewports, not physical devices or other engines. The initial cold-build watchdog stopped before assertions; successful runs used the existing build-inactivity allowance above, with no test deadlines changed. Initial TS2532 check errors were corrected before the final passing proof. Latest ClawSweeper state has no published actionable findings or Rank-up moves; its pending review is not being claimed as completed.

@steipete
steipete merged commit 12c4bdf into main Sep 1, 2026
147 checks passed
@steipete
steipete deleted the steipete/fix-user-bubble-reveal-layout branch September 1, 2026 05:16
@steipete

steipete commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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 maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant