Expand description
Slash-command picker — live-filtered list of commands the operator can tab-complete into the prompt.
§Activation
The picker is ambient: every render, app::state checks
whether the first row of the prompt buffer starts with /,
and if so, builds a fresh SlashPicker from the filter
string (the characters after the /). There is no “open /
close” flag — typing the leading slash opens it, deleting it
closes it. This matches the “no mode” invariant used by the
overlay system and avoids a stale picker hanging around when
the operator clears the prompt.
The picker yields priority to the friction-pause overlay:
when a gate is active, app::state suppresses the picker
regardless of prompt contents.
§Matching
The match function is a deliberately simple subsequence scorer (fzf-lite). Each candidate name is walked character by character; a match requires the filter’s chars to appear in order. Score is built from:
-distance_to_prefix— matches that start at character 0 rank higher than mid-name matches (/hprefers/helpover/flatten-all withhmid-word).-cluster_penalty— contiguous runs are cheaper than scattered hits (so/staprefers/statusover/stateonly because the whole query is contiguous in both; the tiebreaker falls back to catalog order).
No external crate. fzf-rs and nucleo-matcher are both good libraries, but both are 5-figure-LOC deps and we need exactly 14 entries to match — a subsequence scorer is sufficient and zero-dep friendly.
Structs§
- Slash
Match - One picker row — the catalog entry plus bookkeeping used by the widget to bold the matched chars.
- Slash
Picker
Constants§
- PICKER_
MAX_ VISIBLE - Max visible rows in the picker popup. Six fits the common case (all current commands after a two-char filter) without stealing the conversation pane.