fix(reader): harden swipe/long-press coexistence and next-chapter prefetch
- A long-press now cancels any pending swipe, so a hold-then-drag gesture opens the action sheet without also turning the page (regression-tested). - The next-chapter prefetch no longer retries on every page flip when the endpoint fails (guard clears only when the next chapter changes), and it clears a previous chapter's warmed images on navigation so stale hidden <img>s don't linger. - Tap zones set touch-action: pan-y so vertical panning stays native while horizontal swipes reach our handler. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -69,6 +69,10 @@
|
||||
const startY = e.clientY;
|
||||
pressTimer = setTimeout(() => {
|
||||
pressTimer = null;
|
||||
// A long-press consumed the gesture — cancel any swipe so a
|
||||
// subsequent drag-then-lift (finger held, then moved) doesn't
|
||||
// also turn the page on top of opening the action sheet.
|
||||
swipeStart = null;
|
||||
suppressNextClick = true;
|
||||
if (suppressExpiryTimer != null) clearTimeout(suppressExpiryTimer);
|
||||
suppressExpiryTimer = setTimeout(() => {
|
||||
@@ -200,6 +204,9 @@
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
cursor: pointer;
|
||||
/* Let vertical panning through to the page but keep horizontal
|
||||
gestures for our swipe handler rather than browser scroll. */
|
||||
touch-action: pan-y;
|
||||
/* No visible style — these are interaction surfaces, not
|
||||
controls. Focus-visible is honored so keyboard users get
|
||||
a ring if they tab into one. */
|
||||
|
||||
Reference in New Issue
Block a user