Skip to content

Search the Shortcuts page by command name or key, or by pressing a key - #2957

Open
brhellman wants to merge 20 commits into
Foundry376:masterfrom
brhellman:shortcut-search
Open

brhellman wants to merge 20 commits into
Foundry376:masterfrom
brhellman:shortcut-search

Conversation

@brhellman

@brhellman brhellman commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

The Shortcuts page lists about 70 commands across six sections with no way to search them. Answering "what does S do?" means reading every row. VS Code, JetBrains IDEs and Obsidian all let you search shortcuts by command name and by key, and JetBrains' Find Action by Shortcut lets you just press the key.

  • A search box above the list. A command matches if its name contains the text (ignoring case) or one of its keys does, as the keymap writes it. mod is read for the platform, so ctrl+r finds Reply on Windows and Linux and cmd+r on macOS, and control and option/opt are accepted too. Sections with no matches are hidden, and "No shortcuts match." shows when nothing does.
  • Find by key listens for one shortcut and lists the commands it runs, as "Runs on S" with a × to go back. It matches whole keys (s doesn't match shift+s), and an unused key gets "Nothing runs on Q.". Keymaps are suspended while it listens, as they are for the + recorder.
  • Section Clear hides while searching, so it never clears rows you can't see.
  • Refactor: the recorder and the key formatting move out of CommandItem into ShortcutRecorder and keystrokes.tsx so the row and the search share them. The recorder now suspends keymaps while mounted and resumes them when unmounted, and Record a shortcut from a + button, adding it beside the command's keys #2952's specs pass unchanged against it.

Stacked on #2956.

Verified: shortcut-search-spec covers the helpers (empty, whitespace, case, key spellings and aliases per platform, whole-key matching). On the mounted page it covers name and key filtering, hidden empty sections, Clear hidden for typed text and for a key, the empty messages, Find by key end to end through the recorder (suspended while listening, resumed after), clearing the key, Esc going back to the box, and a fresh list after Find by key. Every statement and condition in the search, the page changes and the extracted recorder was mutated: 34 of 34 red. Three survivors showed the recorder's double-cancel guard was dead, so it's gone. Live, in this branch's build on a copy of a Gmail-template config (Electron 44.5.1, DevTools input): typing "reply" left Reply and Reply All, and Find by key then s showed "Runs on S" with only Star. Lint, prettier and tsc clean; full suite 2497 passing.

Screenshots: typing "reply", then Find by key and s:

search Find by key
search find

Shortcuts page series (one concern each; merge in this order): #2950 [] unbinds, #2951 mail held behind Preferences, #2952 record with +, #2953 remove keys, #2955 conflict warnings, #2956 visual pass, #2957 search, #2958 single-key switch, #2959 Show filter.

🤖 Generated with Claude Code

Brian Hellman and others added 7 commits October 7, 2026 20:59
KeymapFile created a command's entry only while pushing its first keystroke, so `[]` left no
entry and the template's keys stayed bound: there was no way to remove a shortcut, even by
editing the file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Recording began whenever a row took focus and ended on its own, a single plain key could not be
recorded (the row waited for a second one and saved "k then j"), and the result replaced every
key the command had. Recording now starts from a + button and says so; a modifier combination
ends it at once, a plain key after Mousetrap's one-second sequence timeout; Esc cancels; the
key joins the command's existing ones; focus returns to the button.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… or all

Each key is a chip with an x that removes it (and any other spelling of the same key), a
command the user keymap changed gets a Reset back to the template, each section has a Clear,
and Clear All (confirmed) empties every command. A command left with no keys is written as
`[]`, which unbinds it. "None" is localized now that it shows on cleared commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every command bound to a key runs when it is pressed, so adding "s" to Archive while Star has
"s" made one key archive and star. The Shortcuts page now marks both keys, says on the row the
key was added to which other command it runs, offers to remove it from either, and counts these
at the top. The defaults' own shared keys (Outlook's Ctrl+U underlines in the composer and marks
unread in the list) are not flagged: KeymapManager keeps each command's keys from before the
user keymap so a key the user added can be told from one the template gave.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keys are drawn as keycaps at the small text size rather than run together in a monospace line,
the add button says "+ Add", a dot marks a command changed from the default, rows highlight on
hover with their x buttons, and the sections flow into one column in a narrow window and two in
a wide one instead of a fixed 800px split.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A search box above the list narrows it to commands whose name matches or that have a matching
key as written (ctrl+r, and cmd/control/option for the modifier names), hiding empty sections.
Find by key listens for one shortcut and lists the commands it runs, or says nothing does.
Section Clear links hide while searching so they never clear rows out of sight. The key
recorder and key formatting move out of the row into ShortcutRecorder and keystrokes.tsx so the
row and the search share them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant