Skip to content

fix(ui): keep late-growing replies above the dock after scrolling to the end - #159955

Merged
steipete merged 2 commits into
mainfrom
steipete/fix-late-layout-end-follow
Sep 27, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/fix-late-layout-end-follow

Conversation

@steipete

Copy link
Copy Markdown
Contributor

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.recordLayoutCorrection before 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 with afterLateLayout 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.
  • Sibling E2E passed: chat-transcript-focus, chat-flow.history-recovery, chat-transcript-disclosure-anchor, and claude-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.

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.
@clawsweeper

clawsweeper Bot commented Sep 27, 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.

@steipete
steipete marked this pull request as ready for review September 27, 2026 23:22
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 Sep 27, 2026
@clawsweeper

clawsweeper Bot commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 27, 2026, 7:28 PM ET / 23:28 UTC.

ClawSweeper review

What this changes

The 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 provenance

Possible 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
Reviewed head: 9e768130a41c4bf3aa6357221a8fb0cf7f045598

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is small and follows the existing owner, with specific baseline and after-fix browser results reported; those runs were not independently executed here.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The Repository State classifies this as a member-authored PR, so the external-contributor proof gate does not apply. The changed production owner is the virtualizer offset callback; the PR body reports before/after browser runs of the chat dock scenario, but the supplied images belong to the earlier PR. No stored-data contract changes.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The Repository State classifies this as a member-authored PR, so the external-contributor proof gate does not apply. The changed production owner is the virtualizer offset callback; the PR body reports before/after browser runs of the chat dock scenario, but the supplied images belong to the earlier PR. No stored-data contract changes.
Evidence reviewed 9 items Introduced production change: The PR records nonzero virtualizer maintenance movement in the existing end anchor before publishing the scroll observation.
Current-main gap: At the fetched main revision, the virtualizer callback records scroll provenance but does not advance the end anchor. The main-to-PR comparison retains the proposed handoff.
Anchor contract: The existing anchor advances only when its captured offset matches the correction's starting offset; reconciliation otherwise preserves reader takeover.
Findings None None.
Security None None.

How this fits together

The 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +8, Tests +9. Total +17 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 10 2 +8
Tests 1 17 8 +9
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 27 10 +17

Review metrics

Metric Value Why it matters
Browser regression cost 4.9 s one-worker wall, reported The materially changed browser test remains within the repository's five-second target; CI time was still pending in the captured context.

Technical review

Best 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.

Labels

Label changes:

  • add P2: The patch addresses a visible chat scroll regression on current main with limited scope and no evidence that the regression shipped in the latest release.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The Repository State classifies this as a member-authored PR, so the external-contributor proof gate does not apply. The changed production owner is the virtualizer offset callback; the PR body reports before/after browser runs of the chat dock scenario, but the supplied images belong to the earlier PR. No stored-data contract changes.

Label justifications:

  • P2: The patch addresses a visible chat scroll regression on current main with limited scope and no evidence that the regression shipped in the latest release.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The Repository State classifies this as a member-authored PR, so the external-contributor proof gate does not apply. The changed production owner is the virtualizer offset callback; the PR body reports before/after browser runs of the chat dock scenario, but the supplied images belong to the earlier PR. No stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vyctor H. Brzezowski: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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.

@steipete steipete self-assigned this Sep 27, 2026
@steipete
steipete merged commit 3e0123b into main Sep 27, 2026
163 checks passed
@steipete
steipete deleted the steipete/fix-late-layout-end-follow branch September 27, 2026 23:38
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Sep 28, 2026
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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 28, 2026
…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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 28, 2026
…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.
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 P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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