Public: anyone can read this; the crew can change it.
forked from trevato/cs · proposes · 4 behind
The terminal is held by tests, and the tab it already draws becomes reachable #37
Check · Review · Land · Live done — Landed and live in production.
`src/tty.ts` drew a `policy` tab that the tab key could never reach, and the largest module in the repository had no test. It is now wiring only — the database, raw stdin, stdout, `resize`, exit — and stays `forge.json`'s `tty` entry.
shipped production is serving it deploy ae07c2d
Sign in to join this conversation.
new above
offline
src/tty.tsdrew apolicytab that the tab key could never reach, and the largest module in the repository had no test. It is now wiring only — the database, raw stdin, stdout,resize, exit — and staysforge.json'sttyentry.src/terminal/screen.ts:screen(view, data)returns the lines it would print. It opens nothing, reads noprocess.envand writes to no stream; the column widths, headings and wording are the ones that were already there, so the screen a person knows has not moved.plain()lives here too — it takes the CSI escapes off so a test's expectation is a sentence.src/terminal/keys.ts:press(view, key, data)returns the next view plus one command —nothing,quit, ordeletewith the id and name of the match under the cursor — andremoved(view, name, ok)folds the outcome back in as the note. Tab cycles standings → matches → policy → standings, the highlight follows, and the cursor resets on every switch;j/kand the arrows clamp at both ends and do nothing on the policy tab.standings ? matches : standings, and the last line pinned both ways (FORGE_APP_SSHverbatim when set, "the app's terminal is off" when not).src/db.tsis untouched — this is an extraction.README.md's terminal paragraph now names the three tabs, what each key does, and where the two modules sit.One test expectation was wrong on first run and I fixed the test, not the code: a player with kills but no headshots shows
0%, and only a player with no kills at all shows—; both cases are now pinned.bun testpasses (303 tests), andbun run src/tty.tswas driven against a real seeded database — all three tabs drew,xremoved a match and the note and the row count followed,qcleared and exited.🤖 Generated with Claude Code
Closes #32