Skip to content

Remember mobile navigation state and swipe to dismiss panels - #2861

Merged
backnotprop merged 20 commits into
backnotprop:mainfrom
artsafin:feat/mobile-edge-swipe
Nov 28, 2026
Merged

backnotprop merged 20 commits into
backnotprop:mainfrom
artsafin:feat/mobile-edge-swipe

Conversation

@artsafin

@artsafin artsafin commented Nov 7, 2026 •

Copy link
Copy Markdown

Goal

Make it easier to return to the same place on a phone in plan review, annotation and code review. Reopening navigation restores where it was left, and an open panel can be swiped shut.

Behavior

  • Scroll memory. Plan and annotate navigation restore their scroll position per tab. In code review, the Commits list, the Changes tree and the All files tree restore theirs when navigation reopens.
  • Folder memory. All files keeps the folders that were opened and closed, per review snapshot. If the active file changed while navigation was closed, its folders still open.
  • Swipe to close. An outward swipe that starts inside an open panel closes it: the navigation panel or sheet to the left, Options, Annotations / Comments, Ask AI and the review sidebar to the right. A short fast flick also counts; a slow drag has to travel a third of the panel. The left panel follows the finger. Panels slide in and out over 180 ms, and do not move under reduced motion.
  • Edges stay with the browser. Gestures that start on the document never open a panel, so Safari's Back and Forward swipes keep working. Panels still open from their buttons.

Since main moved

Main swapped the review file lists for @pierre/trees, removed the Sections panel, and turned phone review navigation into a full sheet that opens on load and has no close button. This branch now:

  • puts the slide and swipe-to-close on that sheet (it keeps main's focus and opens-on-load behavior);
  • remembers the trees' scroll and All files' folders through useTreeMemory (packages/review-editor/components/treeMemory.ts), because the trees scroll themselves;
  • drops the Sections panel scroll memory, the old All files folder state, and its own change to the lazy listing refresh (main's refresh is kept).

Testing

  • DOM: the three app shells (closing by swipe and flick, edges left to the browser, reduced motion, plan scroll restore), useEdgeSwipe, usePanelPresence, usePanelScrollLock, OverlayScrollArea scroll memory, and All files restoring its folders and scroll after a remount.
  • Playwright: compact-navigation-scroll.spec.ts covers plan navigation touch scrolling and restore in Chromium.
  • Not verified on a real phone or in Safari.

@artsafin

Copy link
Copy Markdown
Author

Hi @backnotprop, I've addressed both CI failures: the browser test now uses a temporary HOME, and the DOM tests wait for the panels to finish closing. The targeted DOM and Chromium tests pass locally. Could you approve the workflow run when you have a chance?

@backnotprop

Copy link
Copy Markdown
Owner

Thanks for this, and for keeping it up to date.

We looked at how reviews get used on a phone, and we'd like to take part of this PR.

Keep

  • Remembering the scroll position and which folders are open.
  • Closing an open panel by swiping it shut, where the swipe starts inside the panel.

Drop

  • Opening the panels by swiping in from the left or right edge of the screen. In mobile Safari those edges are the browser's own Back and Forward gestures, and for many people the left-edge swipe is the main way back. A page can't reliably take them over, so the panel swipe and Back would fight each other.

Could you split the PR along those lines? The scroll and folder memory can go in by itself right away. For swipe-to-close, a quick flick should count as well as distance, so a short fast swipe closes the panel.

Happy to help with either part.

@artsafin

Copy link
Copy Markdown
Author

@backnotprop Thanks for looking into this, and for being open to taking part of the PR. Happy to split it so the concerns can move forward separately.

The swipe gestures were what prompted me to build this in the first place. I use Plannotator on my phone, and I keep having to scroll back to the top to navigate the document, open another file, see my annotations, or send feedback. Being able to reach those actions with a swipe feels natural on mobile.

I understand the concern about Safari’s Back and Forward gestures. In my own use with mobile Safari, I haven’t run into that conflict so far. Plannotator opens from the agent as a fresh instance, with no browser history, and opening other files within it doesn’t add history entries either. The Back button stays inactive in that flow. That may not cover every way people use it, but it’s the context behind the approach.

My plan is to:

  • Narrow this PR to scroll and folder memory, plus swipe-to-close gestures that start inside an open panel, including the quick-flick behavior you suggested.
  • Move edge-swipe opening into a separate PR, where we can continue discussing the Safari interaction and possible solutions.

For context, I also have two other mobile UX changes ready on my side that I’ll submit next:

  • Native text selection for annotations, with the annotation toolbar fixed at the bottom. The current yellow selection competes with the browser’s native selection and makes it difficult to select individual words precisely.
  • Moving key actions toward the bottom of the navigation and Options panels, closer to the thumb, including Contents / Files and Send feedback.

These all come from using Plannotator on my phone and trying to make the common actions easier to reach. Thanks again for working through this with me.

@artsafin artsafin changed the title Add edge swipe navigation to mobile reviews and annotations Remember mobile navigation state and swipe to dismiss panels Nov 14, 2026
@artsafin artsafin changed the title Remember mobile navigation state and swipe to dismiss panels Remember mobile navigation state and swipe to dismiss panels Nov 14, 2026
artsafin and others added 4 commits November 14, 2026 13:14
Main replaced the review file lists with @pierre/trees, removed the
Sections panel and turned phone review navigation into a sheet without a
close button. Swipe-to-close and the slide now apply to that sheet; the
Changes and All files trees keep their scroll offset, and All files its
open folders, through a small tree memory instead of the old list's
scroll area. Main's lazy listing refresh is kept as is.
…newly picked file, swipe checks in Chromium and WebKit
@backnotprop backnotprop added the ci:e2e Run the full browser suite (Inbox window e2e) on this PR label Nov 28, 2026
@backnotprop
backnotprop merged commit c938e2a into backnotprop:main Nov 28, 2026
53 checks passed
backnotprop added a commit to bendrucker/plannotator that referenced this pull request Nov 28, 2026
…panel swipes and the HTML viewer's lost highlights

ui 0.67.0 and core 0.25.35 went to npm on 2026-11-28 with package files
that match the v0.29.6 tag (c21f65e), so this pair carries what merged
after v0.29.6, up to v0.29.7.

core 0.25.36 is additive: the linked mark "decisions" and
InboxDecision.machine (backnotprop#4066), DraftFileUploader.previewUrl (backnotprop#4165), and
holdingsOf no longer counting a question Mark read closed (backnotprop#4160). No
exports subpath changes; nothing removed.

ui 0.68.0 is a minor: Escape while an input method composes only ends the
composition, and shortcuts skip such keys; holdsImeEscape is new (backnotprop#3689,
backnotprop#4162). HtmlViewer treats a collapsed live Range as lost (backnotprop#4152). Compact
panels: OverlayScrollArea scrollMemory, SidebarContainer closing and
scrollPositions, ActionMenu compactEdgeSwipe, four new hooks and the panel
rules in theme.css (backnotprop#2861). useLaunchAnnouncement waits for ready (backnotprop#4067).
ui uses nothing new from core; its exact pin follows so a host gets one
core. Publish core first.

README and HANDOFF name the new pair, and HANDOFF adds what the published
0.25.35 / 0.67.0 already held beyond their notes (backnotprop#4114, backnotprop#4151).

bun.lock is bun install's own output: the two package version lines, and
six app workspace version lines (0.29.5 to 0.29.7) the release bumps left
behind.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:e2e Run the full browser suite (Inbox window e2e) on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants