Repository navigation
fix(ui): preserve conversation scroll position across panel toggles - #190252
Conversation
Ignore zero-width ResizeObserver row receipts captured while a retained panel was hidden, even when deferred delivery runs after reveal. Preserve legitimate visible zero-height rows and cover both at the virtualizer boundary.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
Codex Review SummaryThis 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 changesPreserve cached transcript row heights when a deferred zero-size observation arrives after a hidden panel reopens. Example: A row previously measured at 160 px receives a deferred 0-by-0 observation after its viewport reopens at 300 px tall.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a concrete scroll-position defect still present on current main, using the existing measurement owner; no introduced code defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherControl UI transcript geometry translates browser row measurements into virtualizer sizes that determine rendered row offsets and scroll compensation. flowchart LR
A[Panels toggle] --> B[Retained conversation]
B --> C[ResizeObserver receipt]
C --> D[Transcript measurement owner]
D --> E[Virtualizer size cache]
E --> F[Conversation scroll position]
Technical reviewBest possible solution: Keep this focused repair in the existing transcript measurement owner, preserving cached hidden-row geometry and legitimate visible zero-height measurements. Do we have a high-confidence way to reproduce the issue? Source inspection confirms that current main accepts the stale zero-size receipt after reveal; the PR also reports a matching browser failure, but this read-only review ran no target code. Is this the best way to solve the issue? The patch is the smallest complete fix for the shown failure: use the observation's own width at the existing measurement boundary and retain the established cache fallback. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c15da4666d56. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +1, Tests +12, Other +2. Total +15 across 3 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 1, 2026, 5:55 AM ET / 10:55 UTC. |
|
Merged via squash auto-merge.
|
…nclaw#190252) Ignore zero-width ResizeObserver row receipts captured while a retained panel was hidden, even when deferred delivery runs after reveal. Preserve legitimate visible zero-height rows and cover both at the virtualizer boundary.
What Problem This Solves
Fixes the Dashboard side conversation jumping upward after hiding and reopening Panels.
User Impact
The reader keeps their scroll position while switching panels. No settings, layout, or workflow changes are required.
Why This Change Was Made
The virtualizer defers ResizeObserver delivery to an animation frame. A zero-size row observation captured while the conversation is hidden can therefore arrive after it reopens. Checking the viewport's current height mistakenly accepts that obsolete measurement and erases cached row geometry.
Recognize the observation's zero-width box and retain the cached measurement. Visible zero-height rows with nonzero width still resize normally. The existing row-observer regression covers both cases; its 12 added lines have a dedicated allocation. Production changes by one net line, with no new state or timing mechanism.
Evidence
ui/src/e2e/session-dashboard-active-panel.e2e.test.ts→Control UI dashboard side-panel selection > uses Panels for the main Dashboard conversation without replacing its contentreported expected 1444, received 402.