Skip to content

mobile: preserve dashboard scroll on back; allow iOS edge-swipe#596

Open
sshane wants to merge 1 commit into
masterfrom
mobile-scroll-and-edge-swipe
Open

mobile: preserve dashboard scroll on back; allow iOS edge-swipe#596
sshane wants to merge 1 commit into
masterfrom
mobile-scroll-and-edge-swipe

Conversation

@sshane
Copy link
Copy Markdown
Contributor

@sshane sshane commented Apr 30, 2026

Summary

Two related mobile UX fixes.

1. Dashboard scroll restoration. Closing a route view via X (or browser/OS back) jumped the dashboard to the top, losing the user's place in the list. Dashboard now persists `window.scrollY` to `sessionStorage` keyed by `dongleId` and restores on remount via `requestAnimationFrame` so children have a chance to lay out first.

2. iOS edge-swipe-back. `PullDownReload` registers `touchstart` with `{ passive: false }` at the document level. That swallowed iOS' system back-swipe gesture (which begins at the screen edge), so the gesture didn't work in the PWA. Skip touches that start within 30px of either screen edge so the OS gesture is preserved while pull-to-reload still works in the middle of the screen.

Test plan

  • iOS PWA: scroll down on dashboard, click a route, click X → dashboard returns to scrolled position
  • iOS PWA: same flow but using the browser/OS back button
  • iOS PWA: edge-swipe from left edge to go back works again
  • Pull down from middle of screen still triggers reload
  • Desktop / non-iOS: behavior unchanged
  • `pnpm lint` clean
  • `pnpm test` passes (30/30)

🤖 Generated with Claude Code

Two related mobile UX fixes:

- Dashboard now persists window.scrollY to sessionStorage (keyed by
  dongleId) and restores on remount. Closing a route via the X button
  or via OS/browser back returns the user to where they were in the
  list, instead of jumping to the top.

- PullDownReload's document-level passive:false touchstart was
  swallowing the iOS system edge-swipe-back gesture. Skip touches
  that start within 30px of either screen edge so the OS gesture is
  preserved while pull-to-reload still works in the middle.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

Welcome to connect! Make sure to:

  • read the contributing guidelines
  • mark your PR as a draft until it's ready to review
  • post the preview on Discord; feedback from users will speedup the PR review

deployed preview: https://596.connect-d5y.pages.dev

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