Skip to content

fix(ui): keep older history still after prepend measurement - #199181

Merged
steipete merged 3 commits into
mainfrom
fix/ci436320-history
Nov 14, 2026
Merged

steipete merged 3 commits into
mainfrom
fix/ci436320-history

Conversation

@steipete

@steipete steipete commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes visible jumps while reading older chat history when newly mounted rows are measured just after a prepend restores the reader's position.

User Impact

Older messages remain in place as neighboring rows finish measuring. No configuration or migration is needed.

Why This Change Was Made

The reader anchor treated a restored measurement as ownership of the entire next ResizeObserver delivery. That also skipped compensation for other rows whose measurements the restoration had never included. Record the restored size on the existing per-row height owner so only that row is accounted for; remove the delivery-wide flag. Collect the resize batch in one fresh array and sort it in place, preserving the full geometry snapshot while eliminating one temporary array per entry plus the sort copy.

Keep the history test's readiness requirements unchanged and report message count and prefix scroll space separately. The original scheduled readiness timeout has not been reproduced; this PR repairs the independently reproduced measurement jump, and does not claim that passing replays establish a readiness fix.

Evidence

The static-size acceptance check is pnpm ui:check-performance:base e4d39f47a63dd4ea0aa7e3256f02765fab3709fa, comparing candidate and pinned main with the same installed toolchain and normalized build identity. Chat boot JavaScript may grow by at most 64 gzip bytes from that paired baseline; all other enforced metrics must hold. This is a static asset check, with no latency claim.

  • Linux CI reproduction: the WebKit 390px history case passed readiness, then a newly measured predecessor moved the visible message by 142px beyond the reader's requested movement.
  • New real-DOM/native-ResizeObserver regression fails on the original owner (40px jump) and passes with this repair. A negative control without the per-row receipt also fails by compensating an already restored row twice (60px jump).
  • All three original history-reading cases pass locally (Chromium 390px, WebKit 390px, Chromium 1280px; 34.05s invocation). The reader-anchor and geometry suites pass 38/38 (6.96s combined); prepend-anchor tests pass 16/16 (1.19s). Default tsrs chat typecheck, scoped lint, formatting, and git diff --check pass.
  • Independent Codex local review of the complete candidate against base e4d39f47a63dd4ea0aa7e3256f02765fab3709fa: P0–P2 scoped-clean, no findings. Local ClawSweeper was unavailable.
  • Paired static-size check passes with Node 24.22.1, Vite 8.3.5 and Pako 3.0.3: chat boot normalized gzip 1,314,238 → 1,314,244 bytes (+6, within the existing 64-byte allowance); startup +0, new-route +1, total CSS −1 byte. No budget or dependency changes.
  • Simplification: remove the delivery-wide ownership flag and reuse the existing per-row height map. Explicit resize-batch arrays drop from N+2 to one for N entries. Production delta is 21 additions / 17 removals; the focused regression adds 91 lines. The unchanged readiness contract has clearer failure output.

These are controlled owner-fixture captures from the existing regression, using a real browser and native ResizeObserver. They illustrate the measured scroll invariant and are not screenshots of the full Control UI. The 400×400 reader and red position guide are identical.

Before: retained row jumps 40px After: retained row stays at the guide
Before fix: controlled reader fixture jumps forty pixels After fix: controlled reader fixture remains at the reader guide

@clawsweeper

clawsweeper Bot commented Nov 14, 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 the app: web-ui App: web-ui label Nov 14, 2026
@steipete
steipete marked this pull request as ready for review November 14, 2026 20:38
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 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-14T21:09:35.340718Z 6344e5f 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 changed the title test(ui): expose older-history readiness state fix(ui): keep older history still after prepend measurement Nov 14, 2026
@steipete
steipete enabled auto-merge (squash) November 14, 2026 20:57
@steipete
steipete disabled auto-merge November 14, 2026 21:00
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 14, 2026
@clawsweeper

clawsweeper Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR records restored measurements per row so unrelated measurements can still preserve the reader’s position.

Example: A restored row grows from 150px to 210px, then an 80px predecessor replaces a 120px estimate.

  • Before: The delivery-wide skip leaves the retained row displaced by 40px.
  • After: The restored row is counted once and the predecessor’s correction keeps the retained row stationary.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The focused patch and native geometry regression are convincing, but the supplied fixture evidence does not complete the required product-level proof.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Older messages visibly jump when another row is measured after prepend restoration finishes.
Reason: The maintainer-authored direction restores the established stable-reading contract with a small change to the existing owner.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it addresses a concrete reader-position defect still present on current main, and no introduced correctness or security bug was identified.

Priority: P2
Reviewed head: 6344e5f46bb54da0390514960989ac6fd2c67430

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Provide redacted before/after recording or geometry logs from the built Control UI on an isolated real Gateway, showing prepend restoration followed by late predecessor measurement without retained-message displacement.
Agent review details

How this fits together

The Control UI transcript reader anchor reconciles native row measurements with virtualizer sizes and positioning owners, producing scroll or column corrections that preserve visible messages.

flowchart TD
  A[History prepend] --> B[Position restoration]
  B --> C[Per row height receipts]
  D[Native resize delivery] --> E[Transcript reader anchor]
  C --> E
  E --> F[Stable visible messages]
Loading

Technical review

Best possible solution:

Keep restoration accounting in the existing per-row height owner while compensating unrelated measurements through the existing reader anchor.

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

Current-main source demonstrates the delivery-wide suppression path, and the supplied native-browser regression and inspected captures isolate a 40px displacement; this review ran no target code.

Is this the best way to solve the issue?

The patch is the smallest complete repair identified: replace delivery-wide accounting with existing per-row receipts, preserve positioning ownership, and retain an independent geometry assertion.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Restoration and reader-anchor measurement accounting changes intended behavior with a stated reason (f725c9f: Prevent reader compensation from replaying measurements already handled by restoration, while correcting native layout changes before paint.)
  • Prepared-row exclusion and predecessor compensation keeps the original intent (fix(ui): stop completed transcripts bouncing during scroll #195097: Record out-of-flow preparation measurements without compensating visible in-flow content.)
  • Older-history readiness assertion keeps the original intent (3588c05: Enter older history through native reader input and require loaded messages plus real prefix scroll space before sampling.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source +4, Tests +91. Total +95 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 21 17 +4
Tests 2 98 7 +91
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 119 24 +95

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 test changes Production +21/−17 lines; tests +98/−7 lines The production change reuses existing state; the test growth covers the distinct restored-row plus unmeasured-predecessor failure and preserves readiness assertions.

Labels

Label changes:

  • add P2: Visible older-history jumps disrupt reading but do not prevent messaging or lose session data.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Visible older-history jumps disrupt reading but do not prevent messaging or lose session data.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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 14, 2026, 4:22 PM ET / 21:22 UTC.

@steipete
steipete merged commit a2892e8 into main Nov 14, 2026
104 of 106 checks passed
@steipete
steipete deleted the fix/ci436320-history branch November 14, 2026 21:25
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

* test(ui): expose older-history readiness state

* fix(ui): keep older history still after prepend measurement
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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S 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