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.
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.
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.
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.
- 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.
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.
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.
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.
- 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.
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.
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.
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.
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.
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.
Skylar's review of 886a0b3:
1. tc/tid go locale by locale: in each locale the context or @id row,
then the plain row, so pt-br's plain row beats pt's context row.
2. pt (and pt-* other than pt-br) uses pt-PT plural rules: 0 is plural.
3. A script subtag (sr-Latn-RS, sr_RS@latin, be_BY@latin) never picks a
code of another script; sr-Cyrl-RS still picks sr.
4. A row defined twice is reported and the first kept, as in the checker.
5. The pseudo locale is debug-only via from_code, get marks too, and
looked_up() lists what was looked up for an app's audit.
6. intl_pluralrules pinned to =7.0.2; plural_form_counts copied from the
checker, plus pt.
7. I18n::new takes the app's offered codes: languages(), from_code,
match_tag and system_lang only return those; others stay fallbacks.
Smaller: en/pseudo/repeated codes are skipped and reported,
system_lang is cached, zh-hant-hk falls back to zh-hant, rtl adds ckb,
dv, ps, sd, ug and yi.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Review fixes (CodeRabbit): a glibc @latin/@cyrillic modifier becomes the
script subtag and only codes with that script are tried. sys-locale
drops the modifier, so on desktop Unix system_lang reads LANGUAGE,
LC_ALL, LC_MESSAGES and LANG raw, in its order. README: tl! qualifies
CURRENT with $crate; get follows the locale chain but never the plain
row or English.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>