Repository navigation
fix(ui): keep the chat reader's text still while scrolling and while content renders late - #199080
vyctorbrzezowski merged 14 commits into
Conversation
…op visible chat row A page-preview card that loads its screenshot late inside a message already on screen pushed the text the reader was looking at down by the image height. The transcript disables native scroll anchoring, and the reader anchor only compensated rows entirely above the viewport. The reader anchor now records the first content at or below the viewport's top edge inside the row crossing it, after each native scroll and resize delivery, and corrects growth above that content the same way row corrections are applied. Virtual-core's later landing of that row skips the already-applied growth, a scroll event before the resize delivery keeps the earlier record, and the record is refreshed when entering-bubble animations end.
…ow its row A Mermaid diagram rendering late inside the message at the viewport's top edge moved the reader's text by the diagram height, and the in-row scroll correction ran before virtual-core knew the row had grown, so the range dropped the reader's row. A disclosure opened through a control the reader cannot see kept that control's row top in place, pushing the visible text below it down. The reader anchor now selects content like native scroll anchoring: it walks into the content the top edge cuts and anchors on the first content starting at or below it, with the content after each ancestor as fallbacks when a rendered replacement detaches the first. In-row corrections go through the existing row correction path, so virtual offsets follow the scroll and the landed size owes no further scroll. A capture after a resize delivery no longer keeps a record from before a change already laid out. The interaction anchor keeps a visible control's row in place as before; for a control the reader cannot see, it keeps the reader's recorded content in place instead, and still suppresses end-follow while it settles. The late browser-preview e2e is replaced by a Mermaid e2e: automatic browser preview cards were removed in openclaw#197549.
Scrolling up, a row prepared outside the flow joins it together with newly mounted rows. The reader anchor treated any measured row as retained content, so the prepared row became the retained one and a new row mounted after it, between it and the text the reader sees, was not compensated: its estimate error (240 px estimated, about 34 px rendered for a settled tool row) moved the visible text against the scroll. Retained content is now the rows laid out in the flow at the last resize delivery.
…asured Rows scrolled into view above laid-out content entered the flow at their real size while the flow's start still counted their estimate, so a fast upward scroll through settled tool rows (estimated 240 px, rendered ~34 px) moved the text being read against the scroll. Such rows now stay prepared, painted at their slot, until all of them are measured. Their landing corrects scrollTop in the same frame, written by the reader anchor rather than deferred by virtual-core on iOS, and the flow redraws in that frame. A row measuring exactly its estimate is admitted too.
Partly visible text still moved during fast upward scrolls: - Rows arriving inside the viewport, and the forecast rows prepared ahead of a wheel, were painted at their estimated slot (120 or 240 px), clipped, and then moved by hundreds of pixels when they joined the flow. - In a batch of landings, the last row could see no laid-out content because earlier landings had moved virtual-core's range. Its size change then went uncorrected (about 23 px). A row outside the flow now paints only once its size and those of the rows between it and the flow are known; until then it stays unpainted. The reader anchor finds the flow among the mounted rows rather than in the virtual range. Arriving rows whose size virtual-core already knows enter the flow directly, which removes the extra commit on return scrolls. The scroll regression test now uses a mixed agent session and checks every visible text block, including partly visible ones. The two forecast tests from openclaw#196173 now expect unmeasured forecast rows to stay unpainted.
|
🦞👀 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: blocked before merge. What this changesThis PR coordinates transcript measurement, row admission, and content anchoring to keep the reader’s text steady. Example: Scroll upward through a saved session containing settled tool calls.
Review scores
ProductKind: Bug fix · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this PR addresses a verified upstream scrolling bug, and the previous allocation finding is fixed; the disclosed blank-frame tradeoff and increased byte budget still need an owner decision. Priority: P2 Decision needed
Before merge
FindingsNone. Agent review detailsHow this fits togetherThe Control UI transcript turns session messages into virtual rows; its existing presentation and geometry owners coordinate browser measurements, row placement, and scroll corrections. flowchart TD
A[Session messages] --> B[Virtualizer host]
B --> C[Initial range and forecast]
C --> D[Solid transcript rows]
D --> E[Browser measurements]
E --> F[Reader anchor]
F --> B
Technical reviewBest possible solution: Use the existing anchoring owners to eliminate reverse jumps without increasing blank-frame frequency, splitting the late-content repair if necessary. Do we have a high-confidence way to reproduce the issue? Current-main source exposes both estimated-row admission and missing in-row compensation, supported by the supplied real-Gateway measurements and inspected before/after images; this review executed no reproduction. Is this the best way to solve the issue? The repair appropriately extends existing owners and removes the separate predecessor path, but its broader admission policy needs the UI owner’s judgment on the measured blanking cost. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e6a222e1621a. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +325, Tests +542, Other +3. Total +870 across 17 files. Added test files: 3. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (4 earlier review cycles)
Reviewed November 15, 2026, 12:33 AM ET / 05:33 UTC (Revision 5). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
The strict scroll e2e's phone-size WebKit flick case and the cold-load restore check's settle wait add 60 net test lines; the allocation covers them (542 net lines against the merge base).
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
vyctorbrzezowski
left a comment
There was a problem hiding this comment.
Reviewed the updated scrolling implementation and the published before/after evidence. I accept the documented tradeoff: more frequent transient blank bands in exchange for keeping the reader's text stable.
I fixed the CI setup omission: the new scroll regression now selects WebKit installation. On Tempbook, both unchanged browser cases pass (Chromium and phone-size WebKit). The exact CI discovery code selects no WebKit before the fix and selects it afterward. Workflow lint/security checks and formatting also pass; independent review found no additional actionable issues.
The real-Gateway and iOS Simulator runs remain the contributor's evidence; my fresh execution was the automated browser regression. No production changes were added in this pass.
Thanks @daniel-lxs for addressing the findings and documenting both the improvement and its limits.
|
Merged via squash.
|
…content renders late (openclaw#199080) Keep the reader's text stable as measured rows enter the flow and content renders late. Register the mixed-row regression for WebKit installation in CI. Validated with Chromium and phone-size WebKit regressions, workflow checks, and independent review. The documented transient-blanking tradeoff is accepted. Co-authored-by: Daniel <[email protected]> Co-authored-by: Vyctor H. Brzezowski <[email protected]> Co-authored-by: vyctorbrzezowski <[email protected]> Co-authored-by: Vyctor H. Brzezowski <[email protected]>
Fixes #198500
What Problem This Solves
The Control UI chat moves the text being read when settled tool rows enter the viewport during an upward scroll, or when a Mermaid diagram or tool disclosure grows above it. Estimated row heights and painting rows before measurement make the same text appear in one place and then move.
User Impact
The reader's text stays in place while scrolling through tool-heavy history and while content above it renders late, in Chromium and phone-size WebKit.
There is a visible tradeoff: blank frames over 40 px are more frequent. The hold leaves rows unpainted until they are measured. In the real-Gateway VM comparison below, the overall largest blank band and longest blank interval are smaller, even though blank bands occur more often.
Accepted edge cases:
scrollTop0, native scrolling clamps a negative correction, so the first rows can still shift.Implementation
Production changes stay in the chat transcript code, plus the chat boot JS budget.
Restore, scroll commands, history prepend and end-follow retain their existing positioning ownership.
Changed contracts and budgets
chatBootJsGzipBytesincreases by 1,333 B gzip, from 1,310,894 B to 1,312,227 B. The measured production tree is 1,311,778 B. The 21 chat boot JS requests against a limit of 20 also occur with main's transcript files.Evidence
Real-Gateway VM comparison
Compared main
d3438ecwith PR headea06ca2in a macOS VM using an isolated real Gateway and saved synthetic sessions containing prose, tables, code and settled tool calls. Chromium uses a 1280×900 viewport with slow and fast upward wheel input. WebKit uses a 390×844 viewport with an iPhone user agent and repeated programmatic momentum steps. This is browser-driven proof, not a physical trackpad or iPhone test.The sampler tracks the same painted text blocks between frames. The comparison excludes the transcript-start region, where native scroll clamping is an accepted edge case.
d3438ecea06ca2Jumps are eliminated in this comparison, but blank frames over 40 px are more frequent in both browsers. The overall maximum band is 537 px versus main's 758 px, and the longest observed interval is 384 ms versus 434 ms. The hold deliberately leaves rows unpainted until measured, trading more frequent blank bands for stable text. The size and duration comparison is for the overall maxima, not a claim that each browser's blank bands shrink.
Visual examples
These captures illustrate the reader-stability change. The exact-head VM measurements are in the table above.
Main during fast upward scrolling: the same line moves up about 206 px against the scroll.
With the reader-stability change, the same line stays at y=178 px.
Mermaid with synthetic content:
Regression coverage and validation
tsconfig.ui.json), oxlint and oxfmt pass. The document, largest CSS, largest JS and total CSS budget reports match main's transcript files. Full exact-head CI is tracked by this PR's checks; these local results do not replace it.