Repository navigation
fix(android): keep Wear chat on the latest reply - #120307
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 7, 2026, 1:40 PM ET / 17:40 UTC. ClawSweeper reviewWhat this changesThe PR makes Wear OS chat initially show and follow the newest reply, while preserving deliberate backward scrolling and the existing return-to-latest action. Merge readinessKeep this PR open: current main still leaves Wear ChatPage’s list state inside the shared page, while the branch moves that ownership to ChatPage and reuses the established Voice-thread follow model. No patch-introduced correctness or security finding was identified. Priority: P2 Review scores
Verification
How this fits togetherWear ChatPage turns the active-session message snapshot and streaming text into a small scrollable conversation on a watch. Its follow-state controller decides whether new content moves the viewport or leaves the reader’s position intact. flowchart LR
A[Active session snapshot] --> B[Wear ChatPage]
B --> C[Messages and streaming reply]
C --> D[Follow-state controller]
D --> E[Wear conversation viewport]
E --> F[Newest reply visible]
E --> G[New messages action]
Before merge
Agent review detailsSecurityNone. PR surfaceOther +195. Total +195 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land one ChatPage-owned scroll controller that reuses the existing follow-state contract, with exact-head Android checks confirming the branch remains compatible with the current base. Do we have a high-confidence way to reproduce the issue? Yes, source inspection gives a high-confidence path: current main keeps the chat list state private, preventing content-driven follow behavior; the PR’s exact-head emulator record also reports the newest reply inside the Wear viewport. Is this the best way to solve the issue? Yes. ChatPage owns the content revision and reader intent, so owning its list state there and reusing the Voice follow helpers is cleaner than adding callbacks or separate scroll policy to the shared page. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ab4761f3fc9a. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Co-authored-by: IWhatsskill <[email protected]>
[AI-assisted]
What Problem This Solves
Wear OS chat could open at the top of a conversation while the newest assistant reply was already below the viewport.
Failure mode
Longer conversations made users scroll past the identity and status content before they could read the latest reply.
Why This Change Was Made
The Wear chat now owns its list state, follows a trailing anchor as replies arrive or stream, and pauses that behavior when the user deliberately scrolls backward.
Root Cause
The shared Wear page previously kept its list state private, so ChatPage could not react when message content changed.
User Impact
The latest reply is visible when chat opens and continues to follow while it grows. Users who browse older messages keep their position and get the existing New messages action to return to the tail.
Evidence
Validated at exact head
1e7cbf4527cf82df2558fc16c6a7b5c8d2a24ad9: 18/18 focused tests passed and the newest reply was measured inside the Wear viewport.Inspect exact-head proof ledger
Provenance
b738e2578087a5fb292abf333dbc5c7e92c853d61e7cbf4527cf82df2558fc16c6a7b5c8d2a24ad9Direct behavior
Wear chat runtime command
Redacted exact-head Wear UI output
Automated verification
Focused Wear behavior
./gradlew --no-daemon :wear:testDebugUnitTest --tests ai.openclaw.wear.MainActivityTest --tests ai.openclaw.wear.WearScreenshotModeTest --rerun-tasks --console=plain— [TEST] 18/18 tests passed with 0 failures, 0 errors, and 0 skips. Proves stream growth follows the tail, manual backscroll is retained, explicit return resumes following, and the rendered anchor index is correct. Preserves the existing Voice Thread follow behavior and deterministic chat fixture contract.Wear static analysis
./gradlew --no-daemon :wear:ktlintCheck :wear:lintDebug --console=plain --stacktrace— [STATIC] completed successfully with exit code 0. Proves the affected Wear sources satisfy Kotlin formatting and Android lint checks. Preserves the existing Wear module build conventions.Native localization
corepack [email protected] native:i18n:check && corepack [email protected] android:i18n:check && corepack [email protected] apple:i18n:check— [STATIC] all three checks completed successfully; the required sync reported changed=false. Proves the reused New messages strings introduce no localization drift. Preserves the Android and Apple localization catalogs.Android packaging
corepack [email protected] android:assemble— [BUILD] 109 Gradle tasks completed with BUILD SUCCESSFUL. Proves the phone, Wear, and shared Android modules still assemble together. Preserves the existing phone and Wear packaging boundary.Patch hygiene
git diff --check HEAD^..HEAD— [STATIC] completed with exit code 0 across exactly two changed Wear files. Proves the committed patch is whitespace-clean and bounded. Preserves Gateway, pairing, authentication, Data Layer, session, and model owners outside the Wear UI.Preserved boundaries
Proof gap
None
Artifacts