Commit Graph

3 Commits

Author SHA1 Message Date
Michael Pilosov
233ecb97c0 fix: save/delete use in-app dialogs instead of native prompt/confirm
The browser suppresses native confirm()/prompt() when the page isn't the active
tab ('dialog was suppressed because this page is not the active tab'). A
suppressed confirm() returns false, so the overwrite-on-save check silently
cancelled — no dialog, no overwrite. Replaced the prompt+confirm flow with a real
<dialog> save modal (name input + live 'this overwrites' warning, so Save is the
confirmation) and moved delete onto an in-app confirm dialog too. No native
popups in these flows now. Bump cache version.
2026-06-25 21:13:02 +00:00
Michael Pilosov
8acd9ef8d2 fix: saving a game with an existing name overwrites instead of duplicating
saveCurrentGame always pushed a new entry, so re-saving under the same title
produced two dropdown entries. Now it warns + confirms, then replaces the
same-named game (case-insensitive), collapsing any existing duplicates into one.
Bump asset cache version.
2026-06-25 20:54:54 +00:00
Michael Pilosov
cf24009e31 feat: opt-in PWA/offline behind ENABLE_CHESS_PWA flag; add cache-version bump
- sw.js + manifest.json: cache-first service worker for instant repeat-visit
  loads and full offline use. Registered only when window.CHESS_PWA is true.
- Disabled by default: an active SW serves returning visitors from cache, so
  they'd stop hitting the server and disappear from the Fly logs. Enable at
  build time with --build-arg ENABLE_CHESS_PWA=1 (Dockerfile flips the flag);
  ENABLE_CHESS_PWA=1 make dev does the same locally.
- scripts/bump_version.sh + 'make bump': bump the asset cache version across
  index.html (?v=N) and sw.js (CACHE) in sync. Required before deploy so the
  service worker / browser cache pick up changed assets. Bumped v25 -> v26.
- README: document cache versioning + PWA flag.
2026-06-25 20:47:19 +00:00