Inline prompt history search panel for the chat composer.
Opened by a first Ctrl+R; a second Ctrl+R escalates to the full
PromptClipboardScreen modal. Key handling lives on ChatInput
(_prompt_search_active / _handle_prompt_search_key), which the app action
routes to.
Result rows the inline panel shows before the list scrolls.
Most rows rendered in the DOM at once, windowed around the selection.
Mounting one PromptSearchOption per filtered prompt costs real time at the
100-entry history cap and throws most of them away above the 5-row viewport, so
the panel renders a sliding window instead. Navigation re-windows via
update_selection, so any reachable row is mounted before it can be selected;
unmounted rows are simply never the selection target.
Hint rows the panel is willing to render; it wraps on narrow windows.
How close to a mounted edge the selection gets before the window re-centers.
update_selection re-styles two rows when the selection stays comfortably
inside the mounted window, and rebuilds all of it otherwise. Rebuilding
whenever the ideal start moved would rebuild on every single-step move once
the list outgrows PROMPT_SEARCH_WINDOW, which is the common case. This margin
keeps that on the cheap path until the selection nears an edge.
Rows the panel reports at its tallest: query, results, and wrapped hint.
This is the ceiling on what show() can report, so it is what ChatInputBox
reserves when fitting a manual composer height and what the panel's own
max-height clamps to. _hint_rows() clamps the hint estimate to
PROMPT_SEARCH_MAX_HINT_ROWS so the two can never disagree -- the clamp lives
there, not in show(), because on_resize re-measures through the same helper
without going through show().
Build the footer line for the current charset mode.
The Ctrl+R mention is what makes the modal tier discoverable. The line is
kept short enough to wrap within PROMPT_SEARCH_MAX_HINT_ROWS at the
narrow widths the composer supports.
Return a prompt's first non-empty line for a one-row summary.
Return prompts containing the query, case-insensitively.
Query field for the inline prompt search panel.
Plain Input apart from the class name, which lets ChatInput filter
Input.Changed / Input.Submitted messages down to this field, plus
bindings for the keys the panel owns while focused.
One clickable prompt row in the inline search panel.
Inline prompt history search rendered above the input row.
Display-only: ChatInput owns the query, filtered snapshot, and
selection, drives key handling, and re-opens the modal tier. The panel
mirrors CompletionPopup: hidden by default, rebuilt via generation
counters so a stale async rebuild cannot re-show a dismissed panel, and
reports its rendered row count so ChatInputBox can reserve space.