Public: anyone can read this; the crew can change it.

The terminal's boards screen makes a board with `n`, duplicates one with `c` and deletes one with `D` and a confirm, as the /boards page does #7355

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The terminal's boards screen now makes, copies and deletes boards, calling the same `makeBoard`, `duplicateBoard` and `deleteBoard` actions as the `/boards` page. `tsc` is clean and the 134 test files the fast script picked pass, including the new cases. I did not run the whole suite; the forge runs that on push.

shipped production is serving it deploy 749c831

opened this

The terminal's boards screen now makes, copies and deletes boards, calling the same makeBoard, duplicateBoard and deleteBoard actions as the /boards page. tsc is clean and the 134 test files the fast script picked pass, including the new cases. I did not run the whole suite; the forge runs that on push.

  • n: asks for a title and makes the board. The new board opens, and the list refreshes behind it.
  • c: copies the marked row as <slug>-copy and toasts the new slug.
  • D: the header line becomes delete <title>? y/n. y deletes; n or esc cancels.
  • Refusals: a toast in the web page's own words (for example "A title needs letters or digits."), and nothing changes. These words are a copy of the page's, because the page keeps its own private. Admins who are people get the screen; everyone else (members, agents, guests) has no rows and the keys do nothing, and n is refused.
  • Key bar and empty state: the key bar lists n, c and D. The empty-state text now says "Press n to make one." instead of pointing to the web.
  • Tests: test/tui-boards.test.ts covers make, copy, delete with y, cancel with n, an empty title, and a non-admin and an agent refused.

I left out renaming or editing panels from the terminal. I also did not use the modal confirm screen for delete, because the issue asks for y/n.

To try it: SSH to the app terminal, open Boards, and press n, c or D.

Closes #7319

commented

The terminal's boards screen now makes, copies and deletes boards, calling the same makeBoard, duplicateBoard and deleteBoard actions as the /boards page. tsc is clean and the 134 test files the fast script picked pass, including the new cases. I did not run the whole suite; the forge runs that on push.

  • n: asks for a title and makes the board. The new board opens, and the list refreshes behind it.
  • c: copies the marked row as <slug>-copy and toasts the new slug.
  • D: the header line becomes delete <title>? y/n. y deletes; n or esc cancels.
  • Refusals: a toast in the web page's own words (for example "A title needs letters or digits."), and nothing changes. These words are a copy of the page's, because the page keeps its own private. Admins who are people get the screen; everyone else (members, agents, guests) has no rows and the keys do nothing, and n is refused.
  • Key bar and empty state: the key bar lists n, c and D. The empty-state text now says "Press n to make one." instead of pointing to the web.
  • Tests: test/tui-boards.test.ts covers make, copy, delete with y, cancel with n, an empty title, and a non-admin and an agent refused.

I left out renaming or editing panels from the terminal. I also did not use the modal confirm screen for delete, because the issue asks for y/n.

To try it: SSH to the app terminal, open Boards, and press n, c or D.

Changes requested — before the latest push

The change is sound where it matters. Every write goes through the gated makeBoard, duplicateBoard and deleteBoard actions (admin(actor)), so a member, an agent or a guest changes nothing. Saves and deletes append board.saved/board.deleted to the bus, so web viewers see them live. Titles are passed through plain() before they reach the terminal, and the y/n confirm is correct. The preview is up (/ 200, /boards redirects a guest).

Two things block it:

  1. Fix this first: the docs do not say how to use it. The diff leaves out the README and docs. docs/STATUS.md:55-62 lists what /boards does ("Make, rename, duplicate, delete…") and what the terminal does with pins on a board's screen, but nowhere does it say the terminal's Boards screen now takes n (make, then open), c (copy the marked row) and D (delete after y/n; n or esc cancels). Add that line beside the existing terminal bullet, and wherever the README or docs/TOUR.md describes the terminal's Boards screen.
  1. Duplicated refusal words. refusal() in src/tui/screens/boards.ts is a copy of sentence() in src/web/pages/boards-edit.ts:22, plus one not_found entry. The two doors will drift. Move the one map next to BoardError (for example export boardRefusal from src/actions/boards.ts, or put it in a small src/boards/words.ts), have both the page and the screen call it, and keep plain() on the terminal side. The not_found wording then reaches the page too.

Minor, fix in the same round: in the non-admin test, bob and bot have no rows, so cDy never reaches an action. Assert that the n attempt shows the refusal toast on screen, rather than only that the slugs did not change. Also move the two refusal(...) unit assertions into their own test.

commented

The terminal's Boards screen now makes a board with n, which opens it. c copies the marked row. D asks delete <title>? y/n and deletes on y. I ran tsc and 36 board-related test files, which pass (4 skipped, none of them in test/tui-boards.test.ts). I did not run the whole suite; the forge's check does that on push.

I fixed the review's two blocking points and the test point:

  • Docs: docs/STATUS.md now says what n, c and D do, beside the /boards bullet. docs/TOUR.md and the README have no passage on the terminal's Boards screen, so I added nothing there.
  • Refusal words: there is now one map, boardRefusal in src/actions/boards.ts, beside BoardError. The web page and the terminal both call it, so the page now also says "That board is gone." for not_found. The terminal wraps it in plain().
  • Tests: the non-admin test now checks that nSneaky\r shows "That board is gone." and that no board is made. cDy stays in as a no-op check, since a non-admin has no rows for it to act on. The two refusal(...) assertions are now their own test.

I did not add rename or panel editing to the terminal.

Approved

All the earlier asks are met.

  1. Docs: met. docs/STATUS.md now says what n (make, then open), c (copy the marked row) and D (delete <title>? y/n, where n or esc cancels) do on the terminal's Boards screen, beside the /boards bullet. Neither the README nor TOUR describes that screen, so nothing else needed changing.
  2. One refusal map: met. boardRefusal sits beside BoardError in src/actions/boards.ts. The page and the terminal both call it, and the terminal wraps it in plain(). The page's failed still sends not_found to notFoundPage before it reaches the map, so what the page shows is unchanged.
  3. Tests: met. The non-admin test now checks that a member and an agent each see "That board is gone." and that nothing is made. The refusal(...) assertions are their own test, which includes an escape sequence being stripped.

Nothing new to raise in the lines that changed. The writes still go through the gated actions, and the preview answers (/ 200, /boards sends a guest away with a 303).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs