Repository navigation
fix(android): keep your reading position as replies grow - #140759
Conversation
Keep manual reading paused until the user returns to the latest content. Bind reveal requests to the current reader and row lifetimes, and reveal the terminal code line in the outer reader after inner scrolling. Make repeated expansion requests idempotent while preserving composer, run, model, usage, and persistence owners.
Retain the selected list item's reading origin when reverse layout measures its growing content. Reuse the navigation job owner for cancellation; height changes in other visible rows must not move that anchor. Add rendered stream-growth, live-following, and neighboring-row regressions.
|
🦞👀 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. Reviewed September 7, 2026, 11:31 PM ET / September 8, 2026, 03:31 UTC. ClawSweeper reviewWhat this changesAndroid chat preserves the reader’s visible text or image as replies grow and the window resizes, and reveals code endpoints and expanded user messages within the conversation viewport. Merge readiness✅ Ready for maintainer review This remains a useful fix absent from current main. The previous deferred-prefix blocker is resolved, and no actionable introduced defect remains in the reviewed patch. Priority: P2 Review scores
Verification
How this fits togetherAndroid’s chat renderer receives conversation history and streamed replies from the Gateway. Its reader controller coordinates scrolling, message expansion, and code navigation to determine which content stays visible. flowchart TD
A[History and streamed replies] --> B[Android chat renderer]
B --> C[Rendered text and image anchors]
D[Gestures and navigation controls] --> E[Reader scroll controller]
C --> E
F[Window size changes] --> E
E --> G[Preserved reading position]
E --> H[Follow latest output]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +1330, Docs +1, Other +513. Total +1844 across 18 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Use the shared rendered-anchor and navigation owner for in-session reading, while keeping persistent cold-start bookmarks separate. Do we have a high-confidence way to reproduce the issue? Yes: the recorded installed baseline demonstrates paused reading displacement during streaming, and current main retains that reader implementation. This review inspected source and evidence without rerunning the app. Is this the best way to solve the issue? Yes: retaining rendered content fixes the earlier whole-row approximation at its owner, while one navigation lifetime coordinates cancellation and explicit reveals. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against be88af63529a. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
Extend the short-parent End regression through an ordinary scroll to the visible Start control and verify the first glyph after one click.
Integrate the Reader navigation owner with main and retain actual rendered text/image anchors as replies grow or the viewport changes. Explicit reading cancels automatic following, keeps Jump available when content is hidden, and returns to live following after an idle resize makes all history fit. Preserve row/session cancellation and pin cleanup, actual scroll-boundary clamps, and wheel/accessibility input through the shared pre-scroll owner. Document the behavior and extend real Compose regression coverage. Verified: 455 tests across 34 suites, Play/ThirdParty Kotlin compilation, ktlint and both Android lint targets. Fresh three-pass review is clean. Installed final-head proof and current-main integration remain before landing.
Integrate current main's compact and tabletop layouts while keeping the renderer-owned reading anchor and session-owned navigation flow. Keep the preferred position separate from temporary scroll clamps, and reconsider it when either viewport dimension or retained content changes. Retain the width and height round-trip regressions and await the actual question fixture database before starting its UI interaction assertions. 485 Android tests, both Kotlin variants, ktlint, both Android lints, local changed checks, and the complete three-pass independent review passed. Installed after-APK proof and exact-head hosted CI remain required.
|
Merged via squash.
|
…0759) * fix(android): keep reader navigation owned by the active view Keep manual reading paused until the user returns to the latest content. Bind reveal requests to the current reader and row lifetimes, and reveal the terminal code line in the outer reader after inner scrolling. Make repeated expansion requests idempotent while preserving composer, run, model, usage, and persistence owners. * fix(android): keep paused replies anchored while streaming Retain the selected list item's reading origin when reverse layout measures its growing content. Reuse the navigation job owner for cancellation; height changes in other visible rows must not move that anchor. Add rendered stream-growth, live-following, and neighboring-row regressions. * test(android): cover returning to the start of a code block Extend the short-parent End regression through an ordinary scroll to the visible Start control and verify the first glyph after one click.
Related: #134939. Persistent reading bookmarks in #137674 remain separate work.
What Problem This Solves
Fixes an issue where Android users reading an earlier part of a reply would lose their place as more text arrived or the window changed size. Expanding long messages and using Start/End could also leave the requested part clipped behind the conversation viewport.
Why This Change Was Made
A session-owned navigation job now coordinates following, gestures, disclosure, and code navigation. The reader retains an actual rendered glyph or content point, rather than guessing from whole-row height changes. Its preferred position survives temporary scroll limits and width/height changes; explicit navigation, replacement, and disposal release the old anchor and its pinned rows.
This replaces the earlier whole-row correction flagged in review. Appended text, content appearing above the reading point, neighboring-row growth, and reflow now use the same owner. Current main's compact Details, tabletop, IME, and model-picker layout work is preserved. No configuration, dependency, database, protocol, authentication, or persisted-bookmark behavior changes.
User Impact
Readers keep the paragraph they chose as replies grow and can deliberately return to the latest text. View all and code Start/End reveal the requested content within the actual conversation viewport. Resizing an idle conversation so everything fits resumes following.
Evidence
The integrated candidate passed 485 tests across 35 suites, both Play and ThirdParty Kotlin compilation, Android ktlint, and both lint variants. The repository changed-file checks also passed locally, including app/Wear formatting and the native-state schema guard. One existing saveable-state autoboxing hint is retained to avoid an unproven restoration-compatibility change; there are no lint errors or warnings.
Rendered regressions cover deferred-prefix and streaming-tail growth, unrelated rows, navigation cancellation, touch/wheel/accessibility scroll, replacement/disposal, compact/tabletop layouts, and resize restoration. The new width-only case first failed at 582 → 1114 → 1114 px, then passed at 582 → 1114 → 582 px with unchanged glyph height and genuine scroll room after restoration. The height-round-trip case similarly returns to its original position. An existing question-interaction fixture now waits for its actual database initialization before beginning UI assertions; no deadline or behavior assertion was weakened.
Installed comparison: the baseline is main
823ff3ed9ad61e03aecd0bec0421a5463d80eccf, built and installed on the task-owned API 36 emulator. A synthetic local TLS Gateway supplies the same long-code and streamed-reply scenario without a real provider or user data. The baseline hides the opening after View all, clips R699 after End, and moves from S001 to S021 on the second streaming update without intervening input. The after APK is exact1281264fda33b0d0b98192d45fd7bd568df2b04e, with verified embedded commit and the same signing certificate. It reveals the opening, fully shows R699 after End and R000 after Start, and restores the collapsed preview with Close. After one real Send and one swipe to pause, S001 remains at the same paragraph origin (42, 740) through the second update to S048, with no intervening UI input. A separate Jump capture shows S048 before the final update is released; the final reply then appears. These are real installed-app/synthetic-Gateway checks, not live-provider proof. The fixture and emulator stopped normally and display settings were restored.A configured remote changed-check attempt stopped with SSH transport exit 255 before checks started; its lease and temporary checkout were cleaned. The successful changed checks above are local, not a claim that this remote attempt passed. The complete three-pass independent review is clean, with no P0–P2 findings. Exact-head hosted CI is green. The current hosted review also has no actionable findings; it confirms the prior blocker is resolved. Native landing follows these checks.
Production is +681/−168 (net +513), tests +1367/−37 (net +1330), and docs net +1. Most growth establishes the single rendered-coordinate/navigation lifetime and meaningful regression coverage; two nearby non-saveable scalar states also use the existing primitive Compose factories. The old callback/counter and whole-row approximation paths are removed.
Installed before/after
Both sides use the same isolated API 36 emulator, synthetic content, and original display density/font scale. The code-control case uses the same compact viewport.
Installed checks cover these settled controls and streaming geometry. Rendered tests separately cover deferred content, resizing, and cancellation interleavings. Persistent bookmark restoration and wheel interruption of an already-active manual reveal remain separate follow-ups, not claimed by this proof.