Skip to content

fix(ui): keep the chat transcript anchored while the pane resizes - #124013

Merged
steipete merged 5 commits into
mainfrom
steipete/virtualized-list-resize-jump-13b4ca
Aug 15, 2026
Merged

steipete merged 5 commits into
mainfrom
steipete/virtualized-list-resize-jump-13b4ca

Conversation

@steipete

@steipete steipete commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Resizing the chat pane (window resize, sidebar/split drag, dashboard dock) made the transcript text jump wildly: the reader was teleported to different messages and the view kept shifting for several frames while row measurements trickled back in. Reported live on team.openclaw.ai running ~main.

Before (viewport resized 1280→1100→960→820→back, reader mid-transcript):

resize-before.mp4

After (same sequence — the anchor row holds still while text re-wraps):

resize-after.mp4

Why This Change Was Made

The width-change path in the transcript virtualizer host called instance.measure(), wiping the entire item-size cache. That wipe has no scroll compensation: every offscreen row collapses to the 120px default estimate, so the content above the viewport changes height wholesale while scrollTop stays fixed — the visible range now maps to different rows. The subsequent corrections (sync resizeItem seed pass, rAF repeat, per-row ResizeObserver) each shift content again, frame by frame.

The wipe dates to #115059 (session-switch measurement retention) and was refined by #117687 and #123713 without addressing anchoring. The repair deletes the wipe and keeps stale offscreen sizes as estimates: the existing synchronous resizeItem pass re-seeds connected rows with fold-based scroll compensation (rows entirely above the fold adjust scrollTop by their delta), so the anchor row holds still, and offscreen rows correct lazily as they connect — the standard dynamic-virtualizer model. End-pinned transcripts keep following the tail through the existing height-change scrollToEnd path.

User Impact

Resizing the window, dragging the split, or docking the chat pane no longer loses the reading position. Mid-transcript readers stay on the same message; end-pinned sessions stay pinned.

Evidence

  • New regression e2e ui/src/e2e/chat-resize-anchor.e2e.test.ts: seeds 120 mixed-width messages, scrolls mid-transcript, resizes 1280→1000→820→1280. Pre-fix: the anchor row leaves the viewport entirely and scrollTop drifts 7021→7278. Post-fix: 0px drift at 1000, 42px at 820 (the anchor row itself spans the fold and re-wraps), byte-identical scrollTop back at 1280. Asserted bound: ≤60px.
  • Sibling suites green: chat-panel-reflow.e2e.test.ts (the overlap regression that motivated the wipe), board-split-transcript.e2e.test.ts, all 9 chat-transcript-controller.test.ts unit tests.
  • check:changed lanes green (format, typecheck core/UI, lint, i18n verify, knip dead-export local scans); remote proof backends were unavailable mid-run, local fallback used per policy.
  • Codex autoreview (gpt-5.6-sol, high): clean, no findings.
  • Production LOC delta: net 0 (4+/4−, one code line removed, comment reshaped); +152 test lines.

CI + Review Notes

First CI run failed only on checks-node-compact-large-17: src/infra/ports-probe.test.ts > can bind and release an ephemeral loopback port hit EADDRINUSE — an unrelated, flaky-by-construction assertion (bind→release→rebind races foreign processes stealing the freed port on shared runners). Per repo doctrine the landing PR carries the fix: the cycle now retries on a fresh ephemeral port (bounded, 5 attempts); a genuine release regression still fails every attempt. Focused proof: 4 consecutive green runs; Codex autoreview clean.

ClawSweeper findings addressed (head 265612feb68):

  • Rebind proof tied to one allocated port: replaced the retry with a connect probe against the same allocated port — a lingering listener accepts, a released port refuses (ECONNREFUSED). No retry remains, and the probe doesn't collide with foreign outbound sockets that transiently occupy local ports on busy runners (the actual flake class). Accepted-path proven against a live listener.
  • Width-only end-pin proof: added an end-pinned e2e case — the transcript stays within 2px of the end across 1280→1000→820→1280 width-only resizes, exercising the virtualizer's wasAtEnd compensation in a real browser.
  • Exact-head CI: green on db944816566; watching the new head.

Red-main repair carried per doctrine (head 0984f2e08a5): #124024 added extensions/memory-core/src/memory/manager-session-update-race.test.ts on main without updating the cross-lane routing expectation in src/scripts/test-projects.test.ts, breaking the core-tooling shard on every merge ref including it (first seen here as checks-node-compact-small-42). This PR registers the file in the expectation (rebased onto latest main so the fix is locally provable; tooling suite green locally). The Linux drift bound on the new e2e also gained renderer headroom (63px observed on CI vs 42px on macOS; bound now 120px, still far under the pre-fix 250px+/anchor-lost failure mode).

@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review August 15, 2026 04:39
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Aug 15, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 15, 2026
@clawsweeper

clawsweeper Bot commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 1:39 AM ET / 05:39 UTC.

ClawSweeper review

What this changes

The PR preserves transcript measurements during pane-width changes, adds browser checks for reader and end anchoring, and makes an ephemeral-port release test use a same-port connection probe.

Regression provenance

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

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep this maintainer-owned PR open for normal landing review: current main still clears the virtualizer cache on width changes, while the branch removes that path and supplies direct browser coverage. No concrete patch defect was found; direct inspection of the pinned virtualizer source remains unavailable in this checkout.

Priority: P2
Reviewed head: 0984f2e08a54dfc9d4da72ad4f8c8aae1605a6b0
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The PR has strong user-visible evidence and focused regression coverage, with one remaining dependency-contract verification gap.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (recording): Before/after recordings plus browser-driven, after-fix anchoring checks directly cover the visible Control UI resize behavior.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (recording): Before/after recordings plus browser-driven, after-fix anchoring checks directly cover the visible Control UI resize behavior.
Evidence reviewed 6 items Current-main behavior: Current main calls the virtualizer-wide measurement reset whenever transcript width changes, so the reported path remains present and this PR is still necessary.
Owner-boundary change: The PR removes only the wholesale reset and retains the existing connected-row resize path, keeping width invalidation in the transcript virtualizer host.
Browser regression coverage: The added Playwright test uses 120 variable-height messages, verifies the mid-transcript anchor through three widths, and separately verifies end pinning.
Findings None None.
Security None None.

How this fits together

The Control UI chat transcript virtualizes message rows while users resize panes, windows, and dashboard docks. Row measurements determine both visible placement and the scroll position seen by mid-transcript and end-pinned readers.

flowchart LR
A[Pane width change] --> B[Transcript virtualizer host]
B --> C[Connected row measurement]
C --> D[Virtual row size cache]
D --> E[Scroll anchoring]
E --> F[Visible chat transcript]
Loading

Decision needed

Question Recommendation
Is the existing before/after browser evidence and focused regression sufficient to accept this virtualizer behavior change without an independent local read of virtual-core 3.17.7? Verify the pinned virtualizer contract: Inspect virtual-core 3.17.7 on an environment with the package available, then merge after exact-head checks pass.

Why: The patch depends on the virtualizer’s scroll-adjustment semantics, but the dependency source is absent from this read-only checkout and could not be fetched.

Before merge

  • Resolve merge risk (P1) - The exact TanStack Virtual 3.17.7 source/types were unavailable locally, so the claimed compensation contract is supported by browser proof but not independently verified from the dependency implementation.
  • Resolve merge risk (P1) - The supplied check rollup still has exact-head UI and compact lanes in progress; landing should wait for those required gates.
Agent review details

Security

None.

PR surface

Source 0, Tests +225. Total +225 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 1 4 4 0
Tests 3 227 2 +225
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 231 6 +225

Review metrics

Metric Value Why it matters
Production vs test delta production +4/-4 (net 0); tests +227/-2 The functional repair is net-neutral production code, with most added surface devoted to browser regression coverage.

Merge-risk options

Maintainer options:

  1. Verify the virtualizer contract before merge (recommended)
    Confirm that virtual-core 3.17.7 preserves the required scroll adjustment for connected-row resize operations, then wait for the exact-head browser and compact checks.
  2. Accept the demonstrated behavior
    Maintain the current implementation based on its direct browser evidence despite the unavailable local dependency source.

Technical review

Best possible solution:

Keep the owner-level deletion of the cache wipe, confirm the pinned virtualizer’s resize compensation contract from its source or types, and land after the current-head browser and compact checks are green.

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

Yes, source-reproducible: current main resets all measurements on a width change, and the PR’s focused browser scenario drives a long, mixed-height transcript through the affected resize sequence.

Is this the best way to solve the issue?

Yes, conditionally: removing the owner callback’s wholesale reset is narrower than compensating downstream scroll positions, but the pinned virtualizer contract should be checked before merge.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This repairs reader-position stability in the web chat transcript during common pane-resize actions.
  • merge-risk: 🚨 other: Retaining stale virtual-row estimates changes non-obvious layout and scroll behavior until rows reconnect and remeasure.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (recording): Before/after recordings plus browser-driven, after-fix anchoring checks directly cover the visible Control UI resize behavior.
  • proof: sufficient: Contributor real behavior proof is sufficient. Before/after recordings plus browser-driven, after-fix anchoring checks directly cover the visible Control UI resize behavior.
  • proof: 🎥 video: Contributor real behavior proof includes video or recording evidence. Before/after recordings plus browser-driven, after-fix anchoring checks directly cover the visible Control UI resize behavior.

Evidence

What I checked:

Likely related people:

  • steipete: Merged history connects Peter Steinberger to the session-render preservation and recent transcript-host lifecycle changes around this owner. (role: recent transcript-host contributor; confidence: high; commits: 3f209cf1b7b6, 2ebaebd48473; files: ui/src/pages/chat/components/chat-transcript-controller.ts)
  • Patrick-Erichsen: The merged panel-resize repair directly precedes the current width-invalidation behavior. (role: previous resize-path contributor; confidence: high; commits: 0e496843a8d4; files: ui/src/pages/chat/components/chat-transcript-controller.ts, ui/src/e2e/chat-panel-reflow.e2e.test.ts)

Rank-up moves

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

  • Verify the pinned virtualizer’s resize compensation behavior from its source or types.
  • Wait for the exact-head browser and compact CI lanes to finish green.

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 (4 earlier review cycles)
  • reviewed 2026-08-15T04:44:41.520Z sha 892463fdaa3f958d86f4bd2287cbf4c8b979e1e9 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-15T05:01:48.183Z sha db944816566f5d684d39e34929a9d107ad77bb30 :: found issues before merge. :: [P2] Keep the rebind proof tied to one allocated port
  • reviewed 2026-08-15T05:19:12.884Z sha 265612feb68ddcd549242792ba1a32d7c27c8995 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-15T05:29:09.704Z sha 808f8e45dc8966ae224f0de537760b975c38e211 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 15, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels 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.
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.
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.
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).
…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.
@steipete
steipete force-pushed the steipete/virtualized-list-resize-jump-13b4ca branch from 808f8e4 to 0984f2e Compare August 15, 2026 05:32
@steipete
steipete merged commit 8b200f3 into main Aug 15, 2026
199 of 200 checks passed
@steipete
steipete deleted the steipete/virtualized-list-resize-jump-13b4ca branch August 15, 2026 06:00
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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 merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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