feat(tui): right arrow accepts the typeahead suggestion at end of input#157
Merged
Conversation
Fish-style acceptance: a configurable 'right' -> moveRight binding in the Chat context routes through the keybinding system; the handler accepts the current suggestion when the cursor sits at the end of the input and moves the cursor otherwise. Tab acceptance now also works while a turn is streaming, so the popup stays interactive and Enter queues the completed command.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR updates the TUI chat input UX so the Right Arrow key accepts the current typeahead suggestion when the cursor is at the end of the input (fish-style), and adjusts Tab suggestion acceptance to remain available while a turn is streaming. It also wires the Right Arrow behavior through the configurable keybinding system (no hardcoded key checks) and adds targeted tests for the new behaviors.
Changes:
- Add a default Chat-context keybinding mapping
right→moveRightand a resolver test inclaurst-core. - Implement
moveRightin the TUI app: accept suggestion at end-of-input, otherwise move cursor. - Relax the
indent/Tab action to accept suggestions even while streaming, and add behavior tests.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src-rust/crates/tui/src/app.rs | Adds moveRight action handling, relaxes indent (Tab) acceptance while streaming, and adds tests for right-arrow/Tab suggestion acceptance behavior. |
| src-rust/crates/core/src/keybindings.rs | Adds Chat default binding for right → moveRight, updates in-source keybinding docs, and adds a resolver test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+5473
to
+5477
| // Right arrow: accept the typeahead suggestion when the | ||
| // cursor sits at the end of the input (fish-style); | ||
| // otherwise move the cursor. Acceptance works while | ||
| // streaming so the popup stays interactive when a turn is | ||
| // in flight — Enter then queues the completed command. |
Comment on lines
+5667
to
+5670
| // Tab: accept the typeahead suggestion, or cycle agent mode | ||
| // when the prompt is empty. Acceptance is allowed while | ||
| // streaming so the popup stays interactive when a turn is | ||
| // in flight — Enter then queues the completed command. |
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
Context
right->moveRightChat-context default in the keybinding system, the app-side handler (accept at end-of-input, move cursor otherwise), and relaxing Tab acceptance to work mid-stream (Enter then queues the completed command).Changes
crates/core/src/keybindings.rs:("right", "moveRight", KeyContext::Chat)default binding + doc line + resolver test. No hardcoded key checks; flows through the configurable keybinding system.crates/tui/src/app.rs:moveRightaction arm (accept suggestion at end of input, otherwise move cursor);indent/Tab arm accepts suggestions even while streaming; three behavior tests (accept at end, move mid-text, Tab-while-streaming).Validation
git diff --check— cleancargo fmt --all—--checkcleancargo check --workspace— cleancargo clippy --workspace --all-targets -- -D warnings— cleancargo test --workspace— not run in full; see targetedcargo test --package claurst-tui -- typeahead(6 passed),cargo test --package claurst-core keybindings(23 passed, incl.test_right_resolves_to_move_right_in_chat)PR Readiness