Repository navigation
fix(ui): preserve the reading position when transcript ranges shrink - #199747
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: stale review; fresh review needed. Summary Next step Review history (1 earlier review cycle)
|
|
Merged via squash.
|
…penclaw#199747) * fix(ui): preserve the reading position when transcript ranges shrink * fix(ui): reuse transcript positioning ownership decision
What Problem This Solves
Fixes chat unexpectedly moving farther from the end when a previously estimated row becomes shorter while the reader scrolls upward.
User Impact
Readers keep their position near the end of a conversation as offscreen measurements settle. No migration or configuration change is required.
Why This Change Was Made
A deferred measurement shrinks the scroll range, so the browser clamps the native offset before the reader anchor applies its correction. Applying that correction to the already clamped offset counts the shrink twice. Preserve the offset before committing the range, matching the owner's existing resize handling.
This reproduces the exact 18 px failure in the 80-message LTR case of
chat-position-rail-layout.e2e.test.tsin scheduled CI 43746768156. The separate disclosure assertion from that job remains unresolved and is not claimed fixed here.Evidence
pnpm tsgo:ui(tsrs), changed test typecheck, scoped lint, format and diff checks pass.113d6243f36094de453622a9e5cbb25da029b83c, with the complete owner, regression and caller context: no actionable findings. Local ClawSweeper built entrypoints were unavailable; hosted review follows the repository route.After #199746 landed, the only conflict was both branches inserting a regression at the same location. Both test bodies are retained unchanged. Combined proof passes all nine owner browser cases and the unchanged lightbox, rail and disclosure E2E cases (three selected); default tsrs, scoped lint/format and fresh complete-context P0–P2 review pass. Previous-head CI 43755961115 passed all 30 jobs. The conflict-resolution head failed its bundle comparison: chat boot grew 207 normalized gzip bytes over the rebuilt base. Removing a redundant prepend-anchor read already implied by the existing ownership decision repairs that regression. The unchanged committed comparison now passes: chat boot normalized gzip 1,313,389 → 1,313,392 B (+3 B within the existing 64 B allowance); raw 4,237,227 → 4,237,228 B (+1 B); requests 21 → 21. New Session normalized gzip and request count stay unchanged (815,902 B, 17 requests). No budget or baseline changed. Final local proof repeats all nine native owner cases and the unchanged original rail and lightbox E2Es; default tsrs, scoped lint/format and fresh complete-context P0–P2 review pass. Current-head CI 43758684562 completed successfully at
78784ad884ead8ce85cafbbaf1227a4ba17a4528: all 30 planned jobs passed, including the repaired bundle gate.The fix adds four production lines and removes two, plus one focused native regression. It reuses the existing positioning decision and pre-commit offset handling, with no new owner, state, helper, timeout, tolerance or assertion change.
Comparable synthetic captures immediately after the original upward wheel: before is 22 px from the end; after is 5 px, within the unchanged 4±1 px assertion. Capture instrumentation was removed from the final source.
Bundle acceptance: run the committed
pnpm ui:check-performance:base 113d6243f36094de453622a9e5cbb25da029b83cworkload against the same installed toolchain. Keep existing normalized route byte/request budgets and the 64-byte build-variance allowance unchanged. Compare emitted raw bytes, normalized gzip bytes and request counts; no wall-time performance claim.