From d1c8f69a03f7f096c563a661c1bbbdb9e066f816 Mon Sep 17 00:00:00 2001 From: astar76 Date: Thu, 19 Nov 2026 10:51:00 -0600 Subject: [PATCH] keymap: one dispatch path for shortcuts, editor page, new window, tab menu Commands with default chords, [shortcuts] overrides in settings.toml, conflict detection; Shortcuts settings page with capture, Replace/Cancel and resets. Ctrl+N opens a new window, tab right-click menu, closed-tab stack (10). Probe gains key and middle-button modes. Co-Authored-By: Claude Opus 5.5 --- CLAUDE.md | 4 +- crates/tunal/examples/xdnd_probe.rs | 95 ++- crates/tunal/src/config.rs | 84 +++ crates/tunal/src/keymap.rs | 602 ++++++++++++++++++ crates/tunal/src/lib.rs | 2 + crates/tunal/src/main.rs | 20 +- crates/tunal/src/settings.rs | 203 +++++- crates/tunal/src/shell/commands.rs | 339 ++++++++++ crates/tunal/src/shell/mod.rs | 183 +++++- crates/tunal/tests/keymap.rs | 193 ++++++ crates/tunal/ui/app.slint | 151 ++--- crates/tunal/ui/components/dialog.slint | 5 + crates/tunal/ui/dialogs/setting-rows.slint | 145 +++++ crates/tunal/ui/dialogs/settings.slint | 233 +++---- crates/tunal/ui/dialogs/shortcut-editor.slint | 236 +++++++ crates/tunal/ui/shell/tab-bar.slint | 10 + crates/tunal/ui/views/details-view.slint | 34 +- 17 files changed, 2257 insertions(+), 282 deletions(-) create mode 100644 crates/tunal/src/keymap.rs create mode 100644 crates/tunal/src/shell/commands.rs create mode 100644 crates/tunal/tests/keymap.rs create mode 100644 crates/tunal/ui/dialogs/setting-rows.slint create mode 100644 crates/tunal/ui/dialogs/shortcut-editor.slint diff --git a/CLAUDE.md b/CLAUDE.md index 94396df..df80dfc 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -89,9 +89,9 @@ Never modify: `PROMPT.md` (the user's brief), the user's other projects under `~ | `XDG_DATA_HOME=/data cargo run -p tunal-core --example ops -- ` (refuses unless XDG_DATA_HOME is inside ``) | job engine + trash smoke run: conflicts, cancel, trash/restore/empty | S007 | | `cargo run -p tunal -- --gallery --screenshot [--dark] --size 1200x1000` (`--gallery` alone opens it in a window) | every control in rest/hover/pressed/focused/disabled; press squeeze not drawn by the software renderer | S004 | | `cargo run -p tunal -- --gallery --page menu\|dialog --screenshot [--dark] --size 960x640` | open menu + submenu + two toasts, or dialog + indeterminate toast, over a stand-in folder | S005 | -| `TUNAL_SETTINGS=<0-5> cargo run -p tunal -- --screenshot --size 1000x700` (`XDG_CONFIG_HOME=`) | settings dialog page over a folder | S013 | +| `TUNAL_SETTINGS=<0-7> cargo run -p tunal -- --screenshot --size 1000x700` (`XDG_CONFIG_HOME=`) | settings dialog page over a folder (6 Mouse, 7 Shortcuts); add `TUNAL_KEYS=:` to record that chord on the Shortcuts page (a taken chord shows the conflict row) | S013 | | `TUNAL_DRAG=x1,y1,x2,y2[,hold] TUNAL_REDUCED_MOTION=1 cargo run -p tunal -- --screenshot --size 1200x760` (`XDG_CONFIG_HOME=`) | drags between window points and drops (drop menu) or holds (glow + drag image) before the frame | S014 | -| `Xvfb :97 &` then `env -u WAYLAND_DISPLAY DISPLAY=:97 target/debug/tunal &` and `DISPLAY=:97 target/debug/examples/xdnd_probe x1 y1 x2 y2` (or `in x y `) | X11 native DnD: fake XTEST drag out of the window onto a probe target, or a probe source dropping into the app; Xvfb only | S031 | +| `Xvfb :97 &` then `env -u WAYLAND_DISPLAY DISPLAY=:97 target/debug/tunal &` and `DISPLAY=:97 target/debug/examples/xdnd_probe x1 y1 x2 y2` (or `in x y `) | X11 native DnD: fake XTEST drag out of the window onto a probe target, or a probe source dropping into the app; Xvfb only. Also `xdnd_probe click x y [count] [gap_ms] [hover_ms] [button]` (2 = middle) and `xdnd_probe key ctrl+t f3 alt+2 …` (focuses the window under the pointer, then presses each chord); screenshot with `import -window root ` | S031 | | same, with `SLINT_BACKEND=winit-software` (so `DISPLAY=:97 import -window root ` captures it), then `DISPLAY=:97 target/debug/examples/xdnd_probe click x y [count] [gap_ms] [hover_ms]` | real clicks (XTEST) on a window point after resting `hover_ms` there, e.g. the split toggle with a tooltip showing; Xvfb only | split/tooltip fix | | `TUNAL_APPEARANCE=1 XDG_CONFIG_HOME= cargo run -p tunal -- --screenshot --size 1000x760` | folder appearance dialog for `` (theme icons looked up at once); `cargo run -p tunal-dirmeta --example roundtrip -- ` sets `Icon` in `/.directory` and prints the old values | S015 | | `TUNAL_PLAY=