Repository navigation
fix(android): restore reopened chats at the live edge - #137682
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: blocked before merge. Reviewed September 5, 2026, 10:00 AM ET / 14:00 UTC. ClawSweeper reviewWhat this changesReopened Android chats start at the newest output, with scrolling tests and screenshot readiness checks updated accordingly. Merge readiness⛔ Blocked before merge - 3 items remain This remains useful: current main still reopens Android chats at the latest user prompt. No blocking correctness findings were found; the recorded landing hold remains in effect. Priority: P2 Review scores
Verification
How this fits togetherAndroid builds a chat timeline from history and live updates. Its scroll controller determines which content is visible and when to offer Jump to latest. flowchart TD
A[Open chat] --> B[History and live updates]
B --> C[Newest-first timeline]
C --> D{Reader position}
D -->|Initial view| E[Newest output visible]
D -->|Manual reading| F[Preserve position and offer Jump]
F -->|Jump to latest| E
Decision needed
Why: The latest supplied handoff expressly requires a new instruction releasing the hold; technical review cannot supply that authorization. Before merge
Agent review detailsSecurityNone. PR surfaceTests +25, Other -12. Total +13 across 6 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep initial live-edge selection in the existing scroll controller while preserving deliberate reading positions and the saved-state format. Do we have a high-confidence way to reproduce the issue? Yes, from source: reopening populated history selects the latest user prompt on current main, and existing tests explicitly assert that position. The supplied native A/B report corroborates the symptom; no runtime reproduction was executed here. Is this the best way to solve the issue? Yes. Initial positioning belongs in the scroll controller; changing timeline anchors or adding another restoration path would unnecessarily affect preserved reading and saved-state behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1582f0ba4513. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
7221877 to
cbeaf9c
Compare
Worked on by: - @IWhatsskill Co-authored-by: IWhatsskill <[email protected]>
Worked on by: - @IWhatsskill Co-authored-by: IWhatsskill <[email protected]>
77a90c9 to
7304918
Compare
Final maintainer handoffCurrent head: Scope and recorded maintainer decisionInitial Android chat positioning now follows Verified evidence
Playable videos are embedded directly under Evidence in the PR body: Before, 75.02 s · After, 80.12 s. Baseline: Current checks and review
CleanupOwned emulator/Gateway/supervisor stopped; ports, AVD, isolated state/credentials and build caches cleaned. Inspected artifacts retained; temporary uploader removed. No additional PR-code changes, new AWS lease, release or production deployment. Artifact identities and reproducible controller command
|
|
Merged via squash.
|
* fix(android): restore reopened chats at the live edge Worked on by: - @IWhatsskill Co-authored-by: IWhatsskill <[email protected]> * test(android): align screenshot readiness with live edge Worked on by: - @IWhatsskill Co-authored-by: IWhatsskill <[email protected]> --------- Co-authored-by: roboclaw-bot <[email protected]> Co-authored-by: IWhatsskill <[email protected]>
Related: #135251
What Problem This Solves
Fixes an issue where Android users reopening a long or active chat would land at the start of the latest user turn instead of the latest output. The reopened reader therefore hid newer content below the viewport and showed Jump to latest even though the user had just entered the chat.
Why This Change Was Made
Android initial chat restoration now explicitly follows
latestContentIndex, matching the iOS reopen policy while leaving existingReadAnchorhandling, manual reading, and live-turn streaming transitions intact. The deterministic Android screenshot fixture now waits for the latest seeded reply, and layout tests explicitly enter manual-reading mode before checking the jump affordance.User Impact
Reopened Android chats now start at the live edge with the newest output visible and no stale Jump to latest pill. Scrolling upward still pauses following and offers the jump control when newer content is actually below the viewport.
Evidence
Native Android Before/After videos
Same emulator, original A/B transcripts and interaction script. Baseline: ce30057; candidate: 7304918. Both complete MP4s were decoded and visually inspected.
Before — baseline (75 seconds)
The final answer is visible around 00:40, then the reader automatically jumps back to the last user question at 00:45/00:49. The first manual scroll is only at 00:51.
before.mp4
After — current PR head (80 seconds)
At the equivalent point after reopening, the reader stays at the final output. Manual browsing and Jump to latest continue to work.
after.mp4
Before
:app:testPlayDebugUnitTest --tests ai.openclaw.app.ui.chat.ChatReaderScrollControllerTestpassed while assertingReadAnchor,scrollIndex = 1, andhasNewerContent = truefor loaded history.1instead of0, a one-message reopen retainedReadAnchor, and a completed reply returned index1instead of0.After — earlier implementation validation
ANDROID_HOME=<API-37 SDK> ./gradlew :app:testPlayDebugUnitTest :app:ktlintCheck— passed, including all 2,731 Play unit and Compose/Robolectric UI tests.ANDROID_HOME=<API-37 SDK> ./gradlew :app:testThirdPartyDebugUnitTest --tests ai.openclaw.app.ui.chat.ChatReaderScrollControllerTest --tests ai.openclaw.app.ui.chat.ChatComposerLayoutTest --tests ai.openclaw.app.ui.chat.ChatReaderScrollOwnershipLayoutTest— passed.pnpm test test/scripts/android-screenshots.test.ts— passed all 12 screenshot-tooling contract tests.node scripts/check-changed.mjs -- <six changed paths>— passed all selected app/test/tooling gates, including test-root typecheck, Android Kotlin lint, and script lint.autoreview --mode local --base origin/main --max-priority P2— scoped clean, no accepted/actionable findings (confidence 0.89).+4/-16; tests and Android screenshot tooling:+49/-24.Rebase and maintainer-review validation — September 4, 2026
77a90c9c143345840eb1f3d0a9aae68a10c1f418, based once30057dbb089eac266d7e5b0b8e8e508ee49779. This includes main's advisory-network recovery fix from fix(ci): recover transient npm advisory request failures #137825; no CI bypass or security-check weakening was added by this PR.ChatReaderScrollControllerTest,ChatComposerLayoutTest,ChatReaderScrollOwnershipLayoutTest, andChatTimelineTestin both Play and Third-Party debug flavors — 64/64 tests passed per flavor on77a90c9c143, zero skips or failures; final combined Gradle run completed successfully in 1m 7s.node scripts/run-vitest.mjs test/scripts/android-screenshots.test.ts test/scripts/pnpm-audit-prod.test.ts— 47/47 tests passed again on77a90c9c143.node scripts/check-changed.mjs -- <six changed paths>— passed on28d275cff95, including all four Android Ktlint modules, root-test typecheck, script lint, and selected guards.autoreview --mode branch --base origin/main --max-priority P2— scoped-clean on28d275cff95, no accepted/actionable findings. The final mechanical rebase adds only an unrelated main logging change; all Android, screenshot-tooling, and corresponding test files are byte-identical across these two candidates.Earlier emulator attempt — superseded by the native videos above
This paragraph records the earlier failed setup attempt, not the final native proof. The two videos above now close that evidence gap.
The host had no real Android device and no preconfigured AVD. A task-isolated API 37 AVD was created and started headlessly with software acceleration because
/dev/kvmwas unavailable. After 12 minutes it still had not reachedBOOT_COMPLETED; APK installation was rejected withdevice is still booting. No screenshot was captured. The repository's deterministic long-chat screenshot fixture and its readiness marker were updated for the live edge, while the green Compose/Robolectric UI coverage and Android CI lanes provide the executable substitute proof.Worked on by
Native Android verification update — September 5, 2026
The real before/after videos are embedded directly in the Evidence section above. Same emulator, script and original transcripts; both raw/MP4 videos fully decoded and inspected.
See the sanitized proof, exact revisions, hashes, limitations and verified cleanup.
Ready for maintainer review. Do not merge on this request. No PR-code changes made.
View the OpenClaw team session