Repository navigation
fix(mobile): Android Back closes in-screen surfaces first - #2343
Merged
Merged
Conversation
Turn on android.predictiveBackGestureEnabled. Back closes the composer's attach tray through Expo Router's usePreventRemove, and the full client steps back through its web history before leaving; the floating exit still leaves at once. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SJ8gcMTgoRjSRBNFswZT9T
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 23 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SJ8gcMTgoRjSRBNFswZT9T
DoodleBears
added a commit
that referenced
this pull request
Oct 19, 2026
Captured on an Android 16 x86_64 emulator with gesture navigation and a debug dev client built from main plus #2342 and #2343. Light and dark at the default font, plus the largest font (2.0) for Usage and the Activity filter. Computer names are redacted. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Captured on an Android 16 x86_64 emulator with gesture navigation and a debug dev client built from main plus #2342 and #2343. Before/after pairs for Back on the attach tray, full client and drawer, and held back swipes. Computer names are redacted. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…annot honour Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SJ8gcMTgoRjSRBNFswZT9T
DoodleBears
added a commit
that referenced
this pull request
Oct 19, 2026
Recaptured on an Android 16 x86_64 emulator with gesture navigation and a fresh debug dev client built from main 55c8848 plus #2342 and #2343. Light and dark at the default font, plus the radio-list fallback at the largest font (2.0). Computer names are redacted. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Recaptured on an Android 16 x86_64 emulator with gesture navigation and a fresh debug dev client built from main 55c8848 plus #2342 and #2343. Back on the attach tray, full client and drawer; the predictive-swipe frames are dropped with the claim. Computer names are redacted. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
DoodleBears
marked this pull request as ready for review
October 19, 2026 23:24
DoodleBears
added a commit
that referenced
this pull request
Oct 20, 2026
Captured on a Xiaomi phone (Android 16, HyperOS 3, arm64, gesture navigation) running a debug dev client of main 55c8848 plus #2342 and #2343, in the zh-CN locale. Light and dark, plus the radio-list fallback at font scale 2.0. Status bar and computer names are redacted. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Captured on a Xiaomi phone (Android 16, HyperOS 3, arm64, gesture navigation) running a debug dev client of main 55c8848 plus #2342 and #2343, in the zh-CN locale. 2c shows Back leaving the full client although the WebView had a history entry. Status bar and computer names are redacted. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SJ8gcMTgoRjSRBNFswZT9T
DoodleBears
added a commit
that referenced
this pull request
Oct 21, 2026
* feat(mobile): use Material 3 selection controls on Android Segmented, PercentageSlider and Chip gain Android variants built on @expo/ui Jetpack Compose (segmented buttons, Slider, FilterChip). The Activity options sheet uses a Compose RadioButton through a new RadioMark primitive, and its unread-only switch moves to the Toggle primitive. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SJ8gcMTgoRjSRBNFswZT9T * chore(mobile): add #2342 change fragment and drop prohibited comments Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SJ8gcMTgoRjSRBNFswZT9T * fix(mobile): rebuild Android segmented row when its options change Compose reads each SegmentedButton's position from its parent once, so a row that grows from two to four options (Usage, once longer periods are supported) kept the two-item shapes: the selected middle segment drew a rounded end. Key the row on its option values. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SJ8gcMTgoRjSRBNFswZT9T * fix(mobile): fall back to a radio list when Android segments cannot fit Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SJ8gcMTgoRjSRBNFswZT9T * docs(mobile): add Android emulator screenshots for #2342 Captured on an Android 16 x86_64 emulator with gesture navigation and a debug dev client built from main plus #2342 and #2343. Light and dark at the default font, plus the largest font (2.0) for Usage and the Activity filter. Computer names are redacted. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * fix(mobile): outline unselected Android segments and chips on a transparent container Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SJ8gcMTgoRjSRBNFswZT9T * docs(mobile): recapture Android emulator screenshots for #2342 Recaptured on an Android 16 x86_64 emulator with gesture navigation and a fresh debug dev client built from main 55c8848 plus #2342 and #2343. Light and dark at the default font, plus the radio-list fallback at the largest font (2.0). Computer names are redacted. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * docs(mobile): add physical-phone screenshots for #2342 Captured on a Xiaomi phone (Android 16, HyperOS 3, arm64, gesture navigation) running a debug dev client of main 55c8848 plus #2342 and #2343, in the zh-CN locale. Light and dark, plus the radio-list fallback at font scale 2.0. Status bar and computer names are redacted. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
DoodleBears
added a commit
that referenced
this pull request
Oct 21, 2026
) * feat(mobile): use Material 3 selection controls on Android Segmented, PercentageSlider and Chip gain Android variants built on @expo/ui Jetpack Compose (segmented buttons, Slider, FilterChip). The Activity options sheet uses a Compose RadioButton through a new RadioMark primitive, and its unread-only switch moves to the Toggle primitive. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SJ8gcMTgoRjSRBNFswZT9T * chore(mobile): add #2342 change fragment and drop prohibited comments Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SJ8gcMTgoRjSRBNFswZT9T * fix(mobile): rebuild Android segmented row when its options change Compose reads each SegmentedButton's position from its parent once, so a row that grows from two to four options (Usage, once longer periods are supported) kept the two-item shapes: the selected middle segment drew a rounded end. Key the row on its option values. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SJ8gcMTgoRjSRBNFswZT9T * feat(mobile): use Material 3 segmented lists for Android grouped rows Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SJ8gcMTgoRjSRBNFswZT9T * chore(mobile): add #2348 change fragment Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SJ8gcMTgoRjSRBNFswZT9T * fix(mobile): fall back to a radio list when Android segments cannot fit Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SJ8gcMTgoRjSRBNFswZT9T * docs(mobile): add Android emulator screenshots for #2342 Captured on an Android 16 x86_64 emulator with gesture navigation and a debug dev client built from main plus #2342 and #2343. Light and dark at the default font, plus the largest font (2.0) for Usage and the Activity filter. Computer names are redacted. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * fix(mobile): outline unselected Android segments and chips on a transparent container Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SJ8gcMTgoRjSRBNFswZT9T * fix(mobile): keep segmentCorners in a pure design module so the root typecheck stays on Node timers Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SJ8gcMTgoRjSRBNFswZT9T * docs(mobile): recapture Android emulator screenshots for #2342 Recaptured on an Android 16 x86_64 emulator with gesture navigation and a fresh debug dev client built from main 55c8848 plus #2342 and #2343. Light and dark at the default font, plus the radio-list fallback at the largest font (2.0). Computer names are redacted. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * docs(mobile): add physical-phone screenshots for #2348 Captured on a Xiaomi phone (Android 16, HyperOS 3, arm64, gesture navigation, zh-CN) running an arm64 debug dev client of main 48f35fb with this branch's JavaScript, in light, dark and font scale 2.0. Settings groups and the Activity filter sheet: gaps between rows, large outer and small inner corners. Status bar and computer names are redacted. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Vain · project thread
Why the change
On Android, Back skipped over surfaces the user was looking at. With the composer's attach tray open, Back left the chat. In the full client, Back exited instead of going to the previous page. The
android-materialskill (#2339) requires Back to close the topmost surface first.Refs: second PR from the Android Material 3 audit in the project thread (the first is #2342).
Special things to note
usePreventRemovehooks are gated onPlatform.OS === 'android', so iOS swipe-back and the iOS WebView's back-forward gestures are unchanged. Review focus: the full client's exit button sets anexitingflag, so the prevented removal is dispatched instead of stepping back in web history. No native input changes.android.predictiveBackGestureEnabled. On the Android 16 emulator (targetSdk 36) it showed no preview anywhere: not on a pushed chat, not on the Settings sheet, and not even the system back-to-home on the Chats root. Logcat showsTYPE_CALLBACKfrom React Native 0.86'sReactActivity, which registers an always-enabledOnBackPressedCallback, so the system has nothing to animate. The flag was removed and DESIGN.md records the gap instead of claiming support. A real preview needs that callback disabled whenever the root route cannot go back, which is native work for a separate change.canGoBack. On a Xiaomi phone (Android System WebView 155.0.8059.43), a hash-only navigation never reported it: withhistory.lengthat 2, Back still left the full client in 3 of 3 tries (phone/2c-back-left-full-client-FAIL.png). The same test passed on the emulator. In normal use the web client adds no history entries itself, so users currently fall back to the old behaviour (Back leaves) and nothing regresses. Making it reliable needs an injected script that reports web history overpostMessage, which is left for a follow-up.pnpm lint, mobiletsc,oxfmtandvitest apps/mobile/test(117 files passed, 7 skipped), includingfull-client-back-android.test.tsx.Change outline
usePreventRemovewhile the attach tray is open, and Back closes the tray.canGoBack. While it has history, Back goes to the previous web page. The floating exit always leaves.DESIGN.mdrecords the Back rule, the predictive back gap, and that new surfaces don't addBackHandlerlisteners.Physical phone (Xiaomi, Android 16; status bar and computer name redacted):
2343-android-back/phone/1b-tray-open.png2343-android-back/phone/1c-back-tray-closed.png2343-android-back/phone/1d-back-chats.png2343-android-back/phone/2c-back-left-full-client-FAIL.pngAndroid 16 emulator:
2343-android-back/1b-tray-open.png2343-android-back/1c-back-tray-closed.png2343-android-back/1d-back-chats.png2343-android-back/2b-full-client-page2.png2343-android-back/2c-back-previous-web-page.png2343-android-back/2d-back-leaves.png2343-android-back/2e-floating-exit-leaves.png2343-android-back/4a-drawer-open.png2343-android-back/4b-back-drawer-closed.pnghttps://claude.ai/code/session_01SJ8gcMTgoRjSRBNFswZT9T
Generated by Claude Code