Skip to main content

Module command_menu

Module command_menu 

Source
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 s1 and s2. Pure, used by tab_completion_target and exposed for tests.
popup_rect
Compute the rectangle to render the popup in, given the input box’s area and the number of candidate rows. Returns None when 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]o instructions.
tab_completion_target
Return the canonical name to autocomplete to, given the current buffer and the set of matches.