Skip to content

fix: keep Latest destination mounted until scrolling settles - #196181

Merged
steipete merged 9 commits into
mainfrom
solid2/fix-latest-mounted-end-1110
Nov 9, 2026
Merged

steipete merged 9 commits into
mainfrom
solid2/fix-latest-mounted-end-1110

Conversation

@steipete

@steipete steipete commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes Latest stopping above the final answer after PageUp during a large tool turn, including a final row leaving the mounted virtual range.

User Impact

Latest keeps its destination mounted and measured until it rests within 8 px of the end for three stable idle frames. Fresh reader input still cancels it immediately.

Why This Change Was Made

The range owner released the destination before issuing the smooth scroll. Geometric arrival could then retire the journey against a temporary native extent. Keep that range until the last row is mounted and its recorded measurement matches the virtualizer, using the existing layout queue.

Native command ownership and destination retention have different lifetimes. Retire the native command at its existing endpoint, then let the range owner finish the three-frame measurement check. Retaining the command longer suppressed reader anchoring and reclaimed small reader movements. A prepared destination issues its command only once; subsequent commits resume the settlement stage. Native reader movement releases retained destination rows even when the command has already retired.

The full Firefox flow also exposed delayed PageUp movement cancelling a newer Latest while its destination was being measured. Preserve that unissued intent and native smooth settling; fresh reader input still releases both stages.

Evidence

The final byte comparison, typecheck, scoped lint, Knip, and spinner E2E regression were refreshed after merging main d325e9e069a. The unchanged Latest owner passed the complete growing-answer flow in Chromium and Firefox before this main merge. The full replacement CI is requested with ci:full.

Proof Result
Full 200-tool workload; PageUp → visible Latest → Enter; eight paragraph/code growth chunks; navigation and another Latest Chromium and Firefox pass: 200 ordered results, answer visible, ≤8 px for three stable frames
Destination-retention regression on main Fails: row 19 absent; passes with repair
Delayed PageUp regression with old guard Fails; passes with repair; fresh wheel cancellation retained
Native clamp/departure and saved-offset regressions from CI 42675277431 All eight reproduce on the previous PR head; the same selection passes on current main; repaired owner passes
Focused owner/consumer suites 80 contracts covered across four files; final five range tests pass, including native-reader cancellation; growing-history and MCP teardown regressions pass
Cached transcript refresh: one round, two rounds, eight appended pairs All three previously failing assertions pass locally. The Mac crashes natively when closing one context and opening another, so remaining cases ran in a fresh invocation; no product assertion was waived
UI typecheck, targeted format/lint, test-line allocation Pass
Production Knip Pass: repository pnpm deadcode:knip command
Production build and strict base comparison Pass; startup 91,766 B JS gzip, 38,756 B CSS gzip, 1 CSS request on both builds
Chat JS gzip 1,297,621 → 1,298,202 B (+581 B), charged to the coordinator-accepted receipt lane allowance; only Chat cap changes

The earlier 128 px/final-unmounted Firefox failure was captured in receipt qualification. Ten fresh main replays did not reproduce that exact rare outcome. The deterministic range regression demonstrates the premature release, and the growing-answer browser flow reproduced main stopping short before the repair. WebKit is unavailable on this host.

Production LOC: 2,324 → 2,389 (+65); changed tests: 1,120 → 1,267 (+147), preserving the existing temporary-clamp regression. The baseline was already 25 B above its old Chat cap; the cap now records the measured head. Startup and other caps are untouched. The range uses its existing frame queue, without a new timer or listener. Solid checklist: no added effects, untrack, listeners, DOM queries, cleanup, or owner APIs. Fresh independent review of the lifetime correction found no actionable P0–P2 findings.

CI repairs: 42670915437 exposed history-maintenance and native-jump regressions; 42675277431 exposed native clamp/departure, saved-offset, cached-refresh, and test-fixture typing failures. The lifetime separation repairs those contracts, and the test fixture now supplies complete typed rows. CI 42680391198 also exposed two unclassified-reader regressions and an obsolete direct-retarget test. Both reader regressions pass after allowing automatic commands to yield before issuance; the obsolete test is removed in favor of the real virtualizer growth proof. All 15 offset/history cases pass. Full UI CI is requested with ci:full.

