Skip to content

fix(ui): chat bubbles overlap after switching to the dashboard face - #113356

Merged
steipete merged 2 commits into
mainfrom
claude/chat-size-bug-dashboard-23d83e
Jul 24, 2026
Merged

steipete merged 2 commits into
mainfrom
claude/chat-size-bug-dashboard-23d83e

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where switching a session from the Chat face to the Dashboard face (or back) left the chat transcript garbled: message bubbles overlapped each other in the dashboard's docked chat panel, and the full-width chat showed large empty gaps between messages. The broken layout persisted until the user scrolled far enough for every row to re-render.

Why This Change Was Made

The chat transcript is virtualized (@tanstack/lit-virtual) with absolutely positioned rows whose heights are measured per row and observed via ResizeObserver. Each row's Lit ref forwards to virtualizer.measureElement(...).

When the face switch re-stamps the transcript into the new container, Lit re-invokes every stable row ref as an (undefined, element) pair while the newly stamped subtree is still detached (refs fire mid-commit, before the fragment is connected). The undefined call runs measureElement(null), which prunes every disconnected element from the virtualizer's element cache — and mid-commit that includes the sibling rows registered a moment earlier. The net effect: after the commit only the last transcript row was still ResizeObserver-observed, so no row was ever re-measured at the new pane width. Rows stayed positioned by heights measured at the old width — overlap in the narrow dashboard dock, gaps in the wide chat face. (Initial load is unaffected because there are no prior elements, so the undefined calls never fire.)

The fix defers the measureElement(null) prune to a microtask (coalesced), so it runs after the commit lands, when only genuinely removed rows are still disconnected. Newly stamped rows keep their observation and heal to the new width within a frame.

User Impact

Chat ⇄ Dashboard face switches now keep the transcript readable: no overlapping bubbles in the docked chat, no phantom gaps in the full-width chat. Row size tracking (streaming updates, images loading) also works for all visible rows again instead of only the most recently registered one.

Before (dashboard dock after switching from chat; 13 overlapping rows):

before

After (same flow; 0 overlaps):

after

Evidence

  • Reproduced in the Control UI mock harness (pnpm dev:ui:mock + ?mockBoard=1): switching Chat → Dashboard produced 13 overlapping virtual rows; the virtualizer's elementsCache had collapsed to a single entry (background-tasks) out of 14 rendered rows, so only one row was observed for resizes.
  • New regression test ui/src/pages/chat/components/chat-thread.measure.test.ts re-stamps the same session transcript into a new container and asserts every rendered row stays ResizeObserver-observed (and old rows are released). It fails without the fix (dock rows lose observation) and passes with it.
  • node scripts/run-vitest.mjs over chat-thread.test.ts, chat-thread.question.test.ts, chat-view.test.ts, scroll.test.ts, and the new test: 373 passed.
  • Playwright capture against the mock harness reports {"rowCount":15,"overlaps":13} before and {"rowCount":17,"overlaps":0} after (screenshots above).
  • Changed-file checks on Blacksmith Testbox: conflict markers, max-lines ratchet, format, i18n catalog, core/UI typecheck, and lint lanes green on the rebased head.
  • Codex autoreview (gpt-5.6-sol, high): clean, no findings — "The deferred, coalesced prune preserves newly registered rows until the Lit commit has attached them."

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Jul 24, 2026
@steipete
steipete marked this pull request as ready for review July 24, 2026 15:45
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. labels Jul 24, 2026
@clawsweeper

clawsweeper Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 24, 2026, 11:49 AM ET / 15:49 UTC.

ClawSweeper review

What this changes

The PR queues detached chat-row cleanup until after Lit finishes re-stamping the virtualized transcript, preventing overlapping or gapped bubbles when users switch between Chat and Dashboard faces.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep this PR open for normal maintainer review. The supplied diff is narrowly scoped to the Control UI virtualizer lifecycle, and its described mock-harness evidence directly demonstrates the reported layout regression and after-fix result; the protected maintainer label means it should not be auto-closed.

Priority: P2
Reviewed head: 9d5ec3a250b784075023b8191357e3465a171896

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Strong, directly relevant behavior evidence and a small regression-tested patch support normal maintainer review.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR provides concrete after-fix mock-harness output and before/after screenshots for the exact visible face-switch regression, plus focused regression coverage; redact any private values if reposting the captured diagnostics.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR provides concrete after-fix mock-harness output and before/after screenshots for the exact visible face-switch regression, plus focused regression coverage; redact any private values if reposting the captured diagnostics.
Evidence reviewed 4 items Targeted runtime change: The branch changes the row-reference callback so real elements are measured immediately while null/detached cleanup is coalesced into a microtask, preserving sibling row registrations through a face-switch commit.
Regression coverage: The new jsdom regression test models re-stamping a transcript into a new container and asserts that rendered rows remain ResizeObserver-observed while old rows are released.
Real behavior evidence: The PR body reports a mock-harness face switch changing from 13 overlapping rows before the fix to zero overlaps after it, alongside a focused 373-test run and green changed-file checks already completed on the rebased head.
Findings None None.
Security None None.

