Skip to content

Stop a paged-mode edge tap from clicking the page it reveals - #346

Open
disnet wants to merge 1 commit into
mainfrom
radial/impl-13157401d937
Open

Stop a paged-mode edge tap from clicking the page it reveals#346
disnet wants to merge 1 commit into
mainfrom
radial/impl-13157401d937

Conversation

@disnet

@disnet disnet commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Tapping the edge of the fullscreen paged reader turns the page — and then the browser replays the finished touch as a mouse click at the release coordinates, where a different element has just slid under the finger. On iOS that replayed click re-hit-tests and opens the link (or linked image) the turn revealed; in Chromium it re-clicks the page being left. Either way, a page turn shouldn't also be a click.

What changed

frontend/src/lib/components/feed/PagedView.svelte

  • maybeTapTurn() now reports whether the release was actually consumed as a page turn. Neutral-zone taps, long presses, active selections, taps on links/controls/media, and edge taps at the first/last page are all not consumed.
  • Only the consumed branch calls preventDefault() on the touchend (the listener is now registered non-passive so it can), which stops the compatibility mouse/click replay at the source.
  • A narrow fallback for engines that emit the click anyway: a one-shot capture-phase click guard, bounded to the release point (44px), a 700ms window, dropped on the next touchstart and on unmount. No general post-turn input lock — a deliberate follow-up tap still works.

Wheel/trackpad, keyboard, swipe drags and the explicit pager buttons are untouched; their source target doesn't move, so they need no suppression.

Tests

New e2e/paged-reader.spec.ts (touch-enabled, phone viewport, reduced motion) drives the real browser event path:

  1. edge tap turns one page without clicking through — the tap point is chosen so a link occupies it after the turn and plain text occupies it now; asserts exactly one page turn and zero clicks reaching .paged-content (and no link context menu).
  2. tapping a link on the current page still opens the reader's link menu and does not turn the page.
  3. edge tap on the last page stays a native tap: page unchanged, and the click still reaches the article (guards against over-cancelling).
  4. daily magazine edge tap — same invariant through the second PagedView consumer.

Verified tests 1 and 4 fail on the unfixed component and pass with the fix.

Checks

  • frontend: npm run test (257 passed), npm run check (0 errors), npm run build — all pass.
  • Root Playwright suite: 28 passed, 2 failed — both in feed-management.spec.ts, which needs the real Bun feed proxy (unavailable in this sandbox, stubbed). They fail identically on the base commit without these changes.
  • Not run: WebKit / installed iOS Safari, where the delayed compatibility click actually re-hit-tests. Worth a manual pass on a device.

Radial artifact

Tapping the edge of the fullscreen paged reader turns the page, but the
browser then replays the finished touch as a mouse click at the release
coordinates — by which time a different element (a link, a linked image)
has slid under the finger. On iOS that click re-hit-tests and activates
whatever the turn revealed; in Chromium it re-clicks the page being left.
Either way a page turn should not also be a click.

PagedView now owns the gesture end to end: maybeTapTurn reports whether
the release was actually consumed as a turn, and only that branch cancels
the touchend (registering the listener non-passive so it can), which stops
the replay at the source. A one-shot capture-phase click guard — bounded
to the release point, a 700ms window, and dropped on the next touchstart —
covers engines that emit the click anyway. Everything else is untouched:
neutral-zone taps, long presses, selections, taps on visible links and
controls, and edge taps at the first/last page all stay native, so nothing
gains a post-turn input lock.

Covered by e2e/paged-reader.spec.ts on the real touch event path, across
both PagedView consumers (saved reader and the Daily magazine).

Co-Authored-By: claudebot.disnetdev.com (did:plc:n6ku5xddiuguwze3f356evla) <claudebot.disnetdev.com@noreply.radial>
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