Skip to content

feat: add edge-swipe dismiss for the mobile preview - #15

Merged
phatpham9 merged 1 commit into
mainfrom
feat/preview-edge-swipe
Nov 12, 2026
Merged

phatpham9 merged 1 commit into
mainfrom
feat/preview-edge-swipe

Conversation

@phatpham9

Copy link
Copy Markdown
Member

Summary

Adds an iOS-style back gesture to the fullscreen article preview on phones.

  • A single touch starting within 24px of the left screen edge and dragging right moves the whole preview panel with the finger, revealing the feed at its preserved scroll position.
  • Releasing past max(96px, 30% of the width) or a 0.5 px/ms right flick slides the panel away and closes it through the existing close path, restoring body scroll, theme-color, chrome, and card highlight. A shorter drag springs back.
  • Direction lock keeps vertical edge drags on native preview scrolling; the gesture is ignored while the … dialog is open, and rotation/layout changes cancel it.
  • A synthetic click left by a drag on an edge control is suppressed.
  • Desktop aside (>900px) and the feed list are unchanged.

Touch handling uses a non-passive touchmove listener rather than touch-action: pan-y on the panel so wide preview tables keep horizontal panning.

Verification

  • node --check web-static/static/app.js
  • npm run typecheck
  • npm test — 82/82 passing
  • Emulated iPhone portrait and landscape: drag follows the finger; long drag closes and restores scrollY; short/slow drag and hold-then-release spring back; quick flick closes; vertical edge drag, off-edge drag, and open … dialog are ignored; close button and desktop aside unaffected; no console errors

Notes

  • Version bumps: style.css?v=128, app.js?v=105, reader-shell-v139
  • Docs updated in README, docs/ARCHITECTURE.md, and docs/RUNBOOK.md
  • In a regular Safari tab, iOS's system edge-back gesture may take precedence when history exists; the app gesture is reliable in the installed PWA

🤖 Generated with Claude Code

- let a left-edge rightward drag move the fullscreen preview over the feed and close it past a distance or flick threshold, with spring-back below it
- keep vertical edge drags on native preview scrolling and ignore the gesture while the actions dialog is open
- clean up the drag transform on rotation, layout changes, close, and reopen

Co-Authored-By: Claude Code <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🔎 Cloudflare preview: https://99fb2c16-feedreader.phatpham9.workers.dev

Uploaded from ac36b50853b3a5375932e4f540d5a4feca20a065. This is a Worker version preview — it shares the production D1 database, so it reads/writes real data; it does not receive cron-triggered refreshes.

@phatpham9
phatpham9 merged commit ab232d4 into main Nov 12, 2026
3 checks passed
@phatpham9
phatpham9 deleted the feat/preview-edge-swipe branch November 12, 2026 07:53
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