Add slash command argument completion to the TUI composer (#62343)

## Why

The slash command menu helps users find commands, but leaves them to
recall fixed arguments such as `on` and `off` for `/raw`.

## What changed

Show prefix-filtered suggestions for the first argument of supported
slash commands. For example, type `/mcp lo` and press `Tab` to complete
`/mcp login`. `Enter` and configured submit shortcuts still submit the
draft as typed.

Give mention completion priority and limit argument suggestions to
commands available in the current thread and connection state.

## Testing

Add tests for popup rendering, argument replacement, submit shortcuts,
and changes in thread availability and connection state.

GitOrigin-RevId: 8682c323064457dd9307b0a1520469011a8df9f3
This commit is contained in:
Benjamin Carlsson
2026-11-18 19:11:14 +00:00
committed by copyberry
parent 71527c18c7
commit 42cf4edfcd
15 changed files with 708 additions and 57 deletions
+4
View File
@@ -210,6 +210,10 @@ impl ChatWidget {
cancellation
}
pub(crate) fn set_composer_restricted_input_mode(&mut self, mode: Option<RestrictedInputMode>) {
self.bottom_pane.set_composer_restricted_input_mode(mode);
}
pub(crate) fn handle_restricted_key(
&mut self,
key: KeyEvent,