How this fits together

The Control UI renders each session transcript as virtualized, absolutely positioned chat rows. Lit row references feed the virtualizer’s measurement and ResizeObserver tracking, which determines row positions in both the full Chat face and Dashboard’s docked chat panel.

flowchart LR
  A[Session transcript] --> B[Virtualized chat rows]
  B --> C[Lit row reference callbacks]
  C --> D[Row measurement and ResizeObserver]
  D --> E[Virtual row positions]
  E --> F[Chat face]
  E --> G[Dashboard chat dock]
Loading

Before merge

  • Complete next step (P2) - No discrete repair is indicated; a Control UI reviewer should validate the current head and merge it after the remaining required checks finish.
Agent review details

Security

None.

PR surface

Source +17, Tests +130. Total +147 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 21 4 +17
Tests 1 130 0 +130
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 151 4 +147

Review metrics

None.

Technical review

Best possible solution:

Land the focused lifecycle fix once a Control UI reviewer confirms the current-head behavior and required checks complete, keeping the regression test as the guard for future transcript re-stamps.

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

Yes. The supplied mock-harness path switches the same session between Chat and Dashboard faces and records overlapping rows before the patch, with zero overlaps after it; the new focused regression test models the same re-stamp lifecycle.

Is this the best way to solve the issue?

Yes. Deferring only the null cleanup preserves immediate measurement for connected rows while allowing removed rows to be pruned after the Lit commit, avoiding new configuration, fallback, or persistence behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 049a17860c5b.

Labels

Label changes:

  • add P2: This is a bounded but user-visible Control UI regression that can make a switched chat transcript unreadable until users force rows to re-render.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR provides concrete after-fix mock-harness output and before/after screenshots for the exact visible face-switch regression, plus focused regression coverage; redact any private values if reposting the captured diagnostics.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR provides concrete after-fix mock-harness output and before/after screenshots for the exact visible face-switch regression, plus focused regression coverage; redact any private values if reposting the captured diagnostics.

Label justifications:

  • P2: This is a bounded but user-visible Control UI regression that can make a switched chat transcript unreadable until users force rows to re-render.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR provides concrete after-fix mock-harness output and before/after screenshots for the exact visible face-switch regression, plus focused regression coverage; redact any private values if reposting the captured diagnostics.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR provides concrete after-fix mock-harness output and before/after screenshots for the exact visible face-switch regression, plus focused regression coverage; redact any private values if reposting the captured diagnostics.

Evidence

What I checked:

  • Targeted runtime change: The branch changes the row-reference callback so real elements are measured immediately while null/detached cleanup is coalesced into a microtask, preserving sibling row registrations through a face-switch commit. (ui/src/pages/chat/components/chat-thread.ts:229, 9d5ec3a250b7)
  • Regression coverage: The new jsdom regression test models re-stamping a transcript into a new container and asserts that rendered rows remain ResizeObserver-observed while old rows are released. (ui/src/pages/chat/components/chat-thread.measure.test.ts:1, 9d5ec3a250b7)
  • Real behavior evidence: The PR body reports a mock-harness face switch changing from 13 overlapping rows before the fix to zero overlaps after it, alongside a focused 373-test run and green changed-file checks already completed on the rebased head. (9d5ec3a250b7)
  • Review boundary: The supplied PR metadata shows this is an open, cleanly mergeable branch against current main commit 049a178; the remaining queued checks are normal merge gating rather than evidence of a patch defect. (049a17860c5b)

Likely related people:

  • steipete: Authored the two focused commits and provided the detailed reproduction, virtualizer diagnosis, regression test, and before/after behavior evidence for this path. (role: recent UI-area contributor; confidence: medium; commits: 4bbca689fe8e, 9d5ec3a250b7; files: ui/src/pages/chat/components/chat-thread.ts, ui/src/pages/chat/components/chat-thread.measure.test.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 70a8c2a into main Jul 24, 2026
180 of 190 checks passed
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@steipete
steipete deleted the claude/chat-size-bug-dashboard-23d83e branch July 24, 2026 16:07
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 25, 2026
…penclaw#113356)

* fix(ui): keep chat transcript rows measured across dashboard face switches

* test(ui): satisfy lint in transcript measure regression test
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 P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant