Shoot a README clip or still
Every image and clip in the README is shot from a mock scene in headless Chrome, never from a real account, so a re-shoot gives the same picture. You need Chrome, bun and uv on your PATH; run every command below in ui/.
| File | Reel or scenes | Command |
|---|---|---|
.github/hero.gif | reel hero | bun run mock/app/clip.ts ../.github/hero.gif |
.github/readme/canvas.gif | reel canvas | bun run mock/app/clip.ts ../.github/readme/canvas.gif canvas |
.github/readme/backtest.gif | reel backtest | bun run mock/app/clip.ts ../.github/readme/backtest.gif backtest |
.github/readme/trading.png, data.png | readme-trading, readme-data | bun run mock/app/reach.ts <out dir> --scenes 'readme-*' --scale 2, then copy <out dir>/<scene>.png |
.github/readme/phone-*.png | phone-needs, phone-chain-legs, phone-chats | the same, --scenes phone-needs,phone-chain-legs,phone-chats --scale 2 |
.github/social.png | readme-card | the same, --scenes readme-card --scale 1 |
Add a clip
-
Pick or add its scenes in
ui/mock/app/scenes.ts: the tree, the book and the settings the clip starts from. Reuse aclip-*scene where one fits;clip-deskis one live SPY chart. -
Write the reel as a function in
ui/mock/app/clip.tsand add it toREELS. Compose it from the helpers there:load(scene)cuts to a scene;tick(timeframes)moves every pane one price.shot(ms)holds the page as it stands.press(target)glides the pointer to a control and clicks it.drag(from, to, steps, ms)holds and drags: a gallery card, a pane'shead(kind), or the longest gap,sash("row" | "col").over(kind, zone)is a drop point on a pane:tab,left,right,aboveorbelow.framed(nodes)writes kernel nodes, as an agent's change lands.
Target controls by
data-eid, never by pixel. -
Render it to a scratch path:
bun run mock/app/clip.ts <scratch>/reel.gif <reel>. -
Review the frames:
bun run mock/app/clipSheet.ts <scratch>/reel.gif <scratch>/sheet.png 6lays every sixth frame on one sheet. A beat that did nothing, such as a press that missed or a drop that was refused, shows as two frames that match.bun run mock/app/clipSheet.ts <scratch>/reel.gif <scratch>/beatswrites every beat held 300 ms or more at full size, with anindex.htmlthat steps through them by arrow key: open it to judge each one. -
Land it at its path, and link it from the README with alt text that says what happens.
Limits
- The encoder writes 896×560 in 255 colours, a frame taking a palette of its own when the one before would print it off its colours, and draws only the pixels that change: the 13-second canvas clip weighs 2.8 MB and the 34-second hero 4.2 MB. Fewer colours make a smaller file with the wrong colours. GitHub refuses an image over 10 MB.
- The window is dark only, so one image serves both GitHub themes.
- Two runs differ by raster noise of a frame or so, so a clip isn't byte-identical run to run.
If it fails
the encode failed:uvcan't fetch Pillow. Runuv run --with pillow python -c 'import PIL'.- A
pageerrororconsole.error: the scene throws on load. Open it in the mock (pnpm --filter @taji/ui mock:app, thenlocalhost:7793/app/?scene=<id>) and fix the scene or the window first. - A drag moves nothing: the press landed on another control. The middle of a sash can sit where a crossing sash meets it, which is why
sashpresses three quarters along.