Stop a paged-mode edge tap from clicking the page it reveals - #346
Open
disnet wants to merge 1 commit into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.sveltemaybeTapTurn()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.preventDefault()on thetouchend(the listener is now registered non-passive so it can), which stops the compatibility mouse/click replay at the source.touchstartand 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:.paged-content(and no link context menu).PagedViewconsumer.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.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.Radial artifact