feat(website): casts for first-project/modes/undo-redo; quit invisibly via Ctrl-C

Three more casts on "doing" pages:
- first-project reuses the quickstart cast (the create→insert→show tour)
- modes (new): a simple command, then `mode advanced` where the same command
  also prints "Executing SQL: …" (the teaching echo — "learn the SQL underneath")
- undo-redo (new): insert two rows, `undo` (Y-confirm modal) backs one out,
  `redo` restores it

Also fix the cast endings (review feedback): scripts ended by typing a `quit`
command, which — once the trim drops the shell exit — left a dangling "quit" in
frame with no payoff. End every cast with Ctrl-C instead (the app's quit key,
KeyCode::Char('c')+CTRL): it types nothing, so the cast ends cleanly on the
last content frame. Generator gains a `CtrlC` key; all six casts regenerated.

Convert the three pages to .mdx and embed. Build clean (26 pages); 6 casts.
This commit is contained in:
claude@clouddev1
2026-06-10 16:36:07 +00:00
parent ce153bde4c
commit 52860c3267
11 changed files with 2209 additions and 1559 deletions
+49 -7
View File
@@ -9,14 +9,56 @@
* { wait: ms } — pause (shown in the recording)
* { type: 'text', after: ms } — type the text + press Enter, then pause
* { type: 'text', enter: false } — type without pressing Enter
* { key: 'Tab'|'Enter', after: ms } — press a single named key
* { key: 'Tab'|'Enter'|'CtrlC', after } — press a single named key
*
* Every cast must end by quitting the app (a `quit` step) so the driver
* returns to the shell prompt.
* Every cast must end by quitting the app so the driver returns to the shell
* prompt — use `{ key: 'CtrlC' }` (Ctrl-C → quit), NOT a typed `quit`: Ctrl-C
* is invisible, so the trim ends the cast on the last content frame instead of
* a dangling `quit`.
*/
/** The shared library narrative, trimmed per cast. */
export const casts = [
{
name: 'modes',
title: 'Simple mode, then advanced — with the SQL the playground runs for you',
width: 90,
height: 26,
typeSpeed: '45ms',
steps: [
{ wait: 1000 },
{ type: 'create table books with pk', after: 700 },
{ type: 'add column to books: title (text)', after: 800 },
{ type: "insert into books (title) values ('A Wizard of Earthsea')", after: 650 },
{ type: "insert into books (title) values ('Invisible Cities')", after: 1100 },
{ type: 'show data books', after: 1600 }, // simple mode — no SQL echo
{ type: 'mode advanced', after: 1300 },
{ type: 'show data books', after: 2400 }, // advanced — shows "Executing SQL: …"
{ key: 'CtrlC' }, // quit invisibly (Ctrl-C) — cast ends on the last content frame
],
},
{
name: 'undo-redo',
title: 'Undo a change — then redo it — each with a confirmation',
width: 90,
height: 26,
typeSpeed: '45ms',
steps: [
{ wait: 1000 },
{ type: 'create table books with pk', after: 700 },
{ type: 'add column to books: title (text)', after: 800 },
{ type: "insert into books (title) values ('A Wizard of Earthsea')", after: 650 },
{ type: "insert into books (title) values ('Invisible Cities')", after: 1100 },
{ type: 'show data books', after: 1500 }, // two rows
{ type: 'undo', after: 1300 }, // opens the confirmation modal
{ type: 'y', enter: false, after: 1600 }, // Y confirms
{ type: 'show data books', after: 1500 }, // one row
{ type: 'redo', after: 1200 },
{ type: 'y', enter: false, after: 1600 },
{ type: 'show data books', after: 1700 }, // two rows again
{ key: 'CtrlC' }, // quit invisibly (Ctrl-C) — cast ends on the last content frame
],
},
{
name: 'joins',
title: 'Switch to advanced mode and join across tables',
@@ -42,7 +84,7 @@ export const casts = [
type: 'select authors.name, books.title from books join authors on books.author_id = authors.author_id order by authors.name',
after: 2600,
},
{ type: 'quit', after: 400 },
{ key: 'CtrlC' }, // quit invisibly (Ctrl-C) — cast ends on the last content frame
],
},
{
@@ -64,7 +106,7 @@ export const casts = [
},
// the money shot: the two-table connector diagram
{ type: 'show relationship books_author', after: 2600 },
{ type: 'quit', after: 400 },
{ key: 'CtrlC' }, // quit invisibly (Ctrl-C) — cast ends on the last content frame
],
},
{
@@ -86,7 +128,7 @@ export const casts = [
{ key: 'Enter', after: 1700 },
// The corrected command runs cleanly.
{ type: 'show data books', after: 1600 },
{ type: 'quit', after: 400 },
{ key: 'CtrlC' }, // quit invisibly (Ctrl-C) — cast ends on the last content frame
],
},
{
@@ -106,7 +148,7 @@ export const casts = [
after: 1300,
},
{ type: 'show data authors', after: 1800 },
{ type: 'quit', after: 500 },
{ key: 'CtrlC' }, // quit invisibly (Ctrl-C) — cast ends on the last content frame
],
},
];