Phase 0 — docs/release/v0.2-frontend-overhaul.md as single source of
truth for the v0.2 frontend coherence pass. Records hard rules,
tooling pins, sacred-behaviour contract list, wrapper catalogue,
per-page migration order, verification matrix, KI-05 plan, and the
explicit "DO NOT add Skeleton" line.
Phase 1 — tooling baseline. All exact-pinned per the plan:
- @playwright/test@1.60.0 + playwright@1.60.0 + @axe-core/playwright@4.11.3
- rollup-plugin-visualizer@7.0.1 (wired behind ANALYZE=1)
- @vitest/browser@4.1.6 + @vitest/browser-playwright@4.1.6 (provider)
- vitest-browser-svelte@2.1.1 (runes-aware Svelte 5 bridge)
- cargo-nextest installed globally
New configs: playwright.config.ts (frontend-only, dev:frontend webServer,
900x700 + 1440x900 projects, visual baselines deferred), vitest.browser.config.js
(separate from jsdom suite). New scripts: test:e2e, test:e2e:ui,
test:browser, analyze, test:rust:fast, guard:no-skeleton.
guard-no-skeleton.mjs walks package.json + package-lock + src/ for any
@skeletonlabs reference and exits 1 if found — locks in the no-Skeleton
hard rule for any future agent.
Smoke baseline (tests/e2e/smoke.spec.ts): 16 tests passing across two
viewports — app loads without Tauri runtime, keyboard nav, axe scan
(color-contrast deferred to Phase 7 per docs/release/v0.1-contrast-audit.md),
light/dark theme cycle, all three sensory zones (cave/energy/reset).
10 screenshots emitted to test-results/ as non-failing artefacts.
Surfaced + fixed two browser-preview bugs while landing the baseline:
- src/lib/utils/osInfo.ts: FALLBACK_BROWSER_INFO was evaluated at SSR
module-load (navigator undefined → os: 'unknown'), and the UA check
ran before navigator.platform — so Playwright's Windows-UA Chromium
on a Linux runner detected as Windows, useCustomChrome went true,
Titlebar mounted and tripped Tauri-only APIs. Now lazy-built per
call; platform is the primary signal, UA only a fallback.
- src/lib/components/Titlebar.svelte: defensive hasTauriRuntime() guard
on every handler and the $effect. Titlebar should not crash if any
future code path mounts it without Tauri.
.gitignore: reports/, .playwright/, test-results/, playwright-report/.
Per-phase gate green: npm run check (0/0), npm test (0/0), npm run
test:e2e (16/16), npm run guard:no-skeleton (clean).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
First frontend unit test framework on Lumotia. Pinned exact versions for
supply-chain hygiene (matches the rust-toolchain.toml discipline from the
27661c8 hygiene pass and the npm audit signatures pre-flight from e4d56b8):
- vitest 4.1.6 (compatible with vite 6, supports vite 6/7/8)
- jsdom 29.1.1
Installed with `npm install --save-dev --save-exact --ignore-scripts` per
the install discipline documented in the README — the --ignore-scripts
flag blocks the postinstall vector that npm worms (Shai-Hulud,
mini-Shai-Hulud) rely on.
vite.config.js:
- Switched defineConfig import to vitest/config (superset of vite/config;
production builds ignore the `test` key).
- test.environment = "jsdom" so storage-shim tests drive real browser APIs.
- test.include scoped to src/**/*.{test,spec}.{ts,js} — colocated with
source, mirrors the Rust #[cfg(test)] sibling pattern.
- test.exclude blocks src-tauri/ (owned by cargo test).
- restoreMocks + clearMocks + unstubAllGlobals on so module-level state
can't leak between tests.
src/lib/utils/localStorageMigration.test.ts — 12 tests:
migrateLocalStorageKey:
- copies value + removes old when only old exists
- removes old + keeps new when both exist (lumotia is authoritative)
- no-op when only new exists
- no-op when neither exists
- idempotent (second call after first migrates nothing)
- preserves the value's exact bytes (no JSON round-trip)
- preserves empty-string values (distinct from null)
- survives DOMException / quota errors without re-raising
- no-op when localStorage is undefined (SSR-safe)
migrateLocalStorageKeys:
- processes pairs in order
- per-pair failure does not strand remaining pairs (resilience)
- empty pairs list is a clean no-op
package.json:
- "test": "vitest run" (one-shot, CI-friendly)
- "test:watch": "vitest" (dev loop)
README: documents `npm run test` alongside `cargo test --workspace` and
`npm run check` in the Testing section.
Verification:
- npm run test: 12/12 pass
- npm run check: 0 errors, 0 warnings (the new .ts test type-checks clean
against jsconfig.json's strict typescript settings)