Repository navigation
firstmate 0.4.0: action buttons and an Answer box on held cards - #96
Merged
Merged
Conversation
The first mate writes the captain's likely answers on a held backlog line as `(actions: Label => prompt | …)`; the card draws each as a button under "Captain's call" that sends its prompt the way a suggestion does, and every held card gets an Answer box that sends `<id> — <title>: <text>`. The parser (`takeActions`), its tests and the charter paragraph match bb's FirstMate (gpambrozio/bb-plugins#35) so both boards read the same lines. Closes #94 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- takeActions reads only an `(actions:` outside every other parenthesis, so one quoted inside a hold or a note is that group's text; a stray `)` outside any group is ignored. Same function and regression tests as bb's fm/board-card-actions at 68ac588. - The Answer box keeps its words, with the input itself disabled, while the send is on its way, and clears once it lands, even after the board swapped for the chat; a failure leaves them to send again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #94
What
A card waiting on the captain (
(hold: …)) can now be answered from the board:(actions: Label => prompt | Label => prompt). The card draws each as a button under "Captain's call"(on any card that has them, held or not, open or folded). A press sends the prompt through the board's
existing sender, the one suggestions use, so the behaviour is the same: one message at a time, buttons
disabled while one is out, a failure toast, and the chat coming into view (the First mate tab on a phone).
<task id> — <task title>: <typed text>. A half-typed answer survives the card changing column and thescreen unmounting. In the workspace/agent panels, where no chat is in view, a toast says it went.
(hold: …)carries(actions: …): prompts that stand alone (full URLs,project names), most likely first, about four at most, rewritten when the next steps change and dropped
when the hold comes off. Nothing else in the charter changed. Untouched homes pick it up on their own;
edited ones get the usual Compare notice.
Syntax, as implemented
Ported from bb's FirstMate (gpambrozio/bb-plugins#35,
fm/board-card-actions).takeActionsand its testcases are the same, and the charter paragraph is byte-identical to bb's:
(actions:(any case) up to its balanced closing), anywhere on the line outside every otherparenthesis. An
(actions:inside(hold: …)or a note is that group's text, and a stray)outside anygroup is ignored. It's taken out of the line
before anything else is read, so a URL or
(project: …)inside a prompt never reaches the title or fields.|separates buttons, with or without spaces around it.=>, both sides trimmed. No arrow, an empty label or an empty promptmeans that button is skipped.
\|,\(,\)and\\are literal. A backslash before any other character is kept (C:\Users).the line still parses. Only the first field gives buttons; later ones are removed too.
Where this differs from the first mate's original spec (the bb branch wins): the spec had
|with spaces asthe separator; bb (and so this PR) treats any unescaped
|as one. The spec didn't say what happens to abackslash before other characters, to later fields, or to an unclosed field's text; those follow bb as listed
above.
Not included (possible follow-ups)
The issue also suggests a "Why is stuck?" button and a column-level "Walk me through these"
button. They aren't part of the chosen design and are left out.
Found while testing, already there before this PR and not fixed here: on a compact web layout, clicking
into a card's Steer or Relaunch box folds the card and hides the box, because react-native-web fires a
Pressable'sonPressfrom the DOM click. The new Answer box sits outside the card'sPressablefor thatreason (recorded in
firstmate/AGENTS.md).Checks
npm run typecheckandnpm testinfirstmate/(274 tests). New tests: the parser (bb's cases plusunspaced pipes), card actions and answer text, kept answer drafts, and the charter rule, with its examples
parsed back through the parser. The pinned charter fingerprint was moved on purpose.
check-plugin-consistency.mjs firstmatepasses.npm pack --dry-runincludesclient/card-answer.ts.wrap inside the card. Clicking into the Answer box doesn't toggle the card, action buttons don't either, and
sends are refused while one is in flight.
68ac588): the Answer box keeps its text with the input disabled whilethe send is out, and clears once it lands. A test covers a send that switches to the chat and back: the box
is open and empty, and only one message was sent. Not checked: iOS/Android, a second theme, or a live daemon
reload (the installed plugin points at another clone). These need a human look before merging, because
merging is the release.
🤖 Generated with Claude Code