Repository navigation
Show hotkey chips on menu rows a keybinding also reaches - #8569
pranavbabu wants to merge 3 commits into
Conversation
Rows in the Omarchy menu that a keybinding also triggers now carry that chord as a small muted chip on their right edge — Learn > Keybindings reads SUPER + K, the System submenu SUPER + ESCAPE, and the default terminal's row in Apps SUPER + RETURN — teaching the faster path to what the user just navigated to. The chords are derived from the live binds rather than declared twice: omarchy-menu-hotkeys reads the keybindings menu's cached records (omarchy-menu-keybindings --records) and reports one cmd/app row per exec chord. MenuModel.hotkeyIndex matches them onto rows by action (normalizing quoting, Exec field codes, and launcher prefixes, with webapp launches reduced to their URL), by menu routes the bind opens, and onto app rows by resolved desktop id or the entry's Exec. A rebind in the hypr config moves the chip with it; an explicit hotkey: field in JSONC overrides for rows whose action spells the same launch differently. The shell runs the batch like the guards — per (re)load and per open, never blocking the open path. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
On a 300px menu card a spelled-out chord is wider than the title beside it: "SUPER SHIFT CTRL + SPACE" runs 24 characters, and the brightness binds reach 29, so contentColumn collapsed and the row's label elided — Apps, whose titles are the longest, worst of all. MenuModel.compactChord renders the chip's own spelling: modifiers to three letters, long X11 key names to what the key does, joined by a bare "+". SHIFT + XF86MonBrightnessDown becomes SFT+BRIDN, 29 characters down to 9; the widest chord left is 15. It applies to explicit hotkey: fields too, so a JSONC override reads like a derived chip. The keybindings menu keeps the spelled-out form — it has the width for it. The chip also caps at a third of the row and elides, so a chord no abbreviation can save truncates before the title it belongs to does. That spelling wants a size under the old floor of caption, so Style.font.micro (0.75, 9px) joins the type scale, overridable from a theme's [font] block like every other token. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds derived hotkey chips to menu rows, helping users discover keyboard shortcuts.
Changes:
- Derives and matches live keybindings to menu actions, routes, and apps.
- Renders compact hotkey chips with a new micro font token.
- Adds shell tests and documentation.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 10 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
bin/omarchy-menu-hotkeys |
Reports command and app hotkeys. |
bin/omarchy-menu-keybindings |
Exposes cached binding records. |
shell/plugins/menu/MenuModel.js |
Matches and compacts hotkeys. |
shell/plugins/menu/Menu.qml |
Refreshes and renders hotkey chips. |
shell/Commons/Style.qml |
Adds the micro font token. |
default/omarchy/omarchy-menu.jsonc |
Documents the hotkey field. |
config/omarchy/extensions/omarchy-menu.jsonc |
Documents extension overrides. |
default/themed/shell.toml.tpl |
Adds the micro-size override. |
docs/menu.md |
Documents hotkey derivation and display. |
docs/omarchy-shell.md |
Documents the font token. |
test/shell.d/menu-hotkeys-test.sh |
Tests reporting, matching, and compaction. |
test/shell.d/menu-test.sh |
Updates menu-row expectations. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
I'd find this useful for learning shortcuts while browsing the menu. A few suggestions:
On performance, the asynchronous loading and in-memory index already look like a good foundation. For weaker machines, a few things seem worth considering:
These could be incremental refinements; the selected-item-only option is the one I'd value most. |
Rows in the menu that a keybinding also triggers now carry that chord as a small muted chip on their right edge — Learn > Keybindings reads
SUP+K, the System submenuSUP+ESC, the default terminal's row in AppsSUP+RET. The chip teaches the faster path to whatever the user just navigated to by hand.