feat: sidebar toggle shortcut + configurable keyboard shortcuts - #49
Open
YapWH1208 wants to merge 4 commits into
Open
feat: sidebar toggle shortcut + configurable keyboard shortcuts#49YapWH1208 wants to merge 4 commits into
YapWH1208 wants to merge 4 commits into
Conversation
YapWH1208
force-pushed
the
agent/sidebar-toggle-shortcut
branch
from
August 14, 2026 12:44
e34e4a4 to
04636fb
Compare
YapWH1208
force-pushed
the
agent/sidebar-toggle-shortcut
branch
from
August 14, 2026 12:52
04636fb to
4f9e829
Compare
YapWH1208
marked this pull request as ready for review
August 14, 2026 12:53
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
# Conflicts: # src/client/SideCardSection.tsx # src/client/prefs.ts # src/config.ts # src/prefs-shared.ts # tests/plugin-shape.spec.ts # tests/smoke.spec.ts # tests/unit.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a keyboard shortcut to open/close the sidebar, and makes all three of the plugin's keyboard shortcuts user-configurable.
Ctrl/Cmd+B(Mod+B) flips the right panel from anywhere in the GUI. The chord yields to IME composition, to any handler that already claimed the event (defaultPrevented), to auto-repeat, and to the sidebar terminal (whereCtrl+Bkeeps its shell meaning: control char / tmux prefix).SidebarPrefs.shortcuts(validated + canonicalized) and apply live (toggle listener, CodeMirror keymap compartment, GitView commit).Mod+B,Ctrl+Shift+Enter,Cmd+S, … —Mod=Cmdon macOS,Ctrlelsewhere; at least one modifier required; named keys (Enter, Space, Tab, Escape, arrows, F1–F12, …) supported.Why
The sidebar previously could only be toggled by clicking, and the plugin's hard-coded shortcuts were not discoverable/configurable. User request: "add shortcut to open/close the sidebar" plus configurability for all available shortcuts.
Design
docs/plans/2026-08-14-shortcuts-design.md(repo-convention design doc incl. deviation log, review round, acceptance and security records).Tests
tests/shortcuts.spec.ts(34 tests): chord parse/canonical/display/match + CodeMirror key mapping matrix; toggle listener (session gating, terminal/.xterm protection, defaultPrevented/IME/repeat yields, pref-driven chords, platform quirk, disposer).tests/unit.spec.ts:parsePrefsshortcuts-map validation/canonicalization + special-key hygiene.tests/side-card-section-rows.spec.tsx:ShortcutRowinteractive behavior (commit, invalid revert, Enter commit, failed-write remount).pnpm typecheck✓,pnpm build✓, vitest: 441 passed; the only failures (22) are pre-existingnode-ptyspawn failures insmoke/agent-ptyspecs, reproduced identically on cleanmain(sandbox cannot spawn shells).Review evidence
3b313a2(macOS Cmd+Shift quirk, commit-chord preventDefault, live commit placeholder, repeat/no-session handling, Mod+Ctrl/Cmd rejection, stale-merge fix, +regression tests).797552c(special-key hygiene + test, cached platform detection, browser-conflict hint copy).Risk / migration
shortcutsis an open map defaulting to{}(old settings documents resolve with defaults).Mod+Enter(Cmd+Enter on macOS; previously both Ctrl and Cmd+Enter worked there) — rebindable in settings.Ctrl+W); the settings copy warns; conflict detection is intentionally out of scope (documented in the design doc).Validation
typecheck ✓ · vitest 441 passed (22 pre-existing pty-spawn failures on clean main) · build ✓ · git diff --check ✓