web: sim store, URL state scheme, debounced parallel runs (M3 slice 2)

useSimStore is the one reactive module singleton from the spec: panels
over a shared base config, runs debounced 400 ms, one POST /api/scenario
per panel in parallel, results swapped in atomically only when every
request succeeds. Failures keep the last good results; engine 400s are
routed to an inline validationError, everything else to the banner
message. Stale in-flight responses lose to newer runs per panel.

URL state follows spec section 7 (readable params, repeated panel=,
focus index, full fallback to the preset on any malformed part) and is
covered by round-trip and rejection tests. The study copy and initial
panels live in the deepfake-school preset module; formatPct is the
single percent-rounding rule.

The vitest tsconfig now keeps lib at ES2022 like the app config, and
prettier skips the tygo-generated src/types (drift guard stays green).
This commit is contained in:
Justin Visser 2026-06-10 16:36:26 +02:00
parent 2feb6ea5a3
commit 2f21248c20
13 changed files with 1003 additions and 4 deletions

View file

@ -8,8 +8,10 @@
"compilerOptions": {
// Vitest runs in a different environment than the application code.
// Adjust lib and types accordingly.
"lib": [],
// Adjust lib and types accordingly. The language lib stays ES2022 (as in
// the app config) so app code imported by tests type-checks the same;
// only the DOM globals come from jsdom instead.
"lib": ["ES2022"],
"types": ["node", "jsdom"],
// `vue-tsc --build` produces a .tsbuildinfo file for incremental type-checking.