Skip to content

Customizable keyboard shortcuts via settings page #43

Description

@setkyar

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:

  1. See all current shortcut bindings in a readable table/list grouped by category (General, Navigation, Chat Composer, Entry Toggles).
  2. Click a shortcut to enter "rebind" mode — press the desired key combination, and it re-maps.
  3. A "Reset to defaults" button per category and globally.
  4. Shortcuts are persisted as server-backed settings (like other settings), so they survive restarts and work across browsers.
  5. 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

  • I understand the maintainer triages requests and will invite a PR only if this moves forward.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions