next: a screen tapped open opens on the first tap
MergedThis pull bumps the vendored HUD to 2f1855e and adjusts ios/Grain/Shell.swift to HUDKit's new Route.Screen return type. I read the changes you pointed to: Shell.svelte, taps.ts and the Shell.swift signature.
- First-tap fix:
enteredis set inenterand in the effect that followsnavigation.here.enterandrenamedread it ahead ofnavigation.here, so a shallowgotothat hasn't setpage.stateyet no longer gets the old entry written back over the new one. That matches the cause you describe. - Scroll window: the
taps.tscheck drops a tap only when the scroller moved within 100 ms of touch-down and noscrollendcame after that move and before the touch. That keeps a tap that stops a glide dropped, as intended. - Stale
entered: the effect returns early whennavigation.hereis not an app entry, soenteredwould keep an older value in that case. I haven't confirmed it can matter, and it doesn't block this. - Other bumped files: I didn't read the other vendored files (pager, stack, routes, Swift HUDKit) line by line. They come from HUD's own app/shell changes, and your notes say Grain's next/ doesn't use them yet.
My earlier approval at c53286a stands. The head moved to 923a8fe, and I read what came in since.
The pull's own change still bumps the vendored HUD (COMMIT now 2318f42), which carries the entered fix in Shell.svelte and the taps.ts scroll window I already reviewed.
The iOS changes in Shell.swift and StoryPager.swift are not part of this pull. They come from the base. That covers the story pager and under routes, the story views in next/, and the async Route.screen(resolve:) in the vendored HUDKit. pull_diff shows next/grain.social.json is not among the files this pull changes. Those changes fit the new HUD API.
The one new vendored change is in Pager.svelte: the .peek button gets position: absolute and a --off style. It is small and unrelated to the tap fix, and I saw nothing wrong with it.
On the stale entered: the history only holds an entry that isn't the app's (navigation.here undefined) before the shell makes its first one, at hydration, and entered is undefined until then, so enter and renamed fall back to navigation.here as before. After that, every entry the browser goes back or forward to is one the app made. Leaving it as is.
5 passed, 2 skipped
- next: a screen tapped open opens on the first tap
- main
What changes
A screen opens on the first tap. On next.grain.social, a tapped location, a camera or place on Explore, or someone else's gallery often came back to the screen it was tapped on, and a second tap was needed to open it. Now the first tap opens it, at a phone's size and at a desktop's.
A tap right after a scroll opens. A tap on a list item within 300 ms of the list's last scroll event did nothing, even when the scroll had already stopped. A touch is now dropped only while the scroller is still moving: it moved within the last 100 ms and the browser hasn't said it came to rest (
scrollend). A tap that stops a glide still opens nothing.A rail's tab takes one tap on a touch screen. The rail's tooltips show on hover only where a pointer can hover. On an iPad, or a phone on its side, iOS treated a first tap that showed a tooltip as a hover.
The change is
vendor/hudat HUD's 2318f42 (branch app/taps-2: two commits on app/shell's d36a4eb, which feature/hud already vendors). Against feature/hud, onlyweb/shell/src/Shell.svelte,web/shell/src/Nav.svelteandweb/renderer/src/view/taps.tschange, plusCOMMIT.Why
On a phone, the web shell reads ahead the links it shows, and on a desktop it reads ahead the link a pointer rests on. So the answer for a tapped screen is often already there. If that answer taught the shell a new handle (
names.learn), the shell ranrenamed()to rewrite the URL.renamed()read SvelteKit'spage.state, but a shallowgotopushes the history entry, awaits, and only then setspage.state. Sorenamed()saw the screen the tap came from and replaced the new entry with it. The URL and the screen went back. On the second tap the handle was already known, so the screen opened. A trace on the live site showspushState /location/…followed within 1 ms byreplaceState /with Home's state, and no request. The shell now keeps the entry it made or came to (entered), andenterandrenamedread that.The 300 ms window went because it outlasted the scroll. A glide moves every frame, so 100 ms with no movement, or the browser's
scrollend, means it has stopped. I counted only ascrollendthat comes before the touch, because a touch that stops a glide brings ascrollendof its own after it lands.How it was checked
/after a story restored the story pager, and the tap closed it.hereonly once the move settles, as SvelteKit does. A new case opens a link read ahead whose answer teaches a handle, on the first click, at the handle's URL. It fails without the fix, as did "Home chosen again".npm run ssr,npm run check,npm run unit,just lintpass.node next/check-apps.mjspasses at 2318f42.npm run checkandnpm run buildin next/ passed, and so did the Grain iOS simulator build, at the first vendor (2f1855e, the same changes on an earlier app/shell). The first-tap run on that build was 30/30.hud_core::operator::loadat 2318f42 loads both next.grain.social's live apps and this branch's next/.Shortcomings
Review
Start with
vendor/hud/web/shell/src/Shell.svelte(entered), thenvendor/hud/web/renderer/src/view/taps.ts.