fix(tui): slash-command menu — Tab completes the highlighted item, bare '/' guard, no-match row, ellipsis, footer hint, stable height (#1401) - #1402
Merged
Conversation
…er, no-match row, ellipsis, footer, height Red output: TestSlashMenu_TabCompletesHighlighted: Tab must complete the highlighted command into the input, got "/co" TestSlashMenu_BareSlashEnterDoesNotRun: input must be preserved, got "" TestSlashMenu_ScreenHeightStableWhenOpen: screen height changed when the menu opened: 38 -> 47 rows TestView_NoMatchRow / TestView_EllipsisTruncation / TestView_NoTrailingNewline / TestView_FooterHint / TestHasUserChoice: fail Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJGxhoFhA8JjkwZFcLGdS5
…bare '/'+Enter no longer runs the first command, no-match row, ellipsis truncation, footer hint, full-width highlight, stable screen height Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJGxhoFhA8JjkwZFcLGdS5
…ng-log entry Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJGxhoFhA8JjkwZFcLGdS5
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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 #1401
Summary
The slash-command menu now behaves and reads the way a first-time user expects: Tab completes the item highlighted with ↑/↓ instead of the input box's prefix guess; Enter on a bare
/no longer runs/add-dirbut explains how to choose; a query with no matches shows a dim "No matching commands" row instead of the menu vanishing; descriptions are truncated with…and the command name is never cut; the highlight is a full-width bar; a footer hint lists the keys; the stray blank row is gone; and the menu borrows its rows from the top of the transcript so the screen height stays constant (previously 38 → 47 rows at 120x40).Scope and issue reconciliation
All seven items in #1401 are addressed; nothing else changed. Two legacy tests that encoded the old behaviour (Tab on bare
/is a no-op; Enter on bare/accepts the first item) were updated to the new contract and say so in comments. Out of scope per the issue: fuzzy ranking, alias display, status-message lifetime.Impact analysis reconciliation
cmd/harnesscli/tui/components/slashcomplete/{model,view}.go:navigatedflag,HasUserChoice,Query, rewrittenView.cmd/harnesscli/tui/model.go: Tab arm (only when the menu is open and no overlay), bare-/Enter guard, viewport row trimming inView().components/inputareaunchanged: its Tab completion still serves@file paths and slash input when the menu is closed.testdata/snapshotsregenerated.Architecture and duplication check
Searched
rg slashComplete cmd/harnesscli/tui,rg KeyTab cmd/harnesscli/tui,rg AutocompleteProvider. The dropdown already owned selection state; this PR routes Tab to it rather than adding a second completer. Truncation and row building live in the component'sView; no new package.Test-first evidence
Red command:
go test ./cmd/harnesscli/tui/... -run 'SlashMenu|TestView_|HasUserChoice'(commit 57f5c5a)Observed failure:
Why it proved the bug: each assertion mirrors a keystroke sequence reproduced live in tmux (issue #1401 captures).
Green command:
go test ./cmd/harnesscli/tui/... -race→ all packages ok (commit 7144d9b).Verification evidence
go test ./cmd/harnesscli/tui/... -racePASS;go vet ./cmd/harnesscli/tui/...clean.Tab after ↓ on
/co(was: input unchanged, highlight reset):Bare
/+ Enter (was: ran /add-dir):No match (was: menu vanished):
60 columns (was: chopped mid-word):
40 columns:
Rollout and rollback
TUI-only; rebuild with
scripts/install.shand restart the TUI. Rollback: revert.Documentation
website/docs/cli/tui.mdkey table and menu section updated; engineering-log entry added.Contract checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01WJGxhoFhA8JjkwZFcLGdS5