You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
App commands and shortcuts defined once (exact-modifier dispatch, modal scope, menu binding) #125
A command has a title, a shortcut and an enablement; a menu item shows the shortcut and is disabled with it; one dispatcher respects modal scope. Two egui traps today: consume_shortcut matches modifiers logically, so ⌘S also fires on ⇧⌘S (reproduced, plain egui 0.37), and modal scope is manual.
Proposal:Commands<A> (id, title, shortcut, enabled: fn(&A) -> bool, run: fn(&mut A)), one dispatcher per frame matching modifiers exactly and stopping at the topmost modal root (M6c, #106); stock menu items take .command(id) (#109).
From the operator-console port (#22), at rev 855eb20; reproduced on Linux.
While a text field has focus, only ⌘/Ctrl/Alt chords fire, minus the reserved editing set; a command can override this with .in_text(InText::Fire | InText::Yield).
Command ids are the app's own enum, via Key.
A disabled command's chord is not consumed and passes through.
The table is declared once with b.commands(table, app); per-root tables, so page commands don't fire under a modal; exact modifier matching.
sonnet-1 is building on app-commands.
Activity
samitbasu commentedon Nov 14, 2026
Design approved (user, 2026-11-13):
.in_text(InText::Fire | InText::Yield).Key.b.commands(table, app); per-root tables, so page commands don't fire under a modal; exact modifier matching.sonnet-1 is building on
app-commands.