feat(tui): Tab accepts the composer's suggested query placeholder#690
Merged
Conversation
Plain Tab on a fresh, idle, empty composer inserts the query suggested by the dim `Try "…"` placeholder (cursor at end); an open-ended stub like `write a test for…` drops the ellipsis and keeps a trailing space, and a suggested /command pops its completion menu exactly as if typed. Mirrors original CC's Tab fallback (useTypeahead.tsx: tab / no shift / no suggestions / empty input → accept the prompt suggestion). Gated on the exact placeholder-visibility condition (conversation empty, not busy, empty input, no completions) so Tab can never insert what isn't displayed, and never shadows completion-accept or Shift+Tab mode cycle. Co-Authored-By: Claude Fable 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.
Summary
The composer's dim placeholder on a fresh idle session (
Try "explain this codebase",Try "/help" for commands, …) is a system suggestion of a query — but there was no way to take it. Plain Tab now accepts it: the suggested query is inserted into the input with the cursor at the end.Try "explain this codebase"→ insertsexplain this codebaseTry "write a test for…"→ insertswrite a test for(ellipsis dropped, trailing space kept so the sentence is continuable)Try "/help" for commands→ inserts/helpand pops the slash completion menu exactly as if typedAsk me anything…carries no query → Tab stays inertMirrors original CC's Tab fallback (
typescript/src/hooks/useTypeahead.tsxhandleKeyDown: tab / no shift / no suggestions / empty input → accept the prompt suggestion); there the suggestion state holds the bare query, ours is embedded in theTry "…"placeholder string, hence the extraction helper.Gating
shouldAcceptPlaceholderSuggestionmirrors the placeholder-visibility condition exactly (conversation empty + idle + empty input, threaded asInputHandlerContext.conversationEmptyfrom the same flag appLayout renders from), plus no-completions and no-shift — so Tab can never insert what isn't displayed and never shadows completion-accept or the Shift+Tab permission-mode cycle.Verification
tsc --noEmitand eslint clean/help+ menu), incl. second-Tab-inert; PTY-resize repaint used to defeat cell-diff renderer artifacts in pyte🤖 Generated with Claude Code