Skip to content

fix(drawer): scrolled tables and code keep their swipes; back opens the session list - #14

Merged
R44VC0RP merged 2 commits into
mainfrom
drawer-hscroll
Nov 9, 2026
Merged

R44VC0RP merged 2 commits into
mainfrom
drawer-hscroll

Conversation

@R44VC0RP

@R44VC0RP R44VC0RP commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Two gesture bugs from users on v0.3.0 (replies to the soft-launch post on X).

  • FB-03 (three reports): a left-to-right swipe on a horizontally scrolled table, code block or image strip opened the drawer instead of scrolling back. The drawer's pan already had iOS's rule (a scroller that can still scroll back keeps the drag; DirectionalPanGestureRecognizer.swift:116-130), but it only sees scrollers registered with Modifier.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.
  • FB-07: system back in a session left the app. Back now opens the session list (predictive back pulls it partly open); back again leaves the app. A list opened by the button, a drag or Catch Up still closes on back, and menus, sheets, the keyboard, the media viewer and subagent pages still take back first. Android only: iOS has no system back.

Verified on an emulator with before/after recordings (tables, code, image strip, Catch Up, 3-button and gesture navigation); one case added to SessionDrawerSettleTests; full scripts/check.sh passes.

…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.
@R44VC0RP
R44VC0RP merged commit 35515ed into main Nov 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant