Expand description
Command-completion popup (Goal 146).
When the prompt input is in crate::tui::app::InputMode::Command,
the chat renderer overlays a small popup just above the input box
that lists the candidate commands matching the current buffer.
The popup is purely visual — keyboard navigation lives in
crate::tui::app::App::handle_command_menu_key, which is called
from crate::tui::app::App::handle_key before falling through to
the generic chat key path.
Constants§
- MAX_
VISIBLE - Maximum number of candidate rows to display in the popup.
Functions§
- longest_
common_ prefix - Compute the longest common prefix of
s1ands2. Pure, used bytab_completion_targetand exposed for tests. - popup_
rect - Compute the rectangle to render the popup in, given the input
box’s
areaand the number of candidate rows. ReturnsNonewhen the popup doesn’t fit (terminal too short or candidates empty). - render
- Render the popup. No-op when the input mode is not Command, the buffer is empty, or no matches are available.
- render_
atfile - Render the @file completion popup (Goal 158). No-op when not in AtFile mode or when the suggestion list is empty.
- render_
history_ search - Render the Ctrl+R history-search popup (Goal 160). No-op when not in HistorySearch mode or when there are no matches to show.
- render_
permission_ modal - Render the permission-request modal when a tool is waiting for user
approval. Displayed as a centred overlay with the tool name, an
abbreviated argument preview, and
[Y]es / [N]oinstructions. - tab_
completion_ target - Return the canonical name to autocomplete to, given the current buffer and the set of matches.