Repository navigation
feat(keys): make keyboard shortcuts remappable per map - #1885
Conversation
…m them Store per-command overrides in settings.toml under [keymap.default] and [keymap.tenxer], keeping unknown ids and unreadable entries verbatim. Shortcut matching, labels, hints, tooltips and the F1 reference resolve from the active map's overrides and update live.
Add a pure conflict checker that reports duplicates, shadowed chord groups, keys that never fire, fixed and GTK-reserved keys, input-method keys and context overlaps for a proposed binding or a whole table. Hand-edited settings.toml entries are audited once at load and logged. Guard tests drive the real dispatchers to keep the checker in step with them. Check document zoom reset before text size so each follows its own keys.
Add a Settings page that lists every command in the Default and 10xer tables, with chips per key, Add, per-row reset and Reset all. Keys are captured inline, refused when the conflict checker reports an error and saved with their warnings shown. Labels leave out keys that never fire, unbound commands get keyless tooltips, and Settings search finds rows by action name or key.
Add a direct-commands stage, unbound by default, so a user can bind commands that only one map had a key for: 10xer verbs, sort and copy-as chord steps and navigation in the default map, and duplicate, pin, jump to folder and arrow scope in 10xer. Each runs through its existing handler on the active map's own targets. The checker reports commands that still have no path in a map. Ctrl- and Super-bound history and home keys now work, and keys added to 10xer commands work from a read-only text preview.
Add end-to-end scenarios for rebinding through Settings, overrides saved before launch, independent tables, structural aliases, capture on Russian layouts and refused conflicts. Add a keymap user guide and turn the shortcut guide's checklist into adding a command. The E2E harness can seed keymap tables, and the default-map footer shows the query of a search started from a direct key.
Rename the page heading to Keybinds and add a field that narrows the shown table by action name. Each table now lists only the commands its map can run, so the default table drops its 10xer mode section and the 10xer-only verbs and chord steps, and the 10xer table drops the default-only type-to-search filter key.
…board-shortcuts # Conflicts: # data/locales/de.json # data/locales/en.json # data/locales/es.json # data/locales/fr.json # data/locales/it.json # data/locales/ja.json # data/locales/ko.json # data/locales/pt-BR.json # data/locales/ru.json # data/locales/vi.json # data/locales/zh-CN.json # data/locales/zh-TW.json # docs/e2e-testing.md # docs/keyboard-shortcuts.md # docs/preferences.md # src/ui/browser/pane_header.rs # src/ui/browser_modes.rs # src/ui/chooser/tests/keyboard.rs # src/ui/keys/bindings/window.rs # src/ui/preferences.rs # src/ui/preferences/tests/preferences.rs # src/ui/preview.rs # src/ui/settings.rs # src/ui/shortcut_reference.rs # src/ui/window.rs # src/ui/window/composition/layout.rs # src/ui/window/composition/tabs.rs # src/ui/window/keyboard/preview.rs # tests/e2e/unit/test_harness.py
Port the deleted tests/e2e/scenarios/test_keymap.py to six scenarios in tests/qa/scenarios/keymap/. Header prefs now write object values as TOML tables, so a scenario can seed [keymap.default]. The Keyboard page's Add, Reset, Cancel and capture buttons now drop their text label relation through accessibility::clear_labelled_by, so QA targets resolve their accessible names.
…board-shortcuts # Conflicts: # src/ui/browser_modes.rs # src/ui/chooser.rs # src/ui/preview.rs
Clears RUSTSEC-2026-0391, RUSTSEC-2026-0398, RUSTSEC-2026-0403 and RUSTSEC-2026-0410 in zstd and zstd-safe, which fail cargo-deny.
…ead entries in the conflict check
|
Review pass: merged Fixed
Removed
Verified locally: |
|
Follow-up pushed in 5f26eb3: the Keyboard page stacked every keybind row (title above, chips and Add below) once the dialog's logical width fell under the 1250px compact breakpoint, which happens at the default dialog width with a larger text size. Keymap rows now stay on one line down to the 600px narrow breakpoint the text-size row already uses, since the chip row wraps on its own. Verified with container screenshots at text size 15 (1440px and 1000px windows) and at a 640px window; fmt, clippy and the |
|
Follow-up pushed in 3e08b6d: rows whose chips wrapped (10xer Page up/down, thumbnail commands with extra keys) were cut off because GtkBox measures the copy column's width for the row height only while allocating, and the wrapping note label answers that wider than its plain minimum, so the row height was computed with the chips on one line and allocated with them on three. The copy column now sits in a wrapper that answers both measures alike; the chips keep their natural width on one line and the note wraps beside them. Verified with container screenshots of the 10xer table at 1440px and 1000px windows with text size 15 and at a 640px window; fmt, clippy and the |
… keep their height
|
Follow-up pushed: the previous row fix still clipped rows in the full, scrolling table. GtkBox computes a row's minimum height by searching for the split between the copy and the chips that wraps least, but allocates the natural split, and a scrolled viewport gives the content its minimum height, so any row whose copy and chips both wrap came out short. The keymap row is now the page's own wrap row, which measures the split it allocates; the copy keeps at least 20 characters and the chips drop below it when both cannot fit, which replaces the compact-mode stacking special case from the earlier commit. Verified on host GTK 4.24.1 and in the pinned container (GTK 4.22) at 1440px, 1000px and 640px windows, filtered and unfiltered, with text size 15; fmt, clippy and the |
|
Follow-up pushed: Reset all on the Keyboard page now asks first. It opens the same message dialog as deleting a custom action, titled "Reset all keybinds?" with the shown mode as its subtitle and the existing description text, with Cancel and a danger-toned Reset. The title is added to all twelve locale catalogs; the description and button labels reuse strings that were already translated. The keyboard test covers cancelling (overrides kept) and confirming (map reset), the fixture now hosts the page under an overlay as Settings does, and the two docs that describe Reset all mention the confirmation. Verified with a container screenshot; fmt, clippy, the |
|
Follow-up pushed: the Keyboard page header is reordered. The KEYBINDS heading is gone (the page is already titled Keyboard, and the string is removed from all twelve catalogs), the Default / 10xer mode switch now comes first with Reset all at the right end of the same row, and the keybind search sits beneath it as the filter on that scope, with the first section heading at the page's usual gap. On a narrow dialog Reset all wraps to its own line, right-aligned. Verified with container screenshots at 1440px and 640px; fmt, clippy, the |
…h the search icon
|
Follow-up pushed: the Settings navigation rows padded 18px on the left and 10px on the right; they now pad 11px on both sides, which also puts each row's icon centre on the search field's icon centre (measured at x=60 for both in the container's widget tree). CSS only. |
…tions-chord Resolve the conflicts with remappable shortcuts (#1885) by making the folder actions step a command, "actions.folder" step(Actions) on ".", so it can be rebound, the conflict checker sees it, and Settings lists it as "Actions for the focused folder" in the 10xer table. The digits after it and the "; .-" pill are built from Shown values and follow the user's keys for both ";" and ".". Lettered steps are read before it, and digits after, as an armed chord reads its steps first. Restore the Digits and Chord::options doc comments, and document the new step in the keymap, preferences and keyboard-shortcuts guides. It has no path in the default map, where there is no panel to switch.
Description
Adds remappable keyboard shortcuts, with separate tables for the default map and the 10xer map. Each commit is one stage:
Commandwith defaults for each map. Handlers, labels and the F1 reference resolve through it, and the per-map duplicate constants are merged. Shipped behavior is unchanged.settings.tomlunder[keymap.default]and[keymap.tenxer], holding only the changes from the shipped keys. An empty list unbinds a command. Unknown ids and unreadable entries are kept as written. Matching, labels, hints, tooltips, accessible labels, context-menu accelerators, the footer and F1 all update live.src/ui/keys/conflicts.rs). It reports duplicates, shadowed chord groups, keys that never fire, keys reserved by GTK, fixed keys and input-method keys, plus context overlaps. Hand-edited entries are audited once at load and logged. Guard tests press keys through the real dispatchers, so the checker can't silently drift from them.;digits; an empty, disabled or non-matching slot runs nothing and says so. 10xer keeps its;digits and doesn't list the slots.tests/qa/scenarios/keymap/(the QA runner'sprefsnow writes nested tables), a new user guidedocs/keymap.md, and updateddocs/keyboard-shortcuts.md,docs/preferences.md,docs/10xer-mode.mdanddocs/custom-actions.md.mainis merged in. Its new Reopen the last closed tab key (Ctrl+Shift+T) is registered as a remappable command, and its new accessible labels on shortcut buttons follow rebinds.Also fixed along the way:
Deviations from the plan
StepEqualsTriggerrule was dropped: shippedg g,c candt tare valid steps on their own trigger key.mainreplaced the E2E suite.Known limitations, not fixed here
<Control>ampersandwhen Ctrl+1 is free.Bugs that predate this branch (they reproduce on
mainwith the shipped keys; not fixed here):pafter clicking a folder pins nothing.ycopies nothing while filter results are showing.Visual evidence
N/A. Agents can't upload attachments. The change adds a Settings → Keyboard page titled KEYBINDS, with a search field, a Default/10xer switch, and a row per command showing key chips, Add, Reset and short notes; custom action slot rows show the action's name underneath.
How to test
renamein Search keybinds.settings.toml, add[keymap.default]withtoggle_hidden_files = ["F7"], then relaunch and press F7.Expected result:
Related issue
Closes #1884