Repository navigation
fix(ui): prevent dashboard chat messages from overlapping - #123713
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
af0486c to
ae51810
Compare
|
Codex review: needs maintainer review before merge. Reviewed August 14, 2026, 12:41 PM ET / 16:41 UTC. ClawSweeper reviewWhat this changesThe 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 provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessNo 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 Review scores
Verification
How this fits togetherDashboard 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]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +20, Tests +23. Total +43 across 4 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest 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. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
ae51810 to
77eb5d0
Compare
77eb5d0 to
d996320
Compare
|
Land-ready verification for exact head
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. |
|
Merged via squash.
|
…23713) Co-authored-by: Peter Steinberger <[email protected]>
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.
…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.
…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.
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
mainwith a focused regression: the second row rendered attranslateY(0px)after the detached first row measured as zero.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.oxfmt, focusedoxlint, andgit diff --checkpassed.--mode uncommitted, Codexgpt-5.6-sol, high) reported no accepted/actionable findings.AI-assisted: yes. The code path, dependency behavior, regression, and final diff were manually verified.