Commit Graph
50 Commits
Author SHA1 Message Date
aiongg 02ba09ee9a keymap ui: Options::visible hides catalog entries from the table
Hidden entries keep their bindings and still count in conflicts; they are
left out of the rows, search and the Show entries.
2026-10-20 20:53:13 +00:00
aiongg 0bff6f4c96 keymap ui: commands that share a default key are no conflict in the dialog
The dialog's conflict count, Conflicts filter and row warnings leave out
pairs whose commands both have the chord among their defaults, as
Keymap::clashing does.
2026-10-20 20:48:54 +00:00
aiongg d9b1a89950 Merge branch 'craft-keymap' into keymap-ui
# Conflicts:
#	.github/workflows/keymap.yml
#	crates/keymap/README.md
#	crates/keymap/src/egui.rs
2026-10-20 16:01:22 +00:00
aiongg f501cae73b keymap: settle the public API before release
Outcome, ConflictMode, ProfileError and Options are non_exhaustive, with Options::with for
options built in one expression. Profiles keeps its fields private behind active() and sets(),
lists the sets loading dropped in problems(), and stores a format version (a store without one
reads as version 1).
2026-10-20 15:49:51 +00:00
aiongg 60daca3770 keymap: name the selected row to screen readers, announce conflicts and messages, and make group headers and key caps Tab stops 2026-10-20 15:46:56 +00:00
aiongg 9aaf9dfd38 keymap: format, and keep the dispatcher's Default clear of clippy's derive lint 2026-10-20 15:46:00 +00:00
aiongg 6d96b4f684 keymap: mark public enums and report structs that will grow non_exhaustive 2026-10-20 15:29:50 +00:00
aiongg ad79cbcf31 keymap: translate shortcut parse errors and give translators whole sentences with placeholders 2026-10-20 15:29:42 +00:00
aiongg 501e2cf1fc keymap: while typing, text-editing chords go to the text field unless an active context binds them 2026-10-20 15:21:54 +00:00
aiongg 423524c1bc keymap: clipboard chords with more modifiers run their bindings with clipboard events off 2026-10-20 15:18:05 +00:00
aiongg 5160611bad keymap: while typing, a Ctrl+Alt press runs unless it typed text in the frame 2026-10-20 15:11:46 +00:00
aiongg 79747aeaae keymap: remove the Text event a bound press typed, also when the web build sends it first 2026-10-20 15:11:21 +00:00
aiongg fd2386b2ba keymap: hold the set row, table and edit actions while a prompt or the import review is open
Switching sets closes an open prompt, deleting a set reloads only when it was the active one, and
deleting the last set with no built-ins loads no overrides.
2026-10-20 15:10:58 +00:00
aiongg 339aaa41df keymap: show that an app with sets stores only Profiles and loads the active set 2026-10-20 15:09:14 +00:00
aiongg f4b04e4ad1 keymap: a double press needs both presses in the same panel 2026-10-20 15:09:01 +00:00
aiongg 0039a5c866 keymap: report Changed after a Cancel that undid edits, so apps rebuild their menus 2026-10-20 15:08:46 +00:00
aiongg 056a709d0f keymap: refuse scope names with outer whitespace, which binding text trims 2026-10-20 15:08:43 +00:00
aiongg 2abdcd53ab keymap: give Tab back to focus navigation after the New Shortcut field or Search by key records 2026-10-20 15:07:36 +00:00
aiongg 29ee24ab51 Merge branch 'craft-keymap' into keymap-ui 2026-10-20 06:32:28 +00:00
aiongg 9b0182a3e0 keymap: a held web clipboard key with repeats off leaves its clipboard events in place 2026-10-20 04:18:35 +00:00
aiongg 4674ab7c85 keymap: use US spelling in the shortcuts dialog 2026-10-20 03:28:24 +00:00
aiongg cf9e10a90a Merge branch 'craft-keymap' into keymap-ui
# Conflicts:
#	crates/keymap/README.md
#	crates/keymap/src/lib.rs
2026-10-20 03:26:15 +00:00
aiongg 890660444c keymap: use US spelling 2026-10-20 03:24:56 +00:00
aiongg 5e29e70b46 Merge branch 'craft-keymap' into keymap-ui
# Conflicts:
#	crates/keymap/src/egui.rs
2026-10-20 02:42:51 +00:00
aiongg 75a42cb95f keymap: an import change that cannot take a chord from another command leaves both commands as they were 2026-10-20 02:41:01 +00:00
aiongg 9b7102e297 keymap: New Set refuses a name that is taken
The set form's New Set replaced a user set of the same name (save_as) or
quietly made the name unique (duplicate). It now refuses a name that
matches a built-in or user set, ignoring case and surrounding spaces, the
way Rename does, and keeps the form open. The check runs before the
prompt to save edits and again after it.
2026-10-20 02:39:59 +00:00
aiongg 1b329b9422 keymap: a web clipboard press takes its clipboard event and the pasted text with it 2026-10-20 02:39:41 +00:00
aiongg 488db9e3df Merge branch 'craft-keymap' into keymap-ui 2026-10-20 00:49:07 +00:00
aiongg 3ef24a785b keymap: egui::platform gives the browser's operating system on the web 2026-10-20 00:49:05 +00:00
aiongg d0c8d3d0c7 Merge branch 'craft-keymap' into keymap-ui
# Conflicts:
#	crates/keymap/README.md
#	crates/keymap/src/lib.rs
2026-10-19 21:40:28 +00:00
aiongg 86fb06a081 keymap: report Changed after Import when the save prompt changed the set 2026-10-19 20:58:45 +00:00
aiongg 4a721df085 keymap: state that chord reservations are opt-in through with_reserved 2026-10-19 20:47:23 +00:00
aiongg 53f16925cf keymap: put overrides_list on the craft-settings example in the crate docs 2026-10-19 13:15:36 +00:00
aiongg 2baaf87ecf keymap: Don't Save before Import reloads the stored set 2026-10-19 13:14:15 +00:00
aiongg 093238b065 keymap: rename refuses a name another set holds in a different case 2026-10-19 13:14:15 +00:00
aiongg 3e344373ef keymap: put overrides_list on the craft-settings example in the crate docs 2026-10-19 13:14:15 +00:00
aiongg d67d96e9bb keymap: shortcuts dialog right-to-left layout, long-label truncation, pseudo-locale test and README 2026-10-19 12:03:23 +00:00
aiongg 94eacba872 keymap: on-screen keyboard pane, fixed-row labels and read-only mode
The keyboard pane (Options::keyboard) draws a US ANSI layout under the
table and detail pane, coloured by who holds each key with the toggled
and held modifiers, lists the clicked key's shortcuts and assigns key and
modifiers to the selected command. Fixed rows always report a label, with
"Now used by" when a command took their key. A read-only dialog has no
set row, keeps Summarize in the footer and closes with shortcuts.close.
2026-10-19 12:03:23 +00:00
aiongg d2b9f91838 keymap: shortcuts dialog sets, import review and summary
Set row with picker, New Set (based on current shortcuts or a set),
Rename, Delete, Save, Revert Set, Export, Import and Summarize; actions
that do not fit go into a More menu. The foreign import review lists
what will change, suggestions to pick, unmatched, unreadable,
approximated and matched-without-change entries, then the report of
skipped, taken and failed changes with Copy Report. ui::summary writes
the shortcut summary as HTML and plain text.
2026-10-19 12:03:23 +00:00
aiongg 39f343c47b keymap: draw the shortcuts dialog: table, detail pane, conflict bar and footer
- view.rs: header with Show (dropdown or tabs), Filter and Search with search
  by key; table and detail pane in a resizable split, the detail pane below
  the table under 720 pt; virtual rows with chips, + and the restore button;
  detail pane with current shortcuts, New Shortcut, typed entry, Context,
  Assign, Use Default and Clear; prompts, conflict bar, messages, clash,
  shadow and problem lines; Undo, Redo, Reset All, Cancel and OK.
- Escape, Enter, Undo and Redo keys when idle; table keys (arrows, Home,
  End, Enter records, Delete removes); focus locks while recording.
- Accessibility labels for every control, row selection, and on_widget
  automation ids.
- style.rs: DialogStyle and the icon-button and divider styles.
- show() sizes the window to the screen; closing it is Cancel.
- tests/ui_dialog.rs: recording, conflicts, search, areas, display, labels,
  table keys, small windows, RTL. tests/ui_snapshot.rs (feature snapshot)
  writes PNGs when CRAFT_KEYMAP_SNAPSHOT_DIR is set.
2026-10-19 12:03:23 +00:00
aiongg b9bd4119cc keymap: shortcuts dialog model behind the ui feature
DialogState with every dialog action as a call on EditSession, Recorder,
editor::holders and Profiles; the table rows (areas from paths, kind and
scope, filters, search by label, translation or chord, grouping, sorting,
a row cache); key capture while recording, including clipboard events,
which removes the events it takes; the Text trait, I18nText and the list
of strings the dialog looks up. Drawing comes separately.
2026-10-19 12:03:23 +00:00
aiongg 70c84ec76c keymap: named shortcut sets with JSON export and import, and the shortcut editor model
Profiles keeps the user's sets beside the app's built-in ones: switch, duplicate,
rename, delete, export one set as JSON and import it back, and import another
application's set through an import plan as a new set. The editor model holds an
edit session with undo and cancel, conflict queries for steal or keep, a chord
recorder with double press, and search.
2026-10-19 12:03:23 +00:00
aiongg 362eb59fd2 keymap: keep an earlier entry's chord when the later entry finds the overrides full 2026-10-19 11:59:53 +00:00
aiongg 1e4ab21708 keymap: keep panel-menu entries without keys from clearing commands
The last segment of a panel-menu entry matches alone only when the panel
name is a segment of some catalogue path. An entry without keys matched
only as a panel-menu item leaves the command's shortcuts alone and is
listed in ImportReport::matched_without_change. Tests cover an entry
without keys next to one with keys for the same command, in both orders.
2026-10-19 04:45:45 +00:00
aiongg 6e136c9114 keymap: match panel-menu items, aliases in menus, and Show/Hide only for toggles
- ForeignEntry::in_panel_menu marks an item whose leading segments name a panel
  (InDesign's "Character: All Caps"); it also matches a catalogue path ending
  with its segments, then its last segment as a unique label.
- Aliases count in the menu steps too, joined segments are tried as a label or
  alias anywhere, and normalize_label reads a colon as a space, so the alias
  "Preferences: General…" matches "Edit > Preferences > General...".
- A leading Show, Hide or Show/Hide is dropped only for commands marked
  Bindable::toggle, and only after the names as written found nothing.
- Keys in skipped contexts are left out of unmatched rows, so entries with only
  such keys no longer use up the suggestion cap.
2026-10-19 04:34:27 +00:00
aiongg 48c0e1b59d keymap: drop hand-written key variants when a command gets its defaults
reset, and an edit that leaves a command with its defaults, removed
only the entry the command read. A variant of its key
(window.panel { "panel": "layers" }) stayed and took effect on the
next load. Both remove every entry that resolves to the command.
2026-10-19 04:24:19 +00:00
aiongg be51941628 keymap: add Keymap::conflicts_with and document the edit calls
conflicts_with lists the commands that share one command's chords, with
that command as a, without filtering every conflict. The README shows
set_bindings with one binding for an editor with one shortcut per
command; assign adds a binding.
2026-10-19 04:23:26 +00:00
aiongg 5208562c28 keymap: store overrides as a map of one text per command when they fit
Apps that stored { command: text } before read the field in older builds
again. Overrides with several bindings for a command still serialize as
the { command, keys } array. keymap::overrides_list always writes the
array, for craft-settings files, where only an array lets a reset entry
leave the file.
2026-10-19 04:22:49 +00:00
aiongg 4df9e5936a keymap: let apps decline dispatch hits and keep clipboard events
Hit carries the trigger that matched and whether the press matched it
exactly. Dispatcher::dispatch_filtered takes a predicate; a declined hit
leaves its event and text in place.

egui's Copy, Cut and Paste events stay with the app unless
with_clipboard_events(true): egui-winit sends them in place of the
clipboard presses, and a Paste event consumed as a hit lost its text.
With them on, Hit::pasted holds that text, and a web clipboard press
and the event it causes run once for every clipboard chord, not only
Cmd+C/X/V. The Hit doc line moves from DOUBLE_PRESS to Hit.
2026-10-19 04:21:48 +00:00
aiongg d6c7b45350 keymap: shared keyboard bindings, scopes, overrides and shortcut-set import
craft-keymap holds the data and logic for keyboard bindings: egui-free
chords with one canonical text form, bindings to commands with params,
several bindings per command, scopes, tool groups, conflicts, overrides
kept in a craft-settings type, an import pipeline for other applications'
shortcut sets, and an optional egui dispatcher. Apps keep their command
catalogue, file readers and UI.
2026-10-19 03:52:23 +00:00