Files
pbakaus_impeccable/server
Paul BakausandClaude Opus 4.6 26e0b8a786 Persist live session state in localStorage, fix HTML hot-reload
Two fixes:

1. Session persistence via localStorage: the previous DOM-attribute
   approach (data-impeccable-handled) didn't survive page reloads
   because the DOM is rebuilt from source. Now using localStorage:
   - Session state (id, action, count, arrived, visible variant)
     saved on every state change
   - Handled sessions (accepted/discarded) tracked separately
   - resumeSession() checks localStorage before resuming, skips
     if the session was already handled
   - Visible variant index preserved across reloads (user sees
     the same variant they were looking at)
   - cleanup() clears session, clearHandled() clears on next
     load when the wrapper is gone from source

2. Dev server HTML hot-reload: replaced static Bun HTML imports
   (import homepage from "../public/index.html") with dynamic
   file() serving via the existing serveGenerated() helper. HTML
   edits are now reflected on browser refresh without restarting
   the dev server. This matches how sub-pages already work.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 18:13:52 -07:00
..