feat(website): add payoff captions to joins/relationship-diagram/sql-echo

Use the ADR-0047 Ctrl+]-delimited demo caption to narrate the payoff
moment of three casts with a neutral one-liner (no key names): the join
result, the relationship diagram, and the m:n junction expansion. Add a
`caption` step kind to the cast generator. Captions show at the climax
during playback and clear as the cast quits.
This commit is contained in:
claude@clouddev1
2026-06-11 13:54:42 +00:00
parent 946dd88db6
commit 13c9c1bcd9
5 changed files with 1592 additions and 1406 deletions
+5
View File
@@ -10,6 +10,8 @@
* { type: 'text', after: ms } — type the text + press Enter, then pause
* { type: 'text', enter: false } — type without pressing Enter
* { key: 'Tab'|'Enter'|'CtrlC'|'CtrlO'|'Esc', after } — press a single named key
* { caption: 'text', after: ms } — pop a demo caption (ADR-0047) bottom-right,
* then hold it (it clears on the next key)
*
* 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
@@ -72,6 +74,7 @@ export const casts = [
// split type + Enter so the command reads before the long echo lands.
{ type: 'create m:n relationship from books to tags', enter: false, after: 1700 },
{ key: 'Enter', after: 3200 },
{ caption: 'One command builds an entire junction table.', after: 3200 },
{ key: 'CtrlC' }, // quit invisibly (Ctrl-C) — cast ends on the last content frame
],
},
@@ -180,6 +183,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,
},
{ caption: 'Each book paired with its author, joined across the two tables.', after: 3200 },
{ key: 'CtrlC' }, // quit invisibly (Ctrl-C) — cast ends on the last content frame
],
},
@@ -202,6 +206,7 @@ export const casts = [
},
// the money shot: the two-table connector diagram
{ type: 'show relationship books_author', after: 2600 },
{ caption: 'Many books, each pointing at one author.', after: 3200 },
{ key: 'CtrlC' }, // quit invisibly (Ctrl-C) — cast ends on the last content frame
],
},
+13
View File
@@ -74,6 +74,19 @@ function keysFor(steps) {
if (step.after != null) keys.push(`${step.after}ms`);
continue;
}
if (step.caption != null) {
// Demo step caption (ADR-0047 D3): `Ctrl+]` opens a stealth capture
// buffer, the characters accumulate invisibly (they don't touch the
// input line), and a second `Ctrl+]` commits them to the floating
// caption box. The caption persists until the next keystroke, so the
// trailing wait holds it on screen before the cast ends. Keep caption
// text plain ASCII — it is typed character-by-character like any input.
keys.push(JSON.stringify('^]')); // open capture
for (const ch of step.caption) keys.push(charKey(ch));
keys.push(JSON.stringify('^]')); // commit the caption
if (step.after != null) keys.push(`${step.after}ms`);
continue;
}
throw new Error(`unrecognised step: ${JSON.stringify(step)}`);
}
return keys;