ncode ad847faa2e Phase 2: persisted state and backup parsing
storage.ts owns the blob that survives a restart - boxes, ctx, deck,
dir, input - plus validation for text a person pastes into the backup
box. Pure: parsing and serialising only. Where it is kept, localStorage
mirrored into Capacitor Preferences, stays the shell's problem.

STORAGE_KEY is still sp404mk2-layers-v1, unchanged from Phase 1, so
progress already on the phone is read rather than orphaned. The test
parses a payload copied verbatim out of CapacitorStorage.xml on the
device, so a change that would break migration fails the suite.

Two levels of strictness, matching the reference: reading our own
storage is lenient and falls back per field, while a pasted backup must
be an object carrying a boxes object or it is refused outright.

input defaults to hold rather than sniffing for a coarse pointer as the
reference did - that is a DOM question, so the shell decides it.

The domain layer is now complete: entries, layers, drill, format,
search, storage. 103 tests.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-17 00:57:38 +03:00
2026-09-17 00:54:34 +03:00
2026-09-17 00:54:34 +03:00
2026-09-17 00:54:34 +03:00
Description
An SP-404 MK2 key combos trainer & quick reference
MIT 920 KiB
2026-09-17 18:51:01 +00:00
Languages
TypeScript 41.6%
HTML 40.3%
CSS 7.3%
JavaScript 6.3%
Shell 3.9%
Other 0.6%