Problem / motivation
All keyboard shortcuts in pi-web are currently hardcoded and cannot be changed by users. Different users have different muscle memory — vim-style j/k, emacs-style C-n/C-p, arrow keys, etc. Power users also want to remap shortcuts like ⌘B (toggle sidebar) or ⌘⇧N (scratchpad) to their own preferences.
Proposed solution
Add a "Keyboard Shortcuts" section to the Settings page (/settings) where users can:
- See all current shortcut bindings in a readable table/list grouped by category (General, Navigation, Chat Composer, Entry Toggles).
- Click a shortcut to enter "rebind" mode — press the desired key combination, and it re-maps.
- A "Reset to defaults" button per category and globally.
- Shortcuts are persisted as server-backed settings (like other settings), so they survive restarts and work across browsers.
- Conflict detection: warn the user if they try to map two actions to the same key combination.
Scope / affected code:
- Frontend:
web/src/shared/keyboard-nav.js — make all keybindings configurable via a central registry instead of inline addEventListener with hardcoded keys.
- Frontend:
web/src/settings/settings.js + settings.html — new section for shortcut rebinding.
- Frontend:
web/src/session/live/shortcuts-modal.js — reflect custom bindings in the shortcuts help modal.
- Backend:
internal/server/settings.go — add new setting keys to settingDefaults.
PR requirements:
- E2E test (Playwright) covering shortcut rebinding and persistence.
- Screenshots of the settings page with the new shortcut section, and the shortcuts modal reflecting custom bindings.
Alternatives considered
No response
Acknowledgement
Problem / motivation
All keyboard shortcuts in pi-web are currently hardcoded and cannot be changed by users. Different users have different muscle memory — vim-style
j/k, emacs-styleC-n/C-p, arrow keys, etc. Power users also want to remap shortcuts like⌘B(toggle sidebar) or⌘⇧N(scratchpad) to their own preferences.Proposed solution
Add a "Keyboard Shortcuts" section to the Settings page (
/settings) where users can:Scope / affected code:
web/src/shared/keyboard-nav.js— make all keybindings configurable via a central registry instead of inlineaddEventListenerwith hardcoded keys.web/src/settings/settings.js+settings.html— new section for shortcut rebinding.web/src/session/live/shortcuts-modal.js— reflect custom bindings in the shortcuts help modal.internal/server/settings.go— add new setting keys tosettingDefaults.PR requirements:
Alternatives considered
No response
Acknowledgement