Before: main stops while the answer continues below the viewport. After: Latest follows all eight growth checkpoints. Both captures were inspected and contain synthetic data only.

Before: main stops above the growing answer

After: final measured Latest destination

CI follow-up: 42683619151 passed43 jobs but its original and one retried UI E2E5/7 both failed keeps session titles on the first line and collapses rows that have no second line. CI tested merge87660e60e6d, including main #193930, which moved spinner ink from the host to ::before. The old local base lacked that CSS change, explaining its passing result. After merging current main, the same test reproduces all four color failures locally on main; the one-line assertion correction reads the painted pseudo-element and passes. No color assertion or theme/motion case was removed. Main's spinner-art browser test independently specifies the transparent host/static painted-child contract.

CI attribution for exact head c68cba2a0a1: Control UI session ownership > aligns Person left status at 1200 px and the 390 px variant fail with 14 px versus 13 px; Control UI mocked Gateway E2E > keeps a single web conversation with in-page native navigation and Dashboard handoff fails with header height 56 px versus 64 px. All three exact names and assertions reproduce on merge base d325e9e069a, whose UI tree is identical to the scheduled-main CI checkout e64c3514e41. The same main run 42692902936 reports those failures. The sidebar-rail-alignment.e2e.test.ts:201 no-shadow diagnostic also reproduces on the merge base. No assertion is waived or called passing.

The separate background-navigation and handshake failures passed their single E2E4 retry. The inline-plugin case passes on both the base and head in focused headless-shell runs; its single CI retry passed in run 42692079820, attempt 3. Node is used only for these Playwright E2E reproductions because the full-Chrome context-close path crashes on this Mac; the supported installed headless shell completes the same scenarios.

Native landing uses the documented inherited-failure route for those exact remaining failures. Full CI is not described as passing; the separate scope checks and complete Chromium/Firefox growing-answer proof pass.

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Nov 9, 2026
@clawsweeper

clawsweeper Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T20:23:06.698692Z c68cba2 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@steipete
steipete enabled auto-merge (squash) November 9, 2026 18:13
@steipete
steipete disabled auto-merge November 9, 2026 18:27
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Nov 9, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 9, 2026
@clawsweeper

clawsweeper Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR retains Latest destination rows until their measurements and native scrolling settle.

Example: Press PageUp during a 200-tool turn, activate Latest, and receive eight growing answer chunks.

  • Before: Scrolling can stop above the final answer after its destination leaves the mounted range.
  • After: The destination stays mounted until it is measured and rests within 8 pixels of the end for three idle frames.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful and visibly demonstrated, but the reviewed head reintroduces two established scroll-behavior failures.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after browser screenshots show the transcript stopping above later growth chunks on main and displaying checkpoint 8 after repair; the body records the 200-tool PageUp-to-Latest scenario in Chromium and Firefox.
Patch quality 🦪 silver shellfish (2/6) 2 actionable review findings remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Latest can stop above the final answer after navigating upward during a large tool turn.
Reason: The supplied browser evidence establishes a useful correction, and maintainer authorship supplies direction for the bounded settlement change.

Merge readiness

⛔ Needs changes before merge - 3 items remain

This PR addresses a real Latest failure, but introduced reader-position and automatic-follow regressions need repair before merge.

Priority: P2
Reviewed head: a1892971526c024269b138b795f4305e54e37c95

