Repository navigation
fix(chat): restore your reading position after an empty search - #205494
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: needs maintainer review before merge. What this changesThis PR restores the reader’s message position or end-following state after clearing or closing a search with no matches. Example: Read Folio 40, search for absent-from-the-transcript, then close search.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR addresses a concrete reading-position bug still present on main, and source review found no definite introduced defect. Reviewed head: Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Control UI filters loaded conversation messages into virtualized rows; its session-owned anchor and scroll machinery preserve the visible message as those rows change. flowchart TD
A[Loaded messages] --> C[Transcript projection]
B[Search input] --> C
C --> D[Message anchor owner]
C --> E[Virtualized rows]
D --> E
E --> F[Reader position]
Technical reviewBest possible solution: Preserve search-return intent in the existing session-owned message anchor and restore it through the existing measured-row lifecycle. Do we have a high-confidence way to reproduce the issue? The no-match shell removes virtualized rows while search closure restores the full projection without a saved search anchor on main; the linked report supplies observed failures, but this read-only review ran no reproduction. Is this the best way to solve the issue? The approach is appropriately scoped: it reuses message identity, measurement, and scroll ownership rather than introducing a competing restoration system. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against bf3729e40c48. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +88, Tests +103. Total +191 across 6 files. Added test files: 1. 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. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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 25, 2026, 1:39 PM ET / 18:39 UTC. |
|
Merged via squash.
|
…law#205494) Co-authored-by: Vincent Koc <[email protected]>
What Problem This Solves
When a transcript search finds no messages, clearing the query or closing search jumps to the beginning of the chat. This also loses the reader’s place if they scrolled through matching results before narrowing the search.
User Impact
Close or clear an empty search to return to the message you last read at the same screen position. If you were following the latest messages, you return to the end. Searching still takes you to the first match, and opening a result still takes you to the selected message.
Why This Change Was Made
The empty search view removes all virtualized messages. The transcript now records which visible message to restore before the rows disappear and issues the first-result scroll only after a result viewport has mounted.
The message-anchor approach builds on the original work by @vyctorbrzezowski in the closed, unmerged PR #152095.
Evidence
Three focused Chromium regressions failed on the parent and passed on this change. The parent lost both marked messages and left the end follower 7,713 px from the bottom. Across 18 mounted cases covering desktop and portrait, the largest measured message displacement was 0.5625 px. The draft, editor, and loaded message array survived, and the end-follow controls finished at a zero-pixel gap.
Hosted validation
All three Chromium regressions passed: Close returned to the earlier reading position, Clear returned to the deliberately read result, and Close from Latest restored the end follower. Both real-Gateway shards built the runtime and Control UI. Chromium results
The background-work test timed out at 120 seconds while observing the child’s in-flight startup response. The same test, stage and timeout occurred on main. Knip’s script and full-tree reports flagged two known Parallels preflight exports. Its production report passed. The aggregate retained these failures. Gateway job · Main comparison · Dependency job
In a mounted Chromium run with the reply-reveal fix, the original message returned at the identical viewport position after a no-match search closed. Latest then returned to the physical end.
Fixes #151970