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

Terminal: tell the crew from a repository screen in src/tui, as the web palette's Tell the crew does #1911

Merged opened this

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

Merged

The terminal's `:` palette now has a *Tell the crew* row on a repository screen. It shows only to someone who `mayDirectCrew` there, the same gate `tellRow` uses on the web. `bun test test/tui-tell.test.ts` passes and `tsc --noEmit` is clean.

shipped production is serving it deploy d79f016

opened this

The terminal's : palette now has a Tell the crew row on a repository screen. It shows only to someone who mayDirectCrew there, the same gate tellRow uses on the web. bun test test/tui-tell.test.ts passes and tsc --noEmit is clean.

I didn't run the whole test/tui directory clean: two tests in test/tui-code.test.ts fail. They are "repo rows wear issue and pull counts…" and "an event on the bus refreshes the dashboard…". They fail the same way with my changes stashed, so they are not caused by this change.

  • What it does: the row is titled owner/name — Tell the crew. It opens a one-line prompt, then calls the same tell() with from null. The answer comes back as a toast in the web flash's words: … is on it — …, the "Nobody is on the crew to take it yet — add someone under Settings → Crew." line, DIRECTION_NOTE on a refusal, or "Verify your email first.". An empty line says "Say something first." and tells nothing.
  • Where it lives: the row and the answer text are in src/tui/screens/tell.ts. Screen gets an optional commands() that the palette merges after the app's own commands when it opens, and the workspace screen supplies the row there. Nothing else changes in the palette.
  • README: "The terminal's palette has no such row yet" is replaced by a line saying the terminal has the row too.
  • Tests: test/tui-tell.test.ts has four tests:

- the owner sees the row; - a reader who may not direct the crew sees no row; - a told line opens the issue and shows the "Nobody is on the crew" answer; - an empty line tells nothing.

I also listed the file in scripts/gate.ts as "not yet admitted", as the other TUI tests are.

  • Left out:

- from stays null; a terminal screen has no web path that maps cleanly. - The row appears on repository screens only, not on other TUI screens such as issues or pulls. - There are no variants or multi-line tells.

To try it, open a repository you can write to in the terminal, press :, pick Tell the crew, type a line and press enter.

Closes #1788

Changes requested — before the latest push

The row is gated correctly with mayDirectCrew and the tests cover it. One thing to fix first: tellAnswer in src/tui/screens/tell.ts rewrites the sentence that src/actions/tell.ts already exports as toldWords(), "the sentence both doors say". The copy has drifted. When told.assigned is false, toldWords says "Told as #N, but X could not take it." The copy says "X is on it" anyway, which is false. It also drops the issue number. Use toldWords(told.value) for the success case and UNVERIFIED_WORDS for the unverified case, keep only the tone mapping here, and add a test where the assignment fails. Smaller points: the README line is much longer than its neighbours, so wrap it. The gate.ts exclusion with reason "not yet admitted" adds to the backlog. Admit the test if it can run in the gate.

commented

The terminal's tell row now says exactly what the web door says, and it keeps only the tone mapping of its own.

  • Wording: In src/tui/screens/tell.ts, tellAnswer calls toldWords(told.value) for a tell that went through and uses UNVERIFIED_WORDS for an unverified address. The copy that had drifted is gone. When the assignment fails, it now says "Told as #N, but X could not take it." instead of "X is on it", and the issue number is back. That case is shown in the danger tone.
  • Tests: test/tui-tell.test.ts has two new tests. One has the assignment fail and checks the words match toldWords, include the number, don't say "is on it", and carry the danger tone. The other checks the unverified words. Both only call tellAnswer on hand-built values; I haven't driven a real failed assignment through the terminal.
  • Gate: I removed the "not yet admitted" exclusion for test/tui-tell.test.ts and added it to the gated list in scripts/gate.ts. The type check and bun test test/tui-tell.test.ts pass (6 tests). I did not run the gate script itself. The forge's check will be the first to run the file under the gate.
  • README: I wrapped the long terminal-palette line in README.md to match the lines around it.

I did not change src/actions/tell.ts.

Approved

Approved. The terminal row calls the same tell() as the web, is gated by mayDirectCrew (guests and readers get no row, and tell() re-checks forbidden and unverified), and shows the web words through toldWords and UNVERIFIED_WORDS. Tests cover row present, row absent, a real send that opens an issue, the empty line, the failed assignment and the unverified address. The test is in the gate, the README is updated, and no dependency was added. Next: (1) the fallback "That could not be told." hides why (empty, title too long, body too long); map those errors to the same words the web flash gives. (2) Drive one real failed assignment through the terminal rather than a hand-built Told, and add the row to the other repository-level screens (issues, pulls) so it is reachable wherever the repo is open.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs