Repository navigation
Give bottom sheets half and full stops with content drag - #996
Merged
Merged
Conversation
The sheet now behaves like iOS's medium and large detents (Hex Code's Medium sheet). One value, the visible height, drives it: a scrollable sheet opens at half height and drags to full height (the window less the top inset and gap), back to half, or closed. Below its lowest stop it slides down instead of shrinking. - Release rules: a flick up expands, a flick down drops from full to half and from half closes; otherwise the nearer stop, and below 60 % of half height it closes. - The body hands drags to the sheet through nested scroll: pushed up, the sheet grows to full before the body scrolls; pulled down at the body's top, it shrinks and can close. - Compact FitContent and FitAllContent sheets keep one stop at their content height and only drag down. Their height comes from the same value, so content that grows or turns scrollable animates instead of jumping. - Keep caps a full-height sheet to the room above the keyboard, and Expand fills that room from either stop. - TalkBack gets Expand and Collapse actions on the title. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The custom sheet overlay now behaves like the native medium and large detents, with the same rules as Android: a scrollable sheet opens at half height, drags to full height, back to half, or closed, and below its lowest stop it slides down instead of shrinking. - Release rules shared with Android: flick up expands, flick down drops from full to half and from half closes, otherwise the nearer stop; below 60 % of half height it closes. Reduce Motion snaps. - A UIKit pan on the sheet's root hands body drags to the card: pushed up, the card grows to full and the same drag then scrolls the body; pulled down at the body's top, the card shrinks or closes. It runs alongside the rows' own recognizers and cancels a row's press once the card takes the drag, so dragging a list never taps a row. - Compact sheets keep one stop at their content height and only drag down; a compact sheet whose body grows past the compact limit slides to half instead of jumping, and other content changes animate. - Keyboard handling stays as it was: a Keep sheet's stops come from the space above the keyboard, and Expand fills that room from either stop. - VoiceOver gets Expand and Collapse actions on the title. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
Author
There was a problem hiding this comment.
Automated review: no finding that 2+ of 1 passes agreed on.
4 finding(s) from a single pass, not posted
android/app/src/main/java/dev/opencode/mobile/ui/components/chrome/OpenCodeBottomSheetDetents.kt:112medium: Expandable threshold disagrees with iOS, splitting one-stop vs two-stop behavior (muse-spark-1.3-contributor)android/app/src/main/java/dev/opencode/mobile/ui/components/chrome/OpenCodeBottomSheetDetents.kt:230low: Fling handed to body leaves sheet just below full without snapping (muse-spark-1.3-contributor)ios/OpenCode Mobile/OpenCode Mobile/Components/Chrome/OpenCodeBottomSheetBodyDrag.swift:251low: Body pan recognizes simultaneously with any recognizer, not just body/row gestures (muse-spark-1.3-contributor)ios/OpenCode Mobile/OpenCode Mobile/Components/Chrome/OpenCodeBottomSheetBodyDrag.swift:242low: Body pan gates on instantaneous velocity instead of direction of movement (muse-spark-1.3-contributor)
opencode pr-review · passes: muse-spark-1.3-contributor, glm-5.3-flash, deepseek-v4.1-flash · $0.093 · 2 pass(es) failed
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.









Summary
The bottom sheet on both apps now behaves like iOS's native
.presentationDetents([.medium, .large])(Hex Code's Medium sheet): two resting heights, expand and collapse, drag from the content, no jumps. Behaviour only: content, header, buttons, navigation, keyboard handling and styling are unchanged, and the public API is the same, so no call site changed.How it works on both platforms:
NestedScrollConnectionon the body (OpenCodeBottomSheetDetents.kt).OpenCodeBottomSheetBodyDrag.swift). Once the card reaches full, the same drag keeps scrolling the body.Decisions
Halfsheets, andFitContentsheets once their content passes the compact limit (Filter by project, model and agent pickers, shell output, activity, feedback, playground). This is Hex Code's Medium behaviour.FitContentwhile compact, e.g. Session actions, andFitAllContent, e.g. Timeline style). They have one stop at their content height, so they only drag down to close. Giving an action menu that fits a half or full stop would add empty space and change how it looks. AFitAllContentsheet taller than the screen rests at full with one stop, as before.FitContentsheet whose content grows past the compact limit slides from its compact height to half instead of snapping.Checks
testDebugUnitTest3,415 tests, 0 failures (newOpenCodeBottomSheetDetentsTestfor settle rules, stops, nested-scroll handover; keyboard-height tests updated).OpenCodeBottomSheetTestinstrumented on an emulator: 15/15, including 5 new tests (header drag half → full → half, body drag grows before scrolling and collapses at the top, flick down from half closes, Expand/Collapse actions, no action on a compact sheet).ktlintCheckandlintDebugreport only findings that already exist onmain.OpenCodeBottomSheetDetentTests(new, 21),OpenCodeBottomSheetHeightTests(40),OpenCodeBottomSheetFollowTests(7) all pass;xcodebuild buildandanalyzesucceed. A fullOpenCode MobileTestsrun had failures only inMessageSyncTestsandProjectFilesRepositoryTestsunder heavy machine load; both pass when run alone.scripts/check-string-keys.mjspasses (newbottom_sheet.expand/bottom_sheet.collapse).Risks / Follow-ups
🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.