Skip to content

Fix examples loading and stale PWA assets - #5

Merged
aliorhun merged 2 commits into
mainfrom
fix/examples-loading
Sep 28, 2026
Merged

aliorhun merged 2 commits into
mainfrom
fix/examples-loading

Conversation

@aliorhun

Copy link
Copy Markdown
Contributor

Summary

Fixes two causes of example-loading problems:

  • add an Examples / Örnekler action in the top bar
  • load the current-language example content into a new notebook without touching existing notebooks or localStorage
  • keep the existing new-file confirmation flow so the example notebook name can still be changed
  • change mutable PWA core assets (app.js, app.css, manifest.webmanifest) to network-first with cache fallback
  • stop cross-cache lookups that can accidentally return an older build
  • keep hashed/static assets cache-first
  • extend offline/PWA verification for both the example loader and anti-stale cache behavior

Why

Example content was previously created only when mathnotebook_v1 did not exist. Users with existing notebook data therefore had no way to reload the built-in examples.

Also, the service worker used cache-first for the fixed-name app.js and app.css. On the first reload after a GitHub Pages deployment, the old active service worker could serve the previous JavaScript bundle even while the new HTML was already online.

The new behavior keeps offline support while preferring the latest core app files whenever the network is available.

@aliorhun
aliorhun merged commit 0d2a682 into main Sep 28, 2026
2 checks passed
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