Repository navigation
fix(drawer): scrolled tables and code keep their swipes; back opens the session list - #14
Merged
Merged
Conversation
…A FB-03) A left-to-right drag on a table, code block or the image strip that was scrolled away from its start opened the session drawer instead of scrolling back. The drawer pan already yields like iOS's DirectionalPanGestureRecognizer (a scroller under the finger that can still scroll back owns a rightward drag; the leading 28 dp edge always opens the drawer), but it only knows the scrollers that register through Modifier.drawerPanHorizontalScroller, and none did: the seam (9d31c5a) was added without callers. iOS gets this for free by walking the hit view's UIScrollView ancestors. Register every horizontal scroller on the session card: Markdown code and table bands, the user message's image strip (4+ images) and file chips, agent file cards, inline Mermaid code, and the composer's attachment rows. The same registry feeds Catch Up's card swipe, so a right-to-left drag on a table in a Catch Up card now scrolls it instead of swiping the card away (the mirror case). No change to the pan's decision logic or drawer motion. Verified on the VM emulator (FX_3, API 36, gesture nav) against :4197 with a session holding a 10-column table, a long-line code block and 4 images: before, LTR on a scrolled table/code/strip opened the drawer; after, it scrolls them back and only opens the drawer once they're at their start. A plain transcript drag still opens the drawer, the 28 dp edge opens it over a scrolled table (3-button nav), system back and RTL close it, and in Catch Up RTL/LTR scroll the table, then the card swipes at its start. vm.sh check :feature:transcript :feature:media :feature:composer :feature:session :feature:drawer: BUILD SUCCESSFUL.
System back (gesture or button) on a session with the drawer shut had no handler, so the activity finished and the app closed. iOS has no system back, so this is an Android-native rule: back on the shut card now opens the session list, as the drawer button does. Back on a list that back opened leaves the app (the list is the root); a list opened by the button, a drag or Catch Up still closes on back, as before. The open handler is a PredictiveBackHandler registered at the top of SessionDrawerContainer, before the card composes, so every handler inside the session (the + menu, the session sheet, selection, the media viewer, a pushed subagent's page stack) still takes back first; it stands down for Settings/sheets, Catch Up, the sidebar layout and pushed content. Predictive back pulls the card a quarter open (BACK_PREVIEW_TRAVEL) and the new DrawerMotionState.endBackOpen() commits from there; a button or TalkBack back opens it at once. The existing close handler is unchanged apart from standing down while the drawer is open because of back. Verified on the VM emulator (FX_3, API 36, gesture nav): before, key back and an edge back gesture in a session went to the launcher; after, each opens the list and the next back goes to the launcher; button-opened list: back closes it, back opens it, back leaves. The + menu, keyboard, session sheet, media viewer and the link's Custom Tab each still take back first; back in Catch Up still leaves Catch Up. Added aBackGestureOpensTheShutDrawerFromWhereItLeftTheCard to the existing SessionDrawerSettleTests. Full vm.sh check: BUILD SUCCESSFUL.
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.
Two gesture bugs from users on v0.3.0 (replies to the soft-launch post on X).
DirectionalPanGestureRecognizer.swift:116-130), but it only sees scrollers registered withModifier.drawerPanHorizontalScroller, and none were. Code/table blocks, the user message image strip and file chips, agent file cards, inline Mermaid code and the composer's attachment rows now register. Same fix stops a right-to-left drag on a table in a Catch Up card from swiping the card away.Verified on an emulator with before/after recordings (tables, code, image strip, Catch Up, 3-button and gesture navigation); one case added to
SessionDrawerSettleTests; fullscripts/check.shpasses.