Before merge

  • Wait for destination measurements before retargeting automatic follow (P2) - When appended history changes the native extent while an end command remains active, this branch calls scrollToEnd immediately and bypasses prepareEnd's rowsMeasured check. Newly appended 120-pixel estimates are followed before their actual 97/71-pixel sizes arrive, restoring the backtracking that fix(control-ui): avoid warm chat reload backtracking #193217 removed. The exact-head warm-reload annotations show offset 6353 reversing to 6281 or 6318 and 70–144 pixels of excess movement. Retarget the existing command through the native measurement stage while preserving its identity.
  • Preserve reader departure while an arrived command awaits idle (P2) - The new completion condition leaves an already-arrived command active until native idle plus three frames, including smooth commands that no longer yield to unclassified backward movement. A reader departure followed by a temporary 400-to-500-pixel viewport clamp can consequently be treated as completion of Latest; cancelScroll(true) then restores end following and pulls the reader down when the viewport returns. The existing resize regressions fail on this exact head with offset 960 instead of 860, and native-departure cases retain maintenance ownership. Preserve destination measurement without allowing the delayed completion to reclaim that departed reader.
  • Explain or restore the original intent of Automatic follow during replacement measurements - 4c6f043: Automatic follow waits until mounted destination rows and native measurements agree to prevent visible backward corrections.

Findings

  • [P2] Wait for destination measurements before retargeting automatic follow — ui/src/pages/chat/components/chat-transcript-offset-observer.ts:103-108
  • [P2] Preserve reader departure while an arrived command awaits idle — ui/src/pages/chat/components/chat-transcript-end-anchor.ts:29-35

Provenance

  • Automatic follow during replacement measurements changes intended behavior without addressing why it exists (4c6f043: Automatic follow waits until mounted destination rows and native measurements agree to prevent visible backward corrections.)

Tests

  • Missing end-to-end proof: The supplied Latest screenshots cover the intended fix, while existing exact-head browser and warm-reload checks expose sibling regressions.
Agent review details

How this fits together

The Control UI transcript converts Latest requests, native input, and row measurements into virtual ranges and browser scroll positions.

flowchart TD
  A[Latest and reader input] --> B[Transcript scroll owner]
  B --> C[Initial range owner]
  C --> D[Mounted destination rows]
  D --> E[Native measurement receipts]
  E --> F[Layout settlement]
  F --> B
  B --> G[Browser scroll position]
Loading

Technical review

Best possible solution:

Keep destination retention in the existing range owner while preserving measured automatic retargeting and reader takeover after genuine arrival.

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

Current-main source releases the destination before smooth scrolling starts, supported by the supplied before screenshot and reported failing destination-retention regression; this review ran no target code.

Is this the best way to solve the issue?

Retaining the destination through the existing owner is appropriate, but completion and growth retargeting must preserve the earlier measured-follow and reader-position contracts.

Full review comments:

  • [P2] Wait for destination measurements before retargeting automatic follow — ui/src/pages/chat/components/chat-transcript-offset-observer.ts:103-108
    When appended history changes the native extent while an end command remains active, this branch calls scrollToEnd immediately and bypasses prepareEnd's rowsMeasured check. Newly appended 120-pixel estimates are followed before their actual 97/71-pixel sizes arrive, restoring the backtracking that fix(control-ui): avoid warm chat reload backtracking #193217 removed. The exact-head warm-reload annotations show offset 6353 reversing to 6281 or 6318 and 70–144 pixels of excess movement. Retarget the existing command through the native measurement stage while preserving its identity.
    Confidence: 0.97
  • [P2] Preserve reader departure while an arrived command awaits idle — ui/src/pages/chat/components/chat-transcript-end-anchor.ts:29-35
    The new completion condition leaves an already-arrived command active until native idle plus three frames, including smooth commands that no longer yield to unclassified backward movement. A reader departure followed by a temporary 400-to-500-pixel viewport clamp can consequently be treated as completion of Latest; cancelScroll(true) then restores end following and pulls the reader down when the viewport returns. The existing resize regressions fail on this exact head with offset 960 instead of 860, and native-departure cases retain maintenance ownership. Preserve destination measurement without allowing the delayed completion to reclaim that departed reader.
    Confidence: 0.96

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against ce7788f5a24e.

