Files
rdbms-playground/website/casts-src/casts.mjs
T
claude@clouddev1 a8f84c9d17 feat(website): refine casts — trim shell, autoplay+loop landing, cap size
Address cast review feedback:

- Trim every cast to the in-app region (generate.mjs): the recording now
  starts with the app already running and ends on the last in-app frame —
  drops the `$ rdbms-playground` launch and the return-to-shell frame (the
  latter was the stray cursor-under-$ artifact). Opt out per cast with
  `keepShell: true` for demos that document the CLI launch.
- Landing quickstart cast: autoPlay + loop, with a 2.5s hold on the final
  frame so it pauses before restarting.
- Cap the demo at max-width 46rem and centre it, so the player (fit:'width')
  no longer scales its font up to the full splash column.

Casts re-recorded via `pnpm casts`. Build clean (25 pages).

Tab-keypress visibility deferred to an in-app overlay primitive (filed as
issue #22 — also serves the planned guided-lesson system); the cast notes
Tab in its caption for now.
2026-06-10 13:56:39 +00:00

63 lines
2.4 KiB
JavaScript

/**
* Cast source definitions — the durable, human-readable source for the
* asciinema demos (ADR-website-001 §2). `pnpm casts` runs `generate.mjs`,
* which turns each definition into an autocast YAML and records it to
* `public/casts/<name>.cast`. Edit these and re-run to re-record as the app
* evolves; the `.cast` files are regenerable artifacts.
*
* Step kinds:
* { 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
*
* Every cast must end by quitting the app (a `quit` step) so the driver
* returns to the shell prompt.
*/
/** The shared library narrative, trimmed per cast. */
export const casts = [
{
name: 'assistive-editor',
title: 'The input field helps as you type — completion and a live validity indicator',
width: 90,
height: 26,
typeSpeed: '55ms',
steps: [
{ wait: 1100 },
{ type: 'create table books with pk', after: 850 },
{ type: 'add column to books: title (text)', after: 1100 },
// Completion: type a partial table name, press Tab to complete it.
{ type: 'show data bo', enter: false, after: 1100 },
{ key: 'Tab', after: 1400 },
{ key: 'Enter', after: 1600 },
// Validity indicator: a misspelled table flags [ERR] before you submit.
{ type: 'show data boook', enter: false, after: 1900 },
{ key: 'Enter', after: 1700 },
// The corrected command runs cleanly.
{ type: 'show data books', after: 1600 },
{ type: 'quit', after: 400 },
],
},
{
name: 'quickstart',
title: 'RDBMS Playground — first table to first query',
width: 90,
height: 26,
typeSpeed: '45ms',
holdEnd: 2.5, // landing cast loops — pause on the final frame before restart
steps: [
{ wait: 1100 },
{ type: 'create table authors with pk', after: 1000 },
{ type: 'add column to authors: name (text)', after: 850 },
{ type: 'add column to authors: birth_year (int)', after: 900 },
{
type: "insert into authors (name, birth_year) values ('Ursula K. Le Guin', 1929)",
after: 1300,
},
{ type: 'show data authors', after: 1800 },
{ type: 'quit', after: 500 },
],
},
];