Skip to content

fix(android): keep your reading position as replies grow - #140759

Merged
steipete merged 5 commits into
mainfrom
codex/android-reader-navigation
Sep 8, 2026
Merged

steipete merged 5 commits into
mainfrom
codex/android-reader-navigation

Conversation

@steipete

@steipete steipete commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

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 exact 1281264fda33b0d0b98192d45fd7bd568df2b04e, 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.

Scenario Baseline Repaired app
View all Opening hidden after View all Opening and R000 revealed
End of code R699 remains clipped R699 fully visible
More text while reading Chosen paragraph lost after update S001 stays in place after update

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.

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.
@steipete steipete self-assigned this Sep 7, 2026
@clawsweeper

clawsweeper Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added app: android App: android size: L maintainer Maintainer-authored PR labels Sep 7, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 7, 2026
@clawsweeper

clawsweeper Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 7, 2026, 11:31 PM ET / September 8, 2026, 03:31 UTC.

ClawSweeper review

What this changes

Android 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
Reviewed head: 1281264fda33b0d0b98192d45fd7bd568df2b04e

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent owner-level repair with meaningful regressions and recorded installed-app proof resolves the prior blocker.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The captured body records the exact-head installed Android app exercising the changed reader and code-navigation paths against a synthetic TLS Gateway, with preserved S001 coordinates and visible code endpoints after repair. Rendered tests supplement resize and cancellation coverage; attachment retrieval was unavailable to this reviewer.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured body records the exact-head installed Android app exercising the changed reader and code-navigation paths against a synthetic TLS Gateway, with preserved S001 coordinates and visible code endpoints after repair. Rendered tests supplement resize and cancellation coverage; attachment retrieval was unavailable to this reviewer.
Evidence reviewed 9 items Pinned introduction boundary: Reviewed the local merge-base-to-head delta from 823ff3e to the exact original head. The supplied test merge is stale and was not used to infer removal of current-main behavior.
Previous blocker repaired at the renderer boundary: Reading now retains a rendered glyph or opaque content point, validates its placement, and corrects its measured displacement instead of applying every row-height increase. Preferred position is retained separately from temporary scroll clamps.
Navigation lifetime and cleanup: Reader and row scopes reject retired callbacks; current navigation replaces previous jobs, and disposal releases retained anchors and pins. These are local UI lifetimes, not changes to authentication or privileged authority.
Findings None None.
Security None None.

How this fits together

Android’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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +1330, Docs +1, Other +513. Total +1844 across 18 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 7 1367 37 +1330
Docs 1 2 1 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 10 671 158 +513
Total 18 2040 196 +1844

Review metrics

Metric Value Why it matters
Production and regression coverage Production net +513 lines; tests net +1330 lines The growth establishes rendered-position and navigation lifetimes, with geometric and cancellation regressions supporting that added complexity.

Technical review

Best 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.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured body records the exact-head installed Android app exercising the changed reader and code-navigation paths against a synthetic TLS Gateway, with preserved S001 coordinates and visible code endpoints after repair. Rendered tests supplement resize and cancellation coverage; attachment retrieval was unavailable to this reviewer.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.
  • remove merge-risk: 🚨 other: Current PR review selected no merge-risk labels.

Label justifications:

  • P2: Repairs Android reading-position and navigation defects with a limited UI blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured body records the exact-head installed Android app exercising the changed reader and code-navigation paths against a synthetic TLS Gateway, with preserved S001 coordinates and visible code endpoints after repair. Rendered tests supplement resize and cancellation coverage; attachment retrieval was unavailable to this reviewer.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured body records the exact-head installed Android app exercising the changed reader and code-navigation paths against a synthetic TLS Gateway, with preserved S001 coordinates and visible code endpoints after repair. Rendered tests supplement resize and cancellation coverage; attachment retrieval was unavailable to this reviewer.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • christopheraaronhogg: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (5 earlier review cycles)
  • reviewed 2026-09-07T04:06:33.567Z sha bce7496 :: blocked before merge. :: none
  • reviewed 2026-09-07T04:38:45.976Z sha a880e95 :: blocked before merge. :: none
  • reviewed 2026-09-07T05:28:38.194Z sha a880e95 :: blocked before merge. :: none
  • reviewed 2026-09-07T05:53:29.723Z sha a880e95 :: blocked before merge. :: [P2] [P2] Anchor visible content instead of compensating every row-height change
  • reviewed 2026-09-07T06:52:44.251Z sha a880e95 :: blocked before merge. :: [P2] [P2] Anchor visible content instead of every row-height change

Extend the short-parent End regression through an ordinary scroll to the
visible Start control and verify the first glyph after one click.
@openclaw-barnacle openclaw-barnacle Bot closed this Sep 7, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Sep 7, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 7, 2026
@openclaw-barnacle openclaw-barnacle Bot closed this Sep 7, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Sep 7, 2026
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.
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: XL and removed size: L labels Sep 8, 2026
@clawsweeper clawsweeper Bot removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 8, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Sep 8, 2026
@steipete
steipete merged commit 9c85213 into main Sep 8, 2026
85 checks passed
@steipete
steipete deleted the codex/android-reader-navigation branch September 8, 2026 03:43
@steipete

steipete commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 8, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: android App: android docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant