Skip to content

Rebuild the session page stack with standard Compose - #141

Merged
Tarquinen merged 1 commit into
devfrom
page-stack-native
Nov 18, 2026
Merged

Tarquinen merged 1 commit into
devfrom
page-stack-native

Conversation

@Tarquinen

Copy link
Copy Markdown
Member

Subagent and browser pages slide in and out of a session as before, and system back previews leaving them. The stack underneath is now ordinary Compose code.

Now one animated value moves the top page, and PredictiveBackHandler drives back. The old stack was a port of iOS: its own full-width back pan with rules for yielding to horizontal scrollers, a motion controller with frame loops and a hand-solved spring, and a stuck-touch watchdog. SessionPageStack.kt goes from 820 to 357 lines.

  • I kept the saveable-state host rather than switching to NavDisplay. NavDisplay drops covered pages from composition, so going back would reload the web page and lose the transcript's scroll. Covered pages still stay composed, hidden from TalkBack, with their back handlers parked.
  • Push and pop keep the shared axis X on PageTransitions timing, and a cross-fade under Reduce Motion. The back preview keeps its scale, lean and rounded corners, and springs back on cancel.
  • The browser's back still steps through web history first, then closes the page.
  • Removed: the back pan and its scroller rules, SessionPageStackMotion, TouchRecovery.Owner.Browser, yieldsBackSwipe, and the ported test for the pan (noted in docs/parity).

Differences from dev:

  • No full-width swipe-back from mid-page. Back is the system edge gesture or the Back button. A horizontal swipe on a pushed page now goes to the page alone, and the drawer stays shut there, as before.
  • During a back preview, the session beneath slides in from 30 dp to the left instead of sitting still.
  • The cancel spring is the shared release spring instead of the drawer spring.
page-stack-before-after.mp4

Checked on the emulator against dev with session-lab:

  • subagent push and back
  • slow predictive drag, then release, then cancel
  • browser push, web history back and close
  • sideways scroll on the code block, and a mid-page swipe
  • covered page and its scroll kept through backgrounding and rotation
  • animator scale 5, and Reduce Motion

scripts/check.sh passes. The lab has only one subagent level, so I didn't test a second level.

The stack of subagent and browser pages pushed over a session was a
port of iOS's: its own full-width back pan with rules for yielding to
horizontal scrollers, a motion controller with frame loops and a
hand-solved spring, and a stuck-touch watchdog. Now one animated value
moves the top page and system back is the only way back.

- Push and pop keep Material's shared axis X on PageTransitions'
  timing, and a cross-fade under Reduce Motion.
- Predictive back keeps the back preview (scale, lean, rounded
  corners, the session beneath) through PredictiveBackHandler and
  springs back on cancel.
- Covered pages stay composed through the SaveableStateHolder with
  their back handlers parked, so a web page and a subagent transcript
  keep their state.
- The browser's back still steps through web history first.
- No full-width swipe-back from mid-page: a horizontal swipe on a
  pushed page goes to the page alone (the drawer stays shut there, as
  before).

Removed: the back pan and its scroller rules, SessionPageStackMotion,
the page stack's TouchRecovery owner (Owner.Browser), yieldsBackSwipe
and the ported DrawerTouchStateTests case for the pan (noted in
docs/parity). SessionPageStack.kt goes from 820 to 357 lines.

Checked on the emulator against dev with session-lab: subagent push
and back, slow predictive drag then release and then cancel, browser
push, web history back and close, the code block's sideways scroll and
a mid-page swipe, background and rotation keeping the covered page and
its scroll, animator scale 5 and Reduce Motion. scripts/check.sh
passes.
@Tarquinen
Tarquinen merged commit 518c808 into dev Nov 18, 2026
5 of 6 checks passed
@Tarquinen Tarquinen mentioned this pull request Nov 18, 2026

This branch was previously deployed

1 inactive deployment
release — 31b642a4 Deployed Nov 18, 2026 by Tarquinen via check #446
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