Skip to content

fix(ui): stop completed transcripts bouncing during scroll - #195097

Merged
steipete merged 8 commits into
mainfrom
solid2/w-perf-completed-scroll-cls-1107
Nov 8, 2026
Merged

steipete merged 8 commits into
mainfrom
solid2/w-perf-completed-scroll-cls-1107

Conversation

@steipete

@steipete steipete commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Problem and fix

A cold preceding fragment of a completed run entered the transcript at its estimated height. It moved retained content before native measurement corrected it. Census 7's one-wheel-plus-interpolation trajectory exposed a visible 206.5 px reversal at 2,000 messages. Current-main diagnostics also show a painted 273.94 px reversal at 400 messages.

Measure cold retained predecessors in the existing out-of-flow preparation slot, then admit their measured height. The reader anchor records that native measurement without compensating in-flow content. Ordinary rows bypass preparation. Refresh range extraction when claiming the predecessor so a resumed pane cannot wait for an unmounted row.

The broad candidate was discarded after approximately 15% ordinary-scroll Chromium task CPU growth. This focused version adds no cache, owner, listener, effect, or synchronous layout pass.

Correctness and visual proof

Check Result
Prepared-row lifecycle/pacing 32 passed, including hidden/resume and withheld measurements
Native Chromium geometry 31 passed, including short/exact-estimate predecessors and ordinary exclusion
Typecheck, targeted lint/format, production Knip Passed
Independent review No actionable P0–P2 findings
Current-head ordinary wheels 8/8 observations passed; Chromium/WebKit × two base/head pairs; all 105 wheels delivered and endpoint reached
Current-head mobile smoke 45/45 observations passed; five base/head/base triples per engine
4× completed-run diagnostics Five pairs per size; all endpoints exact, bounded mounted DOM
Exact-head CI Run42466714481, attempt2: all seven UI E2E and both real-Gateway shards passed. Nine jobs stopped at pinned-Bun staging; no failed test assertions. Native infrastructure exception requested, not green CI.

The prepared-row fixture previously sent ResizeObserver receipts only to parked rows. It now measures active/preparing rows while preserving explicit heights and deliberate withholding. Existing assertions remain; the short-predecessor regression fails on base with 450 px drift.

400-message verdict: extra initial screen motion falls from 273.94 px in all five base observations to ≤0.0625 px on head. Adjacent compositor images capture the base's jump and return while head stays aligned. Raw CLS remains nonzero on head; this is not a true-zero CLS claim.

2,000-message verdict: extra initial screen motion falls from 205.5 px in all five base observations to 0 px on head. The fresh base filmstrip misses the brief painted reversal before interpolation begins; earlier captures established the visible defect. Current-head geometry and images show no corresponding reversal. Both sides' raw CLS are zero in the fresh run, illustrating why CLS alone is insufficient here.

Current main and fixed head: adjacent compositor captures of the 400-message retained-content bounce

Blank-frame limitation: the interpolated trajectory produces real empty compositor captures on both builds. At 400 messages the count is 211/663 base versus 348/685 head; at 2,000 it is 364/728 versus 370/726. These are capture counts, not refresh-frame counts or blank duration. Two low-blank base runs retain stale prior-offset text where head shows empty new-offset content. The fixture writes roughly 1,566 px inside rAF after its geometry sample, exceeding the 846 px viewport; the sampled coverage and subsequent compositor image describe different phases. Do not call the 400 counts unchanged or claim this fixes the whole interpolation. A follow-up should first reproduce the direct-write presentation gap with realistic fast input. No speculative overscan change is included.

Ordinary native wheels provide the negative control: Chromium has 0/551 blank captures on base and 0/552 on head. Both Chromium and WebKit have no empty geometry samples, no >2 px backwards same-node motion, and no resize/audit errors. WebKit's check is geometry-only; compositor capture is unavailable. Existing column compensation remains responsible for native wheel continuity.

Timing qualification

Twenty rotated base/head/base triples per cell, headless at desktop size. Values are median / p95 across runs (ms); frame values summarize each run’s frame-gap p95. Base/base is the A/A control. Chromium alone exposes main-thread CPU.

Messages Engine Metric Base Head A/A Head change median / p95
400 chromium Application 2195.50 / 2211.30 2114.30 / 2125.20 2195.30 / 2205.40 -3.70% / -3.89%
400 chromium Task CPU 1012.40 / 1063.64 1007.91 / 1052.54 1011.49 / 1060.94 -0.44% / -1.04%
400 chromium Up frame p95 16.70 / 16.80 16.70 / 16.80 16.70 / 16.80 +0.00% / +0.00%
400 chromium Down frame p95 16.70 / 16.80 16.70 / 16.80 16.70 / 16.80 +0.00% / +0.00%
400 firefox Application 2188.50 / 2266.00 2182.50 / 2219.00 2193.50 / 2289.00 -0.27% / -2.07%
400 firefox Up frame p95 16.99 / 17.58 16.96 / 17.52 17.11 / 33.32 -0.18% / -0.34%
400 firefox Down frame p95 16.95 / 33.22 17.03 / 17.44 17.13 / 33.32 +0.47% / -47.50%
400 webkit Application 2169.00 / 2197.00 2161.00 / 2182.00 2171.00 / 2206.00 -0.37% / -0.68%
400 webkit Up frame p95 22.00 / 26.00 23.00 / 25.00 22.00 / 25.00 +4.55% / -3.85%
400 webkit Down frame p95 20.00 / 22.00 20.00 / 21.00 19.50 / 23.00 +0.00% / -4.55%
2000 chromium Application 2145.00 / 2191.30 2161.10 / 2190.20 2155.10 / 2177.30 +0.75% / -0.05%
2000 chromium Task CPU 1037.03 / 1122.50 1079.81 / 1133.52 1079.39 / 1154.74 +4.12% / +0.98%
2000 chromium Up frame p95 16.70 / 16.80 16.70 / 16.80 16.70 / 16.80 +0.00% / +0.00%
2000 chromium Down frame p95 16.70 / 16.80 16.70 / 16.80 16.70 / 16.80 +0.00% / -0.00%
2000 firefox Application 2307.50 / 2705.00 2295.00 / 2424.00 2248.00 / 2349.00 -0.54% / -10.39%
2000 firefox Up frame p95 17.17 / 33.32 17.33 / 33.32 16.93 / 17.28 +0.93% / -0.00%
2000 firefox Down frame p95 33.15 / 33.34 25.23 / 33.34 17.29 / 33.34 -23.89% / +0.00%
2000 webkit Application 2277.00 / 2401.00 2268.50 / 2336.00 2293.00 / 2406.00 -0.37% / -2.71%
2000 webkit Up frame p95 21.50 / 24.00 21.00 / 23.00 22.00 / 24.00 -2.33% / -4.17%
2000 webkit Down frame p95 24.00 / 26.00 23.00 / 25.00 24.00 / 28.00 -4.17% / -3.85%

Host one-minute load: chromium 2000: median 12.40, p95 16.87; chromium 400: median 11.59, p95 14.36; firefox 2000: median 12.46, p95 16.23; firefox 400: median 11.52, p95 15.36; webkit 2000: median 12.37, p95 16.45; webkit 400: median 11.57, p95 15.65.
Failures: 0; incomplete triples excluded: 0.

All six cells completed20 triples,360/360 observations passed. The earlier partial Firefox downward-cadence warning did not persist: final median25.23ms versus33.15ms base, p95 unchanged33.34ms. At2,000, Chromium task CPU changes+4.12% median/+0.98% p95, while A/A is+4.08%/+2.87%; no measurable change exceeds the requested band. Other frame-tail medians stay within5% with equal or lower p95. The bounce reduction is the intended correctness win; no cross-engine latency-speedup claim.

Earlier 20 rotated ordinary-wheel triples per engine exercised the same unchanged ordinary path: Chromium task CPU median/p95 1551.28/1610.98 → 1530.77/1604.82 ms; application 8167.5/8582 → 8166.5/8249.9 ms. WebKit application 5299/5365 → 5306.5/5414 ms (A/A 5290/5414); Firefox 6676.5/6866 → 6628/6878 ms (A/A 6695/6798). Fresh final-head wheel proof above verifies that behavior after the retained-only resume repair and main merge.

All browsers run headless against synthetic Gateway fixtures. Chromium task CPU is renderer main-thread CPU. WebKit application time/frame gaps are reported; its utilization sample is not action CPU. Firefox CPU/CLS are unavailable. Mounted DOM and anchors are covered; no post-GC heap-neutrality claim.

Size and scope

Built both sides on the same machine, after merging main 306bf7730b0. Runtime bundle built at 0c0c32812d7; final head 0462dfa08c6 only adjusts the Chat cap/comment.

Surface Main Head Delta
Chat normalized gzip 1,296,592 B 1,296,751 B +159 B
Chat served gzip 1,304,021 B 1,304,291 B +270 B
Chat raw JS 4,179,087 B 4,179,591 B +504 B
Startup normalized gzip 90,865 B 90,865 B 0 B
Startup CSS requests 1 1 0

Coordinator-accepted: +159 B normalized Chat gzip, within the coordinator's approximately 300 B allowance. Only Chat's cap moves to measured 1,296,751 B. Main's former cap was already 213 B below its measured build: total cap adjustment 372 B = existing 213 B deficit + actual 159 B growth. No additional headroom or other ceiling increase. Strict performance check passed.

Production owners: 1,118 → 1,147 lines (+29). Test allocation: 71 net added lines. Solid refactor audit: no added controller, effect, listener, DOM query, owner API, import boundary, or cache; existing flush count unchanged.

Reproduction commands
pnpm tsgo:ui
pnpm --dir ui test src/pages/chat/components/chat-transcript-prepared-rows.test.tsx --maxWorkers=1
pnpm --dir ui test src/pages/chat/components/chat-transcript-geometry-updates.browser.test.tsx --maxWorkers=1 --project=chromium-mock-registry
pnpm deadcode:knip
pnpm ui:build # Once on each pinned side; strict size check on the final cap.
node --import ./scripts/tsx.mjs scripts/bench-control-ui-engines.ts \
  --bundle-dir <base-bundle> --compare-bundle-dir <head-bundle> \
  --control-bundle-dir <base-bundle> --output <proof-directory> \
  --engines chromium,webkit,firefox --viewport desktop \
  --steps completed-direct-run-400-scroll,completed-direct-run-2000-scroll --pairs 20

Untraced timing is separate from the 4× Chromium filmstrip/layout audit. Base and head bundles are immutable throughout each rotated run. The same native harness drives the two ordinary-wheel pairs and the five mobile triples reported above.

CI exception attribution

The nine failed job roots are check-additional-boundaries, checks-ui (1/3), checks-ui (3/3), checks-node-compact-small-1, checks-node-changed, check-lint-core-1, check-lint, check-lint-extensions-3, and check-lint-core-2. They stop with HTTP504 while downloading pinned Bun or “could not stage the pinned fork.” One targeted retry of additional-boundaries failed at the same setup boundary. No product test assertion failed in this attempt. The aggregate CI gate reports those roots.

The actual CI checkout is merge 1fe6359f2d053c216405604ba5b429f91b2e53f8, with ordered parents main 64e82b39243dda0131cb960bad96ea933b66e8e9 and PR head 0462dfa08c6e26523da8351764b874641a07c895; its tree matches the reconstructed merge. Bun staging, pin, invocation owner, and workflow inputs are unchanged between baseline and this tested merge. Scheduled main run42467134059 independently logs the same Bun setup failures in UI1/UI3, additional-boundaries, compact-small1 and core-lint1/2. That run was not completed at observation; it corroborates the infrastructure incident, not a matching failed-test claim. The earlier completed main run passed these jobs. CI checks blocked by setup remain uncovered; local scoped checks and passing browser shards are listed above.

ClawSweeper’s old-head finding about prepared-row fixtures is resolved in 3ca082d096e: native receipts now reach active/preparing rows, explicit measurement withholding remains, and the existing32 cases pass. Current-head Codex review reports no findings.

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

clawsweeper Bot commented Nov 8, 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.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui scripts Repository scripts size: S labels Nov 8, 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. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 8, 2026
@steipete
steipete marked this pull request as ready for review November 8, 2026 07:55
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 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-08T09:21:58.149136Z 0462dfa 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.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 8, 2026
@clawsweeper

clawsweeper Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR measures cold completed-run overscan fragments outside normal flow before admitting them above visible messages.

Example: Scroll upward through a completed 2,000-message run.

  • Before: Retained checkpoint 1996 moves by 206.5 px and then returns after measurement compensation.
  • After: The incoming predecessor is measured outside flow so retained content stays aligned.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) A useful, narrowly owned repair with visual supporting evidence, but affected consumer tests currently fail and final qualification is incomplete.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Previously visible messages bounce while the reader scrolls upward through a completed long run.
Reason: The visual defect is demonstrated, and the maintainer-authored direction uses existing owners without new configuration or public contracts.

Merge readiness

⛔ Needs changes before merge - 1 item remains

This PR addresses a demonstrated transcript-rendering defect with a focused change to the existing preparation and reader-anchor owners.

Priority: P2
Reviewed head: 4cb49dcb8396a3adf28729ec705f35793ab5d881

Before merge

  • Update prepared-row consumers for predecessor-first preparation (P2) - Assigning the cold predecessor to the preparation slot changes the lifecycle assumed by the existing prepared-row suite. Its scroll helper delivers no row resize, and several cases deliberately disable measurement while expecting speculative preparation ahead of the viewport. Consequently the new predecessor occupies the slot instead: exact-head CI observes preparing index 3 where line 649 expects an index above 10, no next row at line 776, and no resumed preparation at line 601. Update these fixtures to deliver the predecessor's native measurement before asserting background preparation, retaining the bounded-cache, hidden-pane, and one-row-at-a-time assertions. These are directly affected consumers, not an unrelated CI failure.

Findings

  • [P2] Update prepared-row consumers for predecessor-first preparation — ui/src/pages/chat/components/chat-transcript-initial-range.ts:169-172

Tests

  • Missing end-to-end proof: Complete the narrowed head's browser scrolling qualification, including retained predecessors, ordinary wheel scrolling, and mobile jumps; the body explicitly excludes the earlier candidate's timing matrix.
Agent review details

How this fits together

The Control UI transcript virtualizer turns chat rows and native measurements into a bounded mounted window; preparation controls admission, and the reader anchor reconciles geometry without interrupting native scrolling.

flowchart TD
  A[Completed chat rows] --> B[Transcript virtualizer]
  B --> C[Initial range preparation]
  C --> D[Solid transcript rows]
  D --> E[Native resize measurements]
  E --> F[Reader anchor]
  F --> B
Loading

Technical review

Best possible solution:

Keep predecessor admission in the existing preparation slot and native-height owner, and adapt the existing prepared-row fixtures to that lifecycle.

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

Current-main admission allows a cold predecessor into normal flow before its native size lands, matching the supplied bounce sequence and reported base-failing browser regression; no target code was executed during this review.

Is this the best way to solve the issue?

Preparing the predecessor before admission addresses the painted displacement at its producer while preserving the existing measurement, retention, and scrolling owners.

Full review comments:

  • [P2] Update prepared-row consumers for predecessor-first preparation — ui/src/pages/chat/components/chat-transcript-initial-range.ts:169-172
    Assigning the cold predecessor to the preparation slot changes the lifecycle assumed by the existing prepared-row suite. Its scroll helper delivers no row resize, and several cases deliberately disable measurement while expecting speculative preparation ahead of the viewport. Consequently the new predecessor occupies the slot instead: exact-head CI observes preparing index 3 where line 649 expects an index above 10, no next row at line 776, and no resumed preparation at line 601. Update these fixtures to deliver the predecessor's native measurement before asserting background preparation, retaining the bounded-cache, hidden-pane, and one-row-at-a-time assertions. These are directly affected consumers, not an unrelated CI failure.
    Confidence: 0.93

Overall correctness: patch is incorrect
Overall confidence: 0.91

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Completed-run preparation and admission keeps the original intent (34e6076: Bound completed-run rendering and prepare retained fragments ahead of the viewport.)
  • Reader-anchor measurement readiness keeps the original intent (4c6f043: Require native receipts and virtual geometry to agree before positioning readers or end followers.)
  • Native scroll compensation keeps the original intent (d59f002: Keep retained content steady without cancelling native WebKit scrolling.)
  • Transcript performance diagnostics keeps the original intent (828623f: Measure completed-run scrolling and endpoint behavior across browser engines.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm --dir ui test src/pages/chat/components/chat-transcript-prepared-rows.test.tsx
  • pnpm --dir ui test src/pages/chat/components/chat-transcript-geometry-updates.browser.test.tsx src/pages/chat/components/chat-transcript-initial-range.test.ts src/pages/chat/components/chat-transcript-reader-anchor.test.ts
  • pnpm tsgo:test:ui
  • git diff --check

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit d59f002 adds ui/src/pages/chat/components/chat-transcript-reader-anchor.ts:36 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: d59f00281eb0; files: ui/src/pages/chat/components/chat-transcript-reader-anchor.ts)
  • RoboClaw: Raw commit f725c9f adds ui/src/pages/chat/components/chat-transcript-reader-anchor.ts:40 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: f725c9f7b923; files: ui/src/pages/chat/components/chat-transcript-reader-anchor.ts)

PR surface

Source +27, Tests +61, Other +31. Total +119 across 7 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 32 5 +27
Tests 1 61 0 +61
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 4 35 4 +31
Total 7 128 9 +119

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-test growth Transcript owners: +27 net lines; browser regression tests: +61 lines. The production growth reuses existing owners; the tests cover short predecessors, exact-estimate predecessors, and ordinary-row exclusion.

Labels

Label changes:

  • add P2: Visible scrolling instability affects reading completed long runs, with limited scope and no demonstrated data loss.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp 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: Visible scrolling instability affects reading completed long runs, with limited scope and no demonstrated data loss.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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 8, 2026, 3:32 AM ET / 08:32 UTC.

@steipete
steipete merged commit cf376b0 into main Nov 8, 2026
174 of 202 checks passed
@steipete
steipete deleted the solid2/w-perf-completed-scroll-cls-1107 branch November 8, 2026 09:59
@steipete

steipete commented Nov 8, 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 9, 2026
…195097)

* fix(ui): measure incoming transcript overscan outside flow

* fix(ui): restrict predecessor preparation to retained fragments

* fix(ui): mount pending transcript predecessors after resume

* perf(ui): set Chat cap to measured predecessor fix size
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. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts size: S 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