From 8063d921d85904072f360dd988d96c1a82df7187 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 13 Jul 2026 16:37:29 +0000 Subject: [PATCH 1/5] docs: propose interactive tutorial tab running flashtrace in-browser Proposal for a third top-level tab ('Learn'): a large editable IDE mock (Markdown spec left, code right, terminal bottom) whose terminal executes the real, release-pinned dist/flashtrace.mjs in a module Worker against the editor buffers as in-memory tmp files. Guided chapters teach one feature each, with 'Help me' / 'Do the next step for me' assists that highlight and type inside the IDE, and completion tracked in an explicit id-keyed localStorage map so newly inserted chapters are never auto-checked. Feasibility of the in-browser runner was verified with a proof of concept against the v0.7.1 bundle; the shim approach and evidence are documented in the proposal's appendix. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01L1msH7C8goUNt6fBB5VWQs --- proposals/tutorial-tab.md | 389 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 389 insertions(+) create mode 100644 proposals/tutorial-tab.md diff --git a/proposals/tutorial-tab.md b/proposals/tutorial-tab.md new file mode 100644 index 0000000..7749c3c --- /dev/null +++ b/proposals/tutorial-tab.md @@ -0,0 +1,389 @@ +# Proposal: an interactive tutorial tab ("Learn") + +Status: **proposal** — nothing here is implemented yet. +Author: prepared with Claude Code, July 2026. + +## Summary + +Add a third top-level tab next to *Home* and *Docs* — working title **Learn**, served +at `/learn/` — that teaches flashtrace hands-on. The tab is dominated by a large, +*editable* IDE mock in the spirit of the hero mock on the landing page: a Markdown +spec editor on the left, an exemplary source file on the right, and a terminal at +the bottom. The terminal is not a capture: it **executes the real, released +`dist/flashtrace.mjs`** in the browser against the two editor buffers, treated as +temporary in-memory files. + +Content is organized into short chapters, each teaching one feature (or a small +set of connected features) of flashtrace. Two assist buttons — **"Help me"** and +**"Do the next step for me"** — explain respectively perform the next step *inside* +the IDE, via anchored popups and (for the second button) a typewriter edit. +Progress is tracked in an explicit per-chapter map in `localStorage`, keyed by +stable chapter ids so that newly inserted chapters are never auto-checked. + +A proof of concept for the critical piece — running the unmodified bundle against +an in-memory filesystem — was built and works; see [Appendix A](#appendix-a-proof-of-concept). + +## Goals + +- Teach the core feature set (items, needs, code tags, revisions, coverage, + forwarding, tags/filtering) through doing, not reading. +- Run the *real* CLI, at the *same version* the docs on the site are built from, + so output, exit codes and edge cases are authentic and stay authentic across + releases without manual re-capturing. +- Keep the site's constraints intact: static hosting, zero runtime dependencies, + minimal dev dependencies, graceful degradation. + +## Non-goals (v1) + +- A free-form multi-file playground (the two-pane layout is fixed per chapter; + a "Playground" could later reuse the same runner). +- Persisting editor buffers across visits (only chapter *completion* persists; a + buffer-restore feature can come later). +- Syntax highlighting while typing (progressive enhancement, see milestone M4). +- Server-side anything. + +## The tab and its layout + +`/learn/` becomes a third entry in the top bar (`topBar()` in `src/layout.mjs` +gains one link; `active: 'learn'`). Proposed name **Learn** — short, honest about +the guided nature, and leaves "Playground" free for a future sandbox. Alternatives: +*Tutorial*, *Try it* (see open questions). + +The page is a two-column layout, mirroring the docs shell's proportions but with +the IDE where the article would be: + +``` +┌──────────────────────────────────────────────────────────────────────┐ +│ topbar: flashtrace v0.7.1 Home Docs Learn ⌂ ☾ │ +├────────────┬─────────────────────────────────────────────────────────┤ +│ CHAPTERS │ ┌─ ide (large, fills the column) ─────────────────────┐│ +│ │ │ ● ● ● ch. 2: cover a requirement [Reset files] ││ +│ ✓ 1 Your │ ├──────────────────────────┬──────────────────────────┤│ +│ first │ │ spec.md │ login.ts ││ +│ item │ │ ┌──────────────────────┐ │ ┌──────────────────────┐ ││ +│ ▶ 2 Cover │ │ │## Login │ │ │export function login│ ││ +│ a req. │ │ │ │ │ │ ... │ ││ +│ 3 Read │ │ │`req:login#1` ┌─────┴─┴─┴────────┐ │ ││ +│ the │ │ │ │ Add a Needs: line │ ← popup │ ││ +│ report │ │ │ │ demanding impl:… │ inside │ ││ +│ 4 Rev- │ │ │ └─────┬─┬─┬────────┘ the IDE │ ││ +│ isions │ │ └──────────────────────┘ │ └──────────────────────┘ ││ +│ 5 … │ ├──────────────────────────┴──────────────────────────┤│ +│ │ │ terminal [▶ Run] ││ +│ progress │ │ $ npx flashtrace ││ +│ stored │ │ ✔ req:login#1 … [deep-covered] ││ +│ locally │ │ ok ││ +│ │ └─────────────────────────────────────────────────────┘│ +│ │ Goal: make the trace pass ─ 2 of 3 steps done │ +│ │ [ Help me ] [ Do the next step for me ] │ +└────────────┴─────────────────────────────────────────────────────────┘ +``` + +Key points: + +- **Chapter rail** (left): reuses the docs sidebar component and its mobile + drawer behavior; each entry shows a completion check from the progress map. +- **IDE mock**: visually derived from the hero's `.ide-mock` (chrome bar with + dots, pane tabs, terminal bar) but sized to fill the main column — roughly + the space `.doc-main` + `.toc` occupy on docs pages, with a min-height that + keeps editors and terminal comfortably usable. The hero mock stays untouched; + shared styles get extracted into common classes where that falls out naturally. +- **Editors**: two `