Repository navigation
fix(ui): keep late-growing replies above the dock after scrolling to the end - #159955
Conversation
Carry virtualizer maintenance writes into the existing end anchor before publishing their offset observations. Keep layout and composer correction receipts on their existing owner paths so they are not applied twice. This repairs late-layout end-follow after #159806: a clamped measurement retry could move the viewport 11px while leaving the captured anchor stale, causing reconciliation to abandon the final reply below the dock. Extend the browser wheel-intent cases with same-task intrinsic growth above and at the end of the viewport, without requesting a render. The downward case fails on the baseline and passes with the receipt handoff; upward reader intent remains preserved. No new geometry reads or per-frame work.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 27, 2026, 7:28 PM ET / 23:28 UTC. ClawSweeper reviewWhat this changesThe Control UI now passes virtualizer maintenance scroll movements to the chat end anchor so a late-growing reply stays above the composer dock while reader scrollback remains respected. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review Current main still lacks the virtualizer correction handoff, so this focused fix remains useful. Source review found no discrete patch defect; the reported browser regression runs support the approach, subject to normal PR gates. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI renders chat messages in a virtualized transcript. Row measurements and reader input change its scroll position; the offset observer and end anchor decide whether to keep the newest reply in view. flowchart LR
A[Chat messages] --> B[Virtualized transcript]
C[Reader scroll input] --> D[Offset observer]
B --> D
D --> E[End anchor]
E --> F{Follow allowed?}
F --> G[Newest reply above dock]
F --> H[Reader position preserved]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +8, Tests +9. Total +17 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep virtualizer measurement corrections in the existing end-anchor flow and retain browser coverage that distinguishes end-follow from deliberate reader scrollback. Do we have a high-confidence way to reproduce the issue? Yes. The current-main callback and browser scenario identify a concrete path: reach the end, then grow an earlier row and the newest reply in one task; this read-only review did not execute it. Is this the best way to solve the issue? Yes. Passing the actual virtualizer movement to the existing anchor is a narrow repair, and the test checks that upward reader intent still prevents following. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against db61a52647ce. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
Refresh application, plugin, native, build and container dependencies through the fixed 2026-09-19T16:27:11Z cutoff. Migrate native TypeScript snapshot/printer APIs while preserving compilation and filesystem contracts; retain existing patches and compatibility holds. Document offline container-image preparation. Include the verified compiler process-census and loading-clock fixture repairs and deterministic warm-history regression. Adopt the canonical production history fixes from #159924 and #159955. Land under the maintainer's explicit approval to treat proven pre-existing CI failures as non-blocking and repair main afterward. CI36365552098 failed an unchanged Android Compose fixture's asynchronous catalog projection assertion (3518 passed,1 failed); the Android/Gradle tree matches its main parent byte-for-byte. Security and dependency reviews passed. The final rebase preserves reviewed source changes and regenerates only the intentional Node-image documentation fingerprint. See PR159401 for complete validation and the follow-up repair obligation.
…w#159955) Carry virtualizer maintenance writes into the existing end anchor before publishing their offset observations. Keep layout and composer correction receipts on their existing owner paths so they are not applied twice. This repairs late-layout end-follow after openclaw#159806: a clamped measurement retry could move the viewport 11px while leaving the captured anchor stale, causing reconciliation to abandon the final reply below the dock. Extend the browser wheel-intent cases with same-task intrinsic growth above and at the end of the viewport, without requesting a render. The downward case fails on the baseline and passes with the receipt handoff; upward reader intent remains preserved. No new geometry reads or per-frame work.
…aw#159401) Refresh application, plugin, native, build and container dependencies through the fixed 2026-09-19T16:27:11Z cutoff. Migrate native TypeScript snapshot/printer APIs while preserving compilation and filesystem contracts; retain existing patches and compatibility holds. Document offline container-image preparation. Include the verified compiler process-census and loading-clock fixture repairs and deterministic warm-history regression. Adopt the canonical production history fixes from openclaw#159924 and openclaw#159955. Land under the maintainer's explicit approval to treat proven pre-existing CI failures as non-blocking and repair main afterward. CI36365552098 failed an unchanged Android Compose fixture's asynchronous catalog projection assertion (3518 passed,1 failed); the Android/Gradle tree matches its main parent byte-for-byte. Security and dependency reviews passed. The final rebase preserves reviewed source changes and regenerates only the intentional Node-image documentation fingerprint. See PR159401 for complete validation and the follow-up repair obligation.
What Problem This Solves
Fixes: after scrolling down to the latest message, a reply that grows late (media or markdown finishing layout) can end up partly hidden under the composer and pull-request dock instead of staying pinned to the end. Regression from #159806.
User Impact
User impact: a reader at the end of a chat stays at the end when the newest reply finishes laying out, including when a row above the viewport is re-measured at the same time. Scrolling up to read history still turns follow off.
Why This Change Was Made
#159806 moved end-follow onto explicit correction receipts. The layout owner and the composer advance the end anchor when they move the viewport, but one writer was left out: TanStack's measurement compensation. When a row above the viewport is re-measured, the virtualizer queues a scroll adjustment clamped by the old range and retries it after the grown range commits. That write was already recorded as maintenance, but the end anchor never learned about it. Reconciliation then treated the moved offset as the reader leaving the end and dropped the anchor. Tracing the failing run showed the anchor at 4582, a maintenance write moving the viewport to 4593, the anchor cleared because |4593 − 4582| > 1, and the reply left 199 px from the end.
The offset observer now forwards actual (nonzero) virtualizer maintenance writes to the existing
endAnchor.recordLayoutCorrectionbefore publishing its observation. Layout and composer receipts keep their current path, so nothing is applied twice. No new geometry reads or per-frame work.Evidence
ui/src/e2e/chat-scroll-dock.e2e.test.ts> "keeps replies above the dock" was bisected against current main in isolated full-file runs. perf(ui): keep streaming chats responsive #159806's parent passed 12/12; perf(ui): keep streaming chats responsive #159806 and later commits failed about 8/20, always withafterLateLayout distance from bottom: {"distance":199,...}. With this fix it passed 12/12 consecutive runs (96/96 cases).chat-transcript-end-follow.browser.test.ts: the wheel-intent table now also grows a row 11 px above the viewport in the same task as the final-row growth. On current main the downward case fails at distance 200 instead of 0; with the fix, all 16 cases pass. Upward wheel intent still does not follow. Cost: 4.9 s runner wall with--maxWorkers=1(file 4.0 s). It uses a single zero-delay task boundary, not a sleep.chat-transcript-focus,chat-flow.history-recovery,chat-transcript-disclosure-anchor, andclaude-sessions, 21 tests. The end-anchor, scroll-ownership, controller, prepend-anchor, follow-continuity, geometry, row-refs, and position-rail-scroll unit files passed, 124 tests.pnpm tsgo:ui, oxfmt,git diff --check, and the changed-lane lint and dead-export scans pass. An independent Codex review through P2 was scoped-clean.Production lines: +10 / −2.