next: scrolling, a fling's stop or a swipe opens no gallery, nor a photo's tap
MergedThis pull stops a tap that ends a drag, or that stops a fling, from opening a gallery on next.grain.social. It also makes a tap on a feed card's photo open nothing, as in Grain's own apps. I read all the changed files, which are the vendored HUD copy, the vendor/hud/COMMIT bump and the HUDKit carousel change. I found no bugs, so I'm approving.
taps.ts: The logic holds up. A mouse's clicks and a keyboard's (detail === 0) are left alone. Apointercancelmarks the touch as moved. The walk upparentNodereaches the document, so a page's own scroll is caught.- Removing
tapThrough: This is consistent with the CSS change..contentstayspointer-events: noneexcept for[data-swipes], so a tap on the carousel now hits it rather than the item's link. - HUDKit: The empty
onTapGestureon the carousel is plausible, but the pull says it was not tried on a device. When you next buildios/, check that a swipe still pages the carousel and thatzoomstill opens the lightbox.
The shortcomings the pull lists are accurate: it was not tried on a real phone, and a tap within 300 ms of any scroll is dropped. I'd check both on a phone before this reaches production.
The pull mentions a new renderer test of the tap rules, but this diff has no tests. That fits a vendored copy, since the tests live in HUD.
Thanks. On HUDKit: SwiftUI gives a child's tap gesture precedence over its ancestor's, so with zoom the picture's own onTapGesture still opens the lightbox, and the carousel's empty one only stops a tap reaching the List item's. A tap gesture never blocks the horizontal ScrollView's pan, so swipes still page. HUDKit's tests pass on an iPhone 17 Pro simulator, but neither was tried by hand: I'll leave that, and a real phone for the web side, to a check on a device before this reaches production, as you say. The new renderer test is HUD's (web/renderer/test/ssr.mjs, in fa60f26), not vendored here.
- next: scrolling, a fling's stop or a swipe opens no gallery, nor a photo's tap
- main
What changes
Scrolling opens no gallery. On next.grain.social, a click that ends a touch which moved more than 10 px, or that came down within 300 ms of the screen's scroller moving (a tap that stops a fling), opens nothing in a feed, a list or a profile's grid: not the card, nor its links or buttons. A mouse's clicks are as they were. HUD's renderer does this for every List and Covers (HUD fa60f26,
web/renderer/src/view/taps.ts), so it takes no change to Grain's views.A feed's photo opens nothing when tapped. A tap on a feed card's carousel no longer opens the gallery, as in Grain's own apps: on the web,
GalleryCardopens the gallery from its title link alone and the photo only takes a double tap (favorite); in grain-ios,GalleryCardView's photo tap shows its alt text and nothing on the card pushes the gallery. The rest of the HUD card (header space, title, description, counts) still opens it, and a swipe still pages the carousel. HUDKit's carousel (ios/) takes its taps the same way.Why
A feed card is one big link (the List item's
<a class="open">), and its carousel passed its taps through to that link. Touch-emulated in Chromium (iPhone viewport, CDP touch events and a touch fling, against a release HUD and the built app) before this change:Vertical drags and horizontal carousel swipes ended in
pointercancelwith no click, so those were not a cause on their own.How it was checked
node check-apps.mjs,npm run check, the unit tests andnpm run buildinnext/. The iOS app was not built (HUDKit's own tests were run).Shortcomings
onTapGestureinside a ScrollView, which UIKit's scroll view doesn't hand a touch that scrolls or stops its deceleration. That wasn't tried on a device or simulator. Only the carousel's tap changed there.Review
Start at
vendor/hud/web/renderer/src/view/taps.tsandtree/List.svelte.