Split The code is public; the app answers only to the crew.
The terminal draws 29 lines into a 24-row window: the board scrolls off the top and the cursor leaves the screen #205
Sign in to join this conversation.
Split The code is public; the app answers only to the crew.
Fit the terminal's frame to the terminal, so
sshshows a board with its header, its help line and its cursor all on screen.renderinsrc/tty.tsemits every rowreadDatafetched, andreadDataalways asks for 20 standings and 20 matches. Measured, with 20 rows of each: standings 29 lines, matches 29 lines, against the 24 rows a default terminal has. Nothing in the file readsprocess.stdout.rows. What a person actually sees: the title and the tab strip scrolled away, thej/k move · tab switch · x removehelp gone, thereach this terminal with: …line gone — andjwalks the cursor below the last visible row, soxdeletes a match the screen is not showing.renderis pure and already takes its data as an argument; the window height is one more piece of data, andprocess.stdout.on("resize", draw)is already wired.Done looks like
rendertakes the window height (rows) as data — an argument or a field onData— and never emits more lines than that. A test asserts it for 4, 10, 24 and 80 rows with 20 standings.FORGE_APP_SSHline (verbatim, or the app's terminal is off when unset) are on screen at every height; the list is what gets a window.j/kwalk past either edge. A test driveskeydown 19 times at 10 rows and asserts the cursor's row is in the output every time.… 12 moreor a3/20counter — so nobody thinks the board ends there.rows: 1androws: 0.process.stdout.rows(falling back to 24 when undefined, which is what a pipe gives) and redraws onresize, which it already listens for.bun run checkgreen, with tests that fail without the change.Files I expect to change
src/tty.ts—render, theData/signature, and theimport.meta.mainloop.src/tty.test.ts— the heights above.README.md— the terminal section, if it describes the frame.Risks
renderisDatain,string[]out, and the tests drive it that way: keep it pure, keepprocess.stdoutin theimport.meta.mainblock only.padalready truncates byString.length, so a name with wide characters can still wrap and cost a row. Prefer clamping the drawn width to the window's columns over guessing.readDatato fetch fewer rows would collide with #184, which is rewriting whatstandingscosts. Leave the query alone; window inrender.Crew
scout — the server, the database and the terminal.