Persist home stepper state to localStorage via freeze scope
Some checks failed
Build and Deploy / build-and-deploy (push) Has been cancelled

- freeze-scope "home-stepper" captures step-idx signal
- Each step/back saves to localStorage via freeze-to-sx
- On mount, restores from localStorage via thaw-from-sx
- Invalid state resets to default (step 9)
- Clear preview lake before replay to prevent duplicates
- Register local-storage-get/set/remove as primitives
- Arrows 3x bigger

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-14 23:27:46 +00:00
parent cb4f4b85e5
commit b6b061962c
3 changed files with 26 additions and 6 deletions

View File

@@ -14,7 +14,7 @@
// =========================================================================
var NIL = Object.freeze({ _nil: true, toString: function() { return "nil"; } });
var SX_VERSION = "2026-03-14T22:48:39Z";
var SX_VERSION = "2026-03-14T23:27:46Z";
function isNil(x) { return x === NIL || x === null || x === undefined; }
function isSxTruthy(x) { return x !== false && !isNil(x); }
@@ -7019,6 +7019,9 @@ PRIMITIVES["resource"] = resource;
function localStorageRemove(key) {
try { localStorage.removeItem(key); } catch (e) {}
}
PRIMITIVES["local-storage-get"] = localStorageGet;
PRIMITIVES["local-storage-set"] = localStorageSet;
PRIMITIVES["local-storage-remove"] = localStorageRemove;
// --- Cookies ---