Provenance checked

  • Destination range retention changes intended behavior with a stated reason (34e6076: Bounded transcript preparation measures destination rows before smooth navigation without mounting the full history.)
  • Arrival retirement and temporary native clamps changes intended behavior with a stated reason (a1b45a4: Completion requires agreement between the issued target and native end while retaining earlier protection against delayed idle reclaiming a reader.)
  • Skipped measurements during smooth retargeting changes intended behavior with a stated reason (ac58919: Replay sizes suppressed during smooth scrolling when automatic following switches to a non-smooth command.)
  • Chat asset ceiling changes intended behavior with a stated reason (07a098f: Record the measured warm-page implementation cost under an accepted bounded allowance.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test ui/src/pages/chat/components/chat-transcript-initial-range.test.ts ui/src/pages/chat/components/chat-transcript-offset-observer.test.ts ui/src/pages/chat/components/chat-transcript-scroll-ownership.test.tsx ui/src/pages/chat/components/chat-transcript-controller.test.tsx --maxWorkers=1
  • pnpm test ui/src/pages/chat/components/chat-transcript-end-follow.browser.test.ts --maxWorkers=1
  • pnpm test ui/src/e2e/chat-snapshot-text-fidelity.e2e.test.ts --maxWorkers=1
  • pnpm tsgo:ui
  • Verify the shipped browser PageUp → Latest flow through all eight answer-growth checkpoints.

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 2a3aee2 adds ui/src/pages/chat/components/chat-transcript-offset-observer.ts:83 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 2a3aee2181a8; files: ui/src/pages/chat/components/chat-transcript-offset-observer.ts)
  • RoboClaw: Raw commit 796adff adds ui/src/pages/chat/components/chat-transcript-end-anchor.ts:22 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 796adfffb32b; files: ui/src/pages/chat/components/chat-transcript-end-anchor.ts)

PR surface

Source +34, Tests +100, Other 0. Total +134 across 10 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 91 57 +34
Tests 3 179 79 +100
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 3 7 7 0
Total 10 277 143 +134

Preflight source

Source 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

Metric Value Why it matters
Production versus regression coverage Production +94/-60 lines; tests +179/-79 lines. The net production growth retains destination ownership and samples settlement through the existing layout queue; added coverage targets retention, cancellation, parking, and growth.

Labels

Label changes:

  • add P2: Latest and reader-position correctness affect long-chat navigation without evidence of message loss or an unusable core workflow.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦞 diamond lobster and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: Latest and reader-position correctness affect long-chat navigation without evidence of message loss or an unusable core workflow.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦞 diamond lobster and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 9, 2026, 1:53 PM ET / 18:53 UTC.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6099fe1483

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +633 to +635
} else if (this.initialRange.preparingEnd && this.offsetState.scrollCommand?.target === "end") {
// An unissued end command is already preparing this destination.
return true;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Retarget issued end commands when their destination grows

Once a smooth Latest command is issued, preparingEnd now remains true until settlement, so this guard also skips automatic follow requests for already-issued commands, not just unissued preparation. It never checks whether the issued offset differs from the new endpoint. This contradicts the newly added retargets growth during Latest settlement without restarting unchanged motion regression: with its issued offset of 900 and native endpoint of 1100, this method returns true without calling virtualizer.scrollToEnd, so the test's first scroll assertion fails. Distinguish unissued preparation from issued motion and retarget changed destinations while preserving the current smooth behavior.

Useful? React with 👍 / 👎.

@steipete
steipete merged commit d122c1b into main Nov 9, 2026
243 of 261 checks passed
@steipete
steipete deleted the solid2/fix-latest-mounted-end-1110 branch November 9, 2026 21:47
@steipete

steipete commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 10, 2026
…w#196181)

* fix: keep Latest destination mounted until scrolling settles

* fix(ui): preserve reader takeover after Latest settlement

* fix(ui): separate Latest range retention from native scroll completion

* fix(ui): release automatic end preparation to reader movement

* chore(ui): reconcile measured Latest proof budgets

* test(ui): sample the painted spinner pseudo-element

* chore(ui): record Latest proof on current main
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 ci:full Keep ordinary native-locale CI selection on the next PR run. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant