feat(showcase): WP-39 — linked code snippets + teaching animations
CI / frontend (push) Successful in 2m5s
CI / storybook-a11y (push) Successful in 5m56s
CI / backend (push) Successful in 1m30s
CI / e2e (push) Successful in 2m51s
CI / semgrep (push) Successful in 1m1s
CI / api-client-drift (push) Successful in 2m6s

Anti-drift snippets: `?raw` isn't supported by Angular's esbuild build, so real code
is exposed via // #region showcase:<name> markers in source (registration/remote-data/
postcode/change-request.machine/intake.machine) → scripts/gen-snippets.mjs → committed
snippets.generated.ts, with a CI drift gate so the shown code is the shipped code. The
/concepts page renders the 5 real snippets (union/fold/parse/machine/steps) with a source
caption + a tiny dependency-free highlightTs (+spec); deliberately-wrong illustrations stay
authored. Teaching motion: active state node pops on transition + parse result animates in
(existing reduced-motion-safe toolkit). Generated file prettier-ignored (like api-client).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
eho
2026-07-23 14:49:52 +02:00
co-authored by Claude Opus 4.8
parent f8cd77a48a
commit 19f2e9b734
16 changed files with 258 additions and 34 deletions
+3 -1
View File
@@ -27,6 +27,7 @@ export function fromResource<T>(
return { tag: 'Loading' };
}
// #region showcase:fold
/** Exhaustive fold: you must handle every case, checked at compile time. */
export function foldRemote<E, T, R>(
rd: RemoteData<E, T>,
@@ -42,9 +43,10 @@ export function foldRemote<E, T, R>(
case 'Success':
return h.success(rd.value);
default:
return assertNever(rd);
return assertNever(rd); // add a variant → compile error until handled
}
}
// #endregion showcase:fold
// --- Combinators -----------------------------------------------------------
// Let several independent async sources be treated as one. When you combine