Skip to content

fix(ui): prevent dashboard chat messages from overlapping - #123713

Merged
clawsweeper merged 1 commit into
mainfrom
fix/chat-commentary-row-overlap
Aug 14, 2026
Merged

clawsweeper merged 1 commit into
mainfrom
fix/chat-commentary-row-overlap

Conversation

@clawsweeper

@clawsweeper clawsweeper commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Related: #113356

What Problem This Solves

Fixes an issue where dashboard-chat users could see a newly rendered assistant commentary row and the following user message painted on top of each other after the transcript was re-stamped or appended.

Why This Change Was Made

Lit invokes row refs before newly stamped virtual rows are connected. TanStack Virtual's synchronous first measurement can therefore cache a zero offsetHeight; because transcript rows are absolutely positioned, the next row receives the same vertical offset. The first measurement is now deferred to the post-commit microtask when the row is connected, while TanStack's existing ResizeObserver remains the ongoing owner of row-size changes. Stale or removed rows are rejected before measurement.

The exact-head CI run also exposed an unrelated deterministic failure already present on main: the Skills owner-selection E2E introduced by #123339 is named to verify that every initial request is scoped to the selected agent, but accidentally required exactly one request. Route and fallback timing can legitimately produce more than one initial status refresh. The test now waits for the page to settle, requires at least one request, and verifies that every captured request targets the displayed default agent.

User Impact

Dashboard chat messages retain separate vertical positions instead of overlapping during commentary-to-user transitions.

Evidence

  • Reproduced on unmodified main with a focused regression: the second row rendered at translateY(0px) after the detached first row measured as zero.
  • The same regression passes after the fix with the second row at translateY(100px).
  • node scripts/run-vitest.mjs ui/src/pages/chat/components/chat-transcript-controller.test.ts ui/src/pages/chat/components/chat-transcript-invalidation.test.ts ui/src/pages/chat/components/chat-transcript-render.test.ts — 19 tests passed.
  • node scripts/run-vitest.mjs ui/src/e2e/skills-owner-selection.e2e.test.ts — 1 browser E2E passed; the old exact-count assertion failed repeatedly in the full CI shard before correction.
  • Targeted oxfmt, focused oxlint, and git diff --check passed.
  • Autoreview (--mode uncommitted, Codex gpt-5.6-sol, high) reported no accepted/actionable findings.
  • Provenance: fix(ui): chat bubbles overlap after switching to the dashboard face #113356 fixed detached-row pruning during face switches, but newly stamped detached rows still synchronously cached a zero first height; this PR closes that remaining path.

AI-assisted: yes. The code path, dependency behavior, regression, and final diff were manually verified.

@clawsweeper

clawsweeper Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@clawsweeper
clawsweeper marked this pull request as ready for review August 14, 2026 15:46
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XS maintainer Maintainer-authored PR labels Aug 14, 2026
@clawsweeper
clawsweeper force-pushed the fix/chat-commentary-row-overlap branch from af0486c to ae51810 Compare August 14, 2026 15:50
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 14, 2026
@clawsweeper

clawsweeper Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 14, 2026, 12:41 PM ET / 16:41 UTC.

ClawSweeper review

What this changes

The PR defers dashboard chat row measurement until Lit has connected each row, and updates the Skills-page E2E to permit multiple correctly scoped initial status requests.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

No blocking correctness finding surfaced. Keep this maintainer-labeled PR open for normal maintainer handling and exact-head CI; the virtual-row fix is the appropriate owner-boundary repair.

Priority: P2
Reviewed head: d9963208361835faa63615729e0a43604b82bb56

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused lifecycle repair and credible regression coverage support normal maintainer review, with dependency-source inspection unavailable locally.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-labeled PR is outside the external-contributor proof gate; its body reports focused after-fix test evidence, while the prepared images belong to the earlier related face-switch repair rather than this change.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-labeled PR is outside the external-contributor proof gate; its body reports focused after-fix test evidence, while the prepared images belong to the earlier related face-switch repair rather than this change.
Evidence reviewed 6 items Current-main failure path: Current main measures an HTMLElement immediately from the row ref, without checking whether it is connected; the PR adds the connected-row deferral at that exact owner boundary.
Stale-row protection: The branch measures only after connection and verifies both the row key and current row-index map; rendering writes the same key to the row data attribute and refreshes the map when rows change.
Regression coverage: The added test models a zero detached height and asserts that the following message receives a distinct 100px virtual offset; test support makes offsetHeight depend on connection state.
Findings None None.
Security None None.

How this fits together

Dashboard chat renders absolutely positioned virtual transcript rows; Lit ref callbacks supply their initial size to TanStack Virtual, which then positions later rows. The Skills page resolves an agent owner before requesting that agent’s skill status from the Gateway.

flowchart LR
  A[Transcript messages] --> B[Lit row render]
  B --> C[Row reference callback]
  C --> D[Connected-row measurement]
  D --> E[Virtual row positions]
  E --> F[Dashboard chat]
  G[Selected agent] --> H[Skills status request]
Loading

Before merge

  • Resolve merge risk (P1) - Production code grows by 15 net lines in a bug fix; no net-neutral refactor is apparent because the row-ref owner needs a deferred connected-state path plus stale-row checks.
  • Resolve merge risk (P1) - Direct TanStack Virtual and Lit source inspection was unavailable in this read-only checkout, limiting independent confirmation of the dependency timing claim.
Agent review details

Security

None.

PR surface

Source +20, Tests +23. Total +43 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 23 3 +20
Tests 2 26 3 +23
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 49 6 +43

Review metrics

Metric Value Why it matters
Production versus test LOC production +16/-1 (net +15); tests/test support +33/-5 (net +28) The production growth implements a lifecycle branch and stale-row guard; the larger test delta supplies the detached-DOM regression model and related E2E assertion.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain the row-ref lifecycle repair and its focused regression test; no smaller existing owner can safely defer the first measurement while preserving the virtualizer’s ResizeObserver ownership.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Retain the row-ref lifecycle repair and its focused regression test; no smaller existing owner can safely defer the first measurement while preserving the virtualizer’s ResizeObserver ownership.

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

No executed current-main reproduction was performed in this read-only review, but source and the focused regression model identify the detached-row measurement path with medium confidence.

Is this the best way to solve the issue?

Yes: the stable row-ref callback owns initial measurement, while existing observer-based sizing remains intact; the only remaining limitation is unavailable local dependency source inspection.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This repairs a contained but user-visible dashboard-chat layout defect without evidence of broader availability or data impact.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-labeled PR is outside the external-contributor proof gate; its body reports focused after-fix test evidence, while the prepared images belong to the earlier related face-switch repair rather than this change.

Evidence

What I checked:

Likely related people:

  • steipete: Current main introduced the controller callback in commit 5c3fd2f, and this branch’s follow-up is authored by the same contributor; the prior related dashboard transcript repair was also associated with this area. (role: current controller author and recent area contributor; confidence: high; commits: 5c3fd2fbe97b, d99632083618; files: ui/src/pages/chat/components/chat-transcript-controller.ts)
  • jalehman: Commit c23c188 established the agent-owned Skills request path exercised by the adjusted E2E. (role: recent Skills owner-selection contributor; confidence: high; commits: c23c188902f1; files: ui/src/lib/skills/index.ts, ui/src/pages/skills/skills-page.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Let exact-head required checks complete before merge.

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.

History

Review history (2 earlier review cycles)
  • reviewed 2026-08-14T15:56:24.330Z sha ae51810be24cfd5d34f7da36ed4e3af2262a8720 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-14T16:20:03.801Z sha 77eb5d0090b37c56dfe66c00264afdeeadd42410 :: needs maintainer review before merge. :: none

@clawsweeper
clawsweeper force-pushed the fix/chat-commentary-row-overlap branch from ae51810 to 77eb5d0 Compare August 14, 2026 16:12
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 14, 2026
@clawsweeper
clawsweeper force-pushed the fix/chat-commentary-row-overlap branch from 77eb5d0 to d996320 Compare August 14, 2026 16:36
@clawsweeper

Copy link
Copy Markdown
Contributor Author

Land-ready verification for exact head d9963208361835faa63615729e0a43604b82bb56:

  • Required CI is green: run 31820113317, including checks-ui, all UI E2E shards, check-prod-types, and openclaw/ci-gate.
  • Focused transcript proof: node scripts/run-vitest.mjs ui/src/pages/chat/components/chat-transcript-controller.test.ts ui/src/pages/chat/components/chat-transcript-invalidation.test.ts ui/src/pages/chat/components/chat-transcript-render.test.ts — 19 passed.
  • Landing-gate test proof: node scripts/run-vitest.mjs ui/src/e2e/skills-owner-selection.e2e.test.ts — passed; the full CI shard is green with the assertion aligned to its every-request agent-scope contract.
  • Targeted oxfmt, oxlint, and git diff --check passed.
  • Fresh Codex autoreview after the final change: no accepted/actionable findings.
  • ClawSweeper rank-up moves addressed: exact-head checks completed, and the installed pinned sources were directly inspected. Lit 3.3.3 calls callback refs during rendering and clears/moves them with undefined; TanStack Virtual Core 3.17.7 synchronously reads offsetHeight for an uncached first measurement and separately registers ResizeObserver. The patch guards that precise first-measure boundary.

Known proof gap: no new post-fix screenshot was attached. The supplied failure screenshot, failing/passing detached-height regression, exact synthetic merge investigation, and green exact-head CI provide the behavior and owner-boundary proof used for landing.

@clawsweeper
clawsweeper merged commit a875ead into main Aug 14, 2026
161 of 163 checks passed
@clawsweeper

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@clawsweeper
clawsweeper deleted the fix/chat-commentary-row-overlap branch August 14, 2026 17:00
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 15, 2026
steipete added a commit that referenced this pull request Aug 15, 2026
The width-change path wiped the virtualizer's entire item-size cache
(instance.measure()), collapsing every offscreen row to the 120px estimate
with no scroll compensation: the reader teleported mid-transcript and the
trickle of remeasure corrections made text visibly jump for several frames
on every pane or window resize.

Keep the stale offscreen sizes as estimates instead. The existing
synchronous resizeItem pass plus TanStack's per-row ResizeObserver re-seed
connected rows with fold-based scroll compensation, so the anchor row holds
still; offscreen rows correct lazily as they connect. End-pinned transcripts
keep following the tail via the existing height-change scrollToEnd path.

Regression e2e: mid-transcript anchor stays within 60px across
1280->1000->820->1280 resizes (pre-fix: anchor scrolled out of the viewport
entirely and scrollTop drifted by 250px+). Wipe introduced in #115059,
refined by #117687/#123713 without addressing anchoring.
steipete added a commit that referenced this pull request Aug 15, 2026
…24013)

* fix(ui): keep the chat transcript anchored while the pane resizes

The width-change path wiped the virtualizer's entire item-size cache
(instance.measure()), collapsing every offscreen row to the 120px estimate
with no scroll compensation: the reader teleported mid-transcript and the
trickle of remeasure corrections made text visibly jump for several frames
on every pane or window resize.

Keep the stale offscreen sizes as estimates instead. The existing
synchronous resizeItem pass plus TanStack's per-row ResizeObserver re-seed
connected rows with fold-based scroll compensation, so the anchor row holds
still; offscreen rows correct lazily as they connect. End-pinned transcripts
keep following the tail via the existing height-change scrollToEnd path.

Regression e2e: mid-transcript anchor stays within 60px across
1280->1000->820->1280 resizes (pre-fix: anchor scrolled out of the viewport
entirely and scrollTop drifted by 250px+). Wipe introduced in #115059,
refined by #117687/#123713 without addressing anchoring.

* test(infra): deflake ephemeral-port rebind proof under runner contention

The bind->release->rebind cycle races foreign processes on shared CI
runners: a stolen port between release and rebind fails the assertion
(EADDRINUSE, seen on checks-node-compact-large-17). Retry the whole cycle
on a fresh ephemeral port, bounded at 5 attempts; a genuine release
regression still fails every attempt because the collision is with our
own lingering listener.

* test: prove port release on the allocated port; add end-pin resize proof

Address ClawSweeper review on #124013:
- ports-probe: replace the fresh-port retry with a connect probe against the
  same allocated port. A lingering listener accepts the probe; a released
  port refuses it. Unlike a rebind, the probe does not collide with foreign
  outbound sockets that transiently occupy the port on busy runners, so the
  release contract stays tied to one port with no retry at all.
- chat-resize-anchor e2e: add a width-only end-pinned case proving the
  virtualizer's wasAtEnd compensation keeps the transcript within 2px of
  the end across 1280->1000->820->1280 resizes.

* test(ui): widen resize-anchor drift bound for Linux font metrics

The fold-spanning anchor row re-wraps by a renderer-dependent amount
(42px macOS, 63px Linux CI at 820px). 120px keeps a wide margin below
the pre-fix failure mode (anchor out of viewport, 250px+ drift).

* test(tooling): register manager-session-update-race in memory helper routing

#124024 added the memory-core test on main without updating the
cross-lane routing expectation in test-projects.test.ts, breaking the
core-tooling shard on every merge ref that includes it.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 16, 2026
…enclaw#124013)

* fix(ui): keep the chat transcript anchored while the pane resizes

The width-change path wiped the virtualizer's entire item-size cache
(instance.measure()), collapsing every offscreen row to the 120px estimate
with no scroll compensation: the reader teleported mid-transcript and the
trickle of remeasure corrections made text visibly jump for several frames
on every pane or window resize.

Keep the stale offscreen sizes as estimates instead. The existing
synchronous resizeItem pass plus TanStack's per-row ResizeObserver re-seed
connected rows with fold-based scroll compensation, so the anchor row holds
still; offscreen rows correct lazily as they connect. End-pinned transcripts
keep following the tail via the existing height-change scrollToEnd path.

Regression e2e: mid-transcript anchor stays within 60px across
1280->1000->820->1280 resizes (pre-fix: anchor scrolled out of the viewport
entirely and scrollTop drifted by 250px+). Wipe introduced in openclaw#115059,
refined by openclaw#117687/openclaw#123713 without addressing anchoring.

* test(infra): deflake ephemeral-port rebind proof under runner contention

The bind->release->rebind cycle races foreign processes on shared CI
runners: a stolen port between release and rebind fails the assertion
(EADDRINUSE, seen on checks-node-compact-large-17). Retry the whole cycle
on a fresh ephemeral port, bounded at 5 attempts; a genuine release
regression still fails every attempt because the collision is with our
own lingering listener.

* test: prove port release on the allocated port; add end-pin resize proof

Address ClawSweeper review on openclaw#124013:
- ports-probe: replace the fresh-port retry with a connect probe against the
  same allocated port. A lingering listener accepts the probe; a released
  port refuses it. Unlike a rebind, the probe does not collide with foreign
  outbound sockets that transiently occupy the port on busy runners, so the
  release contract stays tied to one port with no retry at all.
- chat-resize-anchor e2e: add a width-only end-pinned case proving the
  virtualizer's wasAtEnd compensation keeps the transcript within 2px of
  the end across 1280->1000->820->1280 resizes.

* test(ui): widen resize-anchor drift bound for Linux font metrics

The fold-spanning anchor row re-wraps by a renderer-dependent amount
(42px macOS, 63px Linux CI at 820px). 120px keeps a wide margin below
the pre-fix failure mode (anchor out of viewport, 250px+ drift).

* test(tooling): register manager-session-update-race in memory helper routing

openclaw#124024 added the memory-core test on main without updating the
cross-lane routing expectation in test-projects.test.ts, breaking the
core-tooling shard on every merge ref that includes it.
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. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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.

3 participants