Skip to content

Review follow-ups: snap-back fix, faster reference orbits, idle PWA reload, cache headers - #92

Merged
rowan-m merged 7 commits into
mainfrom
fix/review-cleanup-and-reference-perf
Sep 25, 2026
Merged

rowan-m merged 7 commits into
mainfrom
fix/review-cleanup-and-reference-perf

Conversation

@rowan-m

@rowan-m rowan-m commented Sep 24, 2026 •

Copy link
Copy Markdown
Owner

Post-feature review clean-up. Each commit can be reverted on its own.

  • fix(state): movement made while a reference orbit is computing is kept instead of snapping back. The requested zoom is recorded, and stale worker responses are ignored by request id.
  • perf(wasm): the reference orbit is truncated at its escape point in Rust, which removes the JS scan for it.
  • refactor: removes duplicate pin toggling and redundant defensive guards.
  • perf(wasm): single-pass reference. compute_reference reuses the winning anchor's orbit from the search instead of iterating it again, and replaces find_best_anchor + calculate_reference. Indicative Node timings are about 20% faster at deep zooms, with identical orbits.
  • feat(pwa): after an update takes control, reloads onto the new version once the page is hidden or the user has been idle for 3s. The URL keeps the view. It also checks for updates on resume.
  • fix(hosting): no-cache for /, /index.html, /sw.js and /manifest.json. The old /index.html rule didn't match /.
  • fix(input): mouse-wheel zoom stays on the pinned centre, like the buttons, keys and text input. Pinch still zooms at the midpoint, and double-click at the cursor.

Checks: format, eslint, clippy, WGSL lint, depcruise, audit, wasm + vitest tests and size budgets all pass. WebGPU rendering was not visually verified here; benchmarking to follow.

Rebase the requested centre onto the new anchor and re-apply any pan,
keyboard or wheel movement made since the request, instead of snapping
back. Record the requested offset/zoom so the debounce re-requests a
reference when the view has moved. Tag worker requests with an id and
drop results from superseded requests.
Return only the computed orbit points instead of a zero-padded
max_iter buffer, and derive the valid reference length from the orbit
size rather than scanning it on the main thread.
Fractious.interact owns centre pin visibility (it also hides it after
the debounce), so drop the duplicate toggle in InteractionManager.
state.pointers is always a Map, offsets are always defined and the
renderer always provides onSubmittedWorkDone, so remove the defensive
checks and optional chaining.
…hor's search orbit

The anchor search already iterates the winning point in arbitrary precision, so
compute_reference records the GPU layout for the likely winners (view centre and
refined hotspot) during the search and extends that orbit instead of iterating
it again. find_best_anchor/calculate_reference are replaced by one export and the
iteration upgrade moves into Rust.
With skipWaiting/clientsClaim the new service worker takes control straight away,
but an open page keeps running the old code until it is relaunched. Reload once
the page is hidden or the user has been idle for a few seconds; the URL holds the
whole view, so it comes back to the same place. Also check for updates whenever
the app is resumed.
The /index.html rule did not match requests for /, so the entry page fell back to
default caching. Apply no-cache to /, /index.html, /sw.js and /manifest.json so
new deployments are picked up promptly; hashed assets stay immutable.
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit 65ad1a8):

https://fractious-deep--pr92-fix-review-cleanup-a-2t6ow30m.web.app

(expires Fri, 02 Oct 2026 08:04:51 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 348393a9746312ebab7a45ce5eba16e6d119af34

Wheel zoom followed the cursor, unlike the zoom buttons, keys and text input.
It now zooms on the viewport centre like they do; pinch zoom keeps its midpoint
anchor.
@rowan-m
rowan-m merged commit 7504f91 into main Sep 25, 2026
2 checks passed
@rowan-m
rowan-m deleted the fix/review-cleanup-and-reference-perf branch September 25, 2026 09:09
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