Files
airship/scripts
Nayan 45261f147e feat(overlay): declare every command once, and generate the reference from it
Chords were string literals at each `keys.bind` call site, so the only thing
that knew a command existed was the line that bound it. Twenty-seven of the
thirty-three shortcuts appeared nowhere in the product or the docs, five menu
rows showed Mac glyphs to Windows users, and one advertised `⌘Z` for a feature
`⌘Z` has never run. The only reference was six hand-written rows in `README.md`,
and its copy under `apps/cli/` had already drifted.

`keys/catalog.ts` is the declaration: chord, title, sentence, mode, surface, and
where a scoped command applies. A binding supplies only `run`, `when` and
`within`. `CommandId` is a union, so a mistyped id is a compile error rather
than a shortcut that quietly never fires.

Three surfaces read it. `keys/shortcuts-panel.ts` is the `?` sheet, grouped and
marking what is live right now; `keys/palette.ts` is `⌘K`; and `MenuItem.command`
renders a menu row's chord so nothing spells one by hand — `catalog.test.ts`
fails any `hint:` literal that looks like a keystroke.

`scripts/gen-controls.mjs` is the fourth reader. It imports the `.ts` catalog
directly under `--experimental-strip-types`, which is why that module may
contain no value imports, and writes `CONTROLS.md` plus the short table in
`README.md`. `keys/controls-doc.test.ts` byte-compares the committed files
against the same renderers, so drift fails the suite even on a Node that cannot
strip types.

The tooltip chip moves with it. It used to be found by matching the tip's own
*text* against a binding's label — elegant until someone reworded a tip, at
which point the chip vanished with nothing failing. A control now names its
command with `data-key`.
2026-08-16 13:05:37 +05:30
..
2026-08-09 22:58:00 +05:30