feat(desktop): command palette (Cmd/Ctrl+K) for fast navigation#3124
Open
HUQIANTAO wants to merge 1 commit into
Open
feat(desktop): command palette (Cmd/Ctrl+K) for fast navigation#3124HUQIANTAO wants to merge 1 commit into
HUQIANTAO wants to merge 1 commit into
Conversation
Add a launcher modal triggered by Cmd/Ctrl+K (and the new Search
chip in the topbar). It fuzzy-searches a flat list of palette items
built from three sources: app-level actions (new session / settings /
memory / history), slash-commands fetched from app.Commands(), and
the saved-session list from listSessions().
Interaction:
- Esc closes, arrow keys move the highlight (wraps), Enter runs.
- Mouse hover sets the highlight so a click is pre-confirmed.
- Items are grouped (Actions / Commands / Sessions) and section
order is the order groups first appear in the filtered list,
matching the user's mental model ('sessions are the most frequent
target').
Lazy data load: sessions and commands are fetched on first open, not
on mount, so users who never press Cmd+K pay nothing. Subsequent
opens hit the in-memory cache.
Search: every space-separated query token must appear in the
candidate's haystack (title + hint + keywords) in order; scoring
favors tight prefixes and earlier matches. A real fuzzy matcher is
overkill for the 50-200 item working set.
A11y: the palette is role=dialog + aria-modal; the input is
auto-focused; Esc restores focus to the trigger (snapshot on open,
restored on close). Each result row is role=option with
aria-selected on the active one.
The topbar's Search chip has aria-keyshortcuts='Control+K' so screen
readers announce the chord. We deliberately don't listen to the
chord while an input/textarea is focused (it would steal the
OS-default cursor-to-start shortcut on some platforms).
5cabc15 to
4de6b1d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a launcher modal triggered by Cmd/Ctrl+K (and the new Search chip in the topbar). It fuzzy-searches a flat list of palette items built from three sources: app-level actions (new session / settings / memory / history), slash-commands fetched from
app.Commands(), and the saved-session list fromlistSessions().Interaction: Esc closes, arrow keys move the highlight (wraps), Enter runs. Mouse hover sets the highlight. Items are grouped (Actions / Commands / Sessions) and section order is the order groups first appear in the filtered list.
Lazy data load: sessions and commands are fetched on first open, not on mount.