feat(acpmux): an idle new chat suggests the open PR, Tab to take it
Summary
Leo asked for the empty prompt of an idle new chat to suggest something drawn from context, with Tab to accept it. It now suggests the open PR that another recent chat in the same checkout made:
- Failing checks: "Fix the failing checks on PR #123"
- Draft: "Finish draft PR #123:
- Otherwise: "Continue PR #123:
A fresh agent can act on any of these with gh pr view in that folder. A muted Tab keycap follows the suggestion.
- Tab writes the suggestion into the prompt but never sends it; Return sends.
- Shift-Tab doesn't take it, and with the field filled Tab moves focus as before.
- Esc puts the suggestion away for this chat.
- Screen readers hear the suggestion and "Press Tab to use the suggestion" through
aria-description. The keycap isaria-hidden.
When nothing applies, the prompt keeps "Do anything". Nothing is suggested in these cases:
- another folder or another worktree, or a different branch when both chats know theirs
- a merged or closed PR
- a chat older than three days, or an archived one
- a PR that some chat is already working on or waiting about (indicator
workingorinput) - a chat with turns, or while working, in shell mode, blocked, or with text or attachments in the field
I made the product call with a subagent check. Its changes were folded in: match the checkout and not only the folder, skip busy PRs, use concrete wording, keep the keycap, and never let Shift-Tab accept. I left out a "continue " suggestion on purpose, because a fresh agent has none of that chat's context. No session summary reports a PR yet, so the suggestion also reads the chat folder's own PR. The App already gets that PR with gh for the header's chip (header/headerState.ts). The suggestion uses it when no other chat reports a PR: open or draft only, worded by its checks, and still held back while another chat works on the same number. That is what makes it show in the app today, with no daemon change.
New file promptSuggestion.ts picks the suggestion. MarkdownField gets a placeholderKey prop for the keycap.
Testing
- New
test/composer-suggested-prompt.test.tsx(bun, jsdom), 6 cases: the open wording and keycap; the failing and draft wording; seven no-suggestion cases (other folder, other worktree, merged, four days old, working, another chat waiting on the same PR, archived); a chat that knows its branch takes no PR from another branch (added after review); a chat with turns; Tab writes without sending, Shift-Tab doesn't take it, Esc puts it away.- Against the parent commit's Composer.tsx: 3 of the 5 fail. With the change: all 6 pass, and so do the 6 in
composer-queued-placeholder.test.tsx.
- Against the parent commit's Composer.tsx: 3 of the 5 fail. With the change: all 6 pass, and so do the 6 in
tsc --noEmit: no new errors. The one remaining error is the existing missinghome-inbox-cloud-cases.jsonfixture.vp fmtis clean, andgen-strings.mjs agentPane --checkpasses.- Added after review: the folder's PR from the header's gh read is suggested when no session reports one (open, failing, draft, merged, and a busy chat). It was red first (cf6761b2) and is green with 320682cd. All 8 cases pass on big-red, and
bun run checkis clean. - Gallery variants:
agent-pane.composernew-chat-suggest-open,new-chat-suggest-failingandnew-chat-suggest-draft. The shots below are WebKit at 2x.
Localization audit
- Five new keys in
webviews/src/agent-session/acpmux/Localizable.xcstrings:composer.suggestFailing,composer.suggestDraft,composer.suggestOpen,composer.suggestionKeyandcomposer.suggestionHint. - Each has all 21 locales. English is
translated; the other locales areneeds_review. - The
{number}and{title}placeholders and the#are kept in every locale. - The keycap reads "Tab" everywhere, and its comment asks translators to use the label printed on the key.
generated/strings.jsonis regenerated.
Changelog
Added: A new chat suggests continuing (or fixing the checks of) an open PR from a recent chat in the same folder; press Tab to use it
Proof
Before (new chat):

After, open PR:

After, failing checks:

After, draft:

Narrow pane (380 px), after review: the text truncates and the keycap stays:

🤖 Generated with Claude Code