Repository navigation
fix(ui): keep older history still after prepend measurement - #199181
Conversation
|
🦞👀 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 Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis 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.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete 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 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe 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]
Technical reviewBest 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
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +4, Tests +91. Total +95 across 3 files. Added test files: 0. View PR surface stats
Preflight sourceSource 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
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 14, 2026, 4:22 PM ET / 21:22 UTC. |
|
Merged via squash.
|
…#199181) * test(ui): expose older-history readiness state * fix(ui): keep older history still after prepend measurement
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.git diff --checkpass.e4d39f47a63dd4ea0aa7e3256f02765fab3709fa: P0–P2 scoped-clean, no findings. Local ClawSweeper was unavailable.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.