Repository navigation
Conversation
Tiny Code Reviewthe AI provider rate-limited the request This is advice, not a gate. Re-run with the |
unRekable
left a comment
There was a problem hiding this comment.
Code Review
🟡 1 finding (0 blocking).
The PR moves every hard-coded chord into one keymap catalog, lets Settings rebind rows with conflict and typing checks persisted to a small overrides file, and turns > in the quick switcher into a command palette; palette commands run through chatd via the existing background ask pattern, so no process boundary or wire field is touched. The rebind path validates parse, conflicts and defaults, and re-registers every binding site through rebind_keys. It fails on one point: rebinding never re-sets the menu bar, so on macOS the old chord stays baked into the NSMenuItem — the menu keeps showing the old key and the OS keeps firing the action on it, which also means a key the keymap now considers free is still taken until some rename happens to trigger refresh_menus.
Residual risk
- In command_hits, only the first row of the result carries a section header, and it is hard-coded to "Commands" — with a bare
>the first row is a "Go to …" place row, so it is headed "Commands". - Keymap::save ignores write failures (
let _ = std::fs::write), so a rebind can look applied in Settings and be gone after a restart with no hint. - message_shortcut passes Focus::Message unconditionally and shortcut_message targets the hovered row or the last non-system message; with the message list focused but no row hovered, Shift+Delete at-once deletes the user's own latest message (the same at-once path as today's Shift-click, but reachable without pointing at a row).
|
|
||
| /// Drops every chord and binds the stock map plus whatever Settings saved. | ||
| pub(crate) fn rebind_keys(cx: &mut App) { | ||
| cx.clear_key_bindings(); |
There was a problem hiding this comment.
d4d320a to
3cefa6e
Compare
What changed and why
Settings › Shortcuts can change a key. Click a row, press the new keys, and Reset puts the defaults back. A key another command already uses is refused. The quick switcher lists commands after
>: menu actions, set status, pause notifications, toggle mute, sign in, and open a settings section. With a message row focused, E, R, +, T and Delete run the action when that message allows it.P and U are listed and resolve the message. They do not call out: pinning and mark-unread-from-here have no request. Up on an empty composer is the edit-last binding. The composer does not read it yet, because that file is owned by other pull requests. Undo, Redo, Cut, Copy, Paste and Select All stay the platform's own keys.
Type
Platforms
Proof
Scenario: e2e/scenarios/command-palette
Lab run: not posted yet. The driver sets TINYCLIENT_PROVE=command-palette and exits 0 only when rebinding Quick Switcher moves the chord and the menu label. A build without that arm opens the window and the driver fails.
Locally:
cargo test -p tinyclient --features gui --bins(the keymap tests and the caption test passed; one Windows named-pipe test failed because the primary pipe was already taken, and that file is not in this diff).cargo clippy -p tinyclient --features gui --all-targets.Not tested: clicking a row in the Settings window, the
>list on screen, or a message key in a live conversation.Compatibility
No protocol change. Set status and pause notifications use the requests the app already sends.
Risk and rollback
A saved chord replaces the default until Reset, or until the keymap file is removed. Revert this change to go back to the fixed table.
Release note
Shortcuts can be changed in Settings, and the quick switcher runs commands after >.