feat(web): opt-in page tutorials — Supa Choi Sensei docks beside the live UI #84
Loading…
Reference in a new issue
No description provided.
Delete branch "web/tutorials"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #81.
What
A
💡︎bulb in the top bar (amber, the one warm accent in the phosphor palette) appears on editor, ops, regex, grammar and machines. Pressing it docks Supa Choi Sensei (the dojo'sScene.svelte, reused) beside the live UI and walks the section: theory first, UI second, worked examples, ending every walk with a your turn exercise.Pieces
web/src/lib/tutorial/content/): 5 sections × 8–12 steps, en + es inline, in the sensei's voice. Regex: Kleene 1956 → reading(a|b)*abbinside-out → [SHOW ME] Thompson conversion → NFA semantics → ε as glue → why NFAs exist → equivalence-checking homework → state elimination. Editor: canvas/handles, Σ, run with trace, ε-closure in the trace, ACCEPT vs REJECT. Ops: subset construction (Rabin–Scott), 2ⁿ warning, Hopcroft/Moore, table-filling/Myhill–Nerode, complement-honesty-on-DFAs, product construction. Grammar: derivations/trees, ambiguity, CNF why+what, CYK chart reading, membership. Machines: the stack as ledger, TM tape/head, multi-tape/nondeterminism buy comfort not power, halting, and aⁿbⁿcⁿ as the final exercise.fill/click/navigate/wait;filldispatchesinputso Svelte binds update; bounded polling for late-mounting targets; failure is non-fatal — sensei turnsstern, explains, tutorial continues. Success →happy+ "now you try it".highlight.[ < ] [ > ],[ X ] CLOSE,[ SHOW ME ]when a demo exists; ArrowLeft/Right + Escape; snappy typewriter that respectsprefers-reduced-motion.common.tutorial,common.tutorialOpen, en+es parity). All step copy and dock labels are inline in the tutorial module to keep merge surface with parallel i18n work near zero.Rot guard
bun testasserts every demo/highlight selector is a well-formeddata-tuthook and greps the actual.sveltesources for it — UI renames now fail tests instead of demos. Plus registry-shape validation (ids unique, en/es present, actions well-typed, sections end with the exercise) and mocked-DOM runner tests.Verify
bun run check0 errors ·bun test63 pass ·bun run build✓[SHOW ME]fills(a|b)*abb→ TO NFA → result panel spotlighted, sensei happy; machines TM demo runs 0011 and spotlights the tape; Escape closes; Arrow keys navigate.🤖 Generated with Claude Code
[ 💡︎ ] (text-presentation glyph) beside the language/music controls, amber (--bulb #fbbf24) — the single warm accent in the phosphor palette. Visible only on pages with a tutorial entry; title and aria-label come from two new i18n keys (en+es parity). Co-Authored-By: GLM (OpenCode) <dev@yhkze.net>