Repository navigation
fix(ui): keep older chat history still while reading it - #190286
Conversation
Rows above the reader changed size without a same-frame correction: - mobile rows skipped by content-visibility kept their estimate until they reached the viewport, then pushed the visible messages down; - virtual-core lands row measurements a frame later, so each correction painted as a jump; - on iOS virtual-core defers corrections for the whole touch and momentum gesture, leaving the transcript displaced until it snapped. A reader anchor now compensates rows above the viewport during resize delivery with native geometry only (scrollTop, or a column shift on iOS that folds into scrollTop when scrolling settles) and reconciles when virtual-core lands the size. The history sentinel observes anew when a correction coincides with reaching the top edge. Co-authored-by: vyctorbrzezowski <[email protected]>
Worked on by: - @vyctorbrzezowski Co-authored-by: vyctorbrzezowski <[email protected]> OpenClaw-Publication: 1b49cc4a-1ce9-4ee7-8436-8ff6ecd56f5d
|
🦞👀 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 changes before merge. What this changesThis PR compensates for transcript row resizing so older chat messages stay in place while readers scroll upward. Example: Read upward through 160 older variable-height messages at a 390 px viewport.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 4 items remain Keep this useful, maintainer-authored PR open, but fix the hidden-panel scroll regression and two source-backed CI blockers before merging. Priority: P2 Before merge
Findings
Provenance
Tests
Agent review detailsHow this fits togetherThe Control UI transcript host combines paginated messages, virtual row measurements, and reader input to maintain the visible range and native scroll position. flowchart TD
A[Paginated chat history] --> B[Transcript host]
B --> C[Virtualizer and row renderer]
C --> D[Native row resize observations]
D --> E[Reader anchor]
E --> F[Scroll offset or held column shift]
F --> C
Technical reviewBest possible solution: Keep the host-owned reader compensation, preserve hidden-row measurements, and use a leaf dependency contract that passes the existing guards. Do we have a high-confidence way to reproduce the issue? The source exposes delayed row compensation and backward-scroll behavior, and the PR reports failing-base browser cases; this read-only review ran no target code. Is this the best way to solve the issue? Same-frame native compensation addresses the stated invariant without restoring resize-loop-prone range commits, but the new observer must honor the existing hidden-pane measurement contract. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f278c086c76a. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfaceSource +304, Tests +153. Total +457 across 10 files. Added test files: 1. View PR surface stats
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 Reviewed November 1, 2026, 6:49 AM ET / 11:49 UTC. |
A collapsed side panel reports zero-height rows; compensating them moved the restored reading position. Also type the reader anchor's host structurally so it does not import its owner, and drop the unchecked entry-target assertion. Co-authored-by: vyctorbrzezowski <[email protected]>
Worked on by: - @vyctorbrzezowski Co-authored-by: vyctorbrzezowski <[email protected]> OpenClaw-Publication: e5ce6995-83a6-4b8c-b7f9-7a487dbf4515
Worked on by: - @vyctorbrzezowski Co-authored-by: vyctorbrzezowski <[email protected]> OpenClaw-Publication: 81cfeeb3-954f-4e42-bf8d-c5d1ad277862
Follow the transcript measurement contract: hidden rows keep their last height, while a visible row may legitimately measure zero. Co-authored-by: vyctorbrzezowski <[email protected]>
Worked on by: - @vyctorbrzezowski Co-authored-by: vyctorbrzezowski <[email protected]> OpenClaw-Publication: e0ecec8d-a0d2-413d-ada7-408389b84f79
Problem
On mobile (reported from iOS Safari), messages jump around while you scroll up through older chat history after it loads. Three things cause it, and each one moves the messages on screen when a row above the viewport changes size:
content-visibility: auto(≤768 px). Offscreen overscan rows keep their virtual estimate (120 px) until they reach the viewport. Then they render at full size and push the messages being read down, by up to about 1,300 px in the repro.scrollTopwrite, so virtual-core holds every correction until scrolling settles. The transcript stays displaced for the whole fling, then snaps.Solution
TranscriptReaderAnchor(new, owned by the virtualizer host) watches mounted rows. When a row above the viewport changes size, it corrects during that same resize delivery, before paint, using native geometry only. It never commits the range, so the fix(ui): prevent resize errors when scrolling chat images #188470 contract still holds:scrollTop. Like virtual-core's own path, the write is recorded as maintenance and the native range grows first.scrollMarginso virtual and DOM offsets still agree. The shift folds intoscrollTopwhen virtual-core reports that scrolling has settled. It skips elastic overscroll.clientHeight0) report zero-height rows; those deliveries are ignored so a restored panel keeps its reading position.content-visibility: auto. The virtualizer already limits how many rows are mounted, so overscan rows now lay out (and get measured) while still offscreen.chat-transcript-header.ts(with the existing header-margin helper) to stay under the host's line budget.Evidence
ui/src/e2e/chat-history-reading-stability.e2e.test.ts: 30 recent + 160 older variable-height messages. It reads up to the top to load the older page, then reads upward through it for 240 frames, sampling the painted frame and following the first visible message.bf73e1aa): fails on all three — Chromium 390 px with iPhone UA: 36 shifted frames, worst 1,255 px; WebKit 390 px: 29 shifted frames, worst 1,246 px; Chromium 1280 px: 38 shifted frames, worst 809 px.chat-history-prepend-anchor(all variants, including touch and momentum),session-dashboard-active-panel(caught the hidden-pane case in CI; fixed and green),session-progress-scroll,chat-widget-autosize,chat-composer-accessory-focus,warm-boot,post-deploy-session-entry,chat-saved-attempt-navigation,claude-sessions,chat-flow.messaging: all green.chat-transcript-*tests, chat history, thread, page and session-progress suites — 988 tests green after merging currentmain.chat.startuppluschat.historypaging at 390 px with an iPhone UA, reading upward through about 90 messages (1,109 frames): 0 shifted frames on this branch, so no regression. In that harness the base build also showed 0, because the rows had real sizes cached before they mounted, so this run is no-regression evidence, not a reproduction.pnpm tsgo:ui, oxlint, stylelint, oxfmt, madge import cycles, assertion-safety ratchet,pnpm ui:i18n:verify,git diff --check.mainwas merged in to pick up the fix for an inheritedcheck-lint-core-2failure (src/skills/workshop/experience-review.test.ts, untouched here).Test change
chat-transcript-end-follow.browser.test.ts("holds the canceled viewport…") used to grow the earlier row in the same task ascancelScroll(). Now that is a real resize above the reader, and it gets compensated. The fixture now grows the row while the smooth journey is still in flight, which is the skipped-measurement case the test is about. The assertions are unchanged.Accepted edges
Not verified
Worked on by