opencode icon indicating copy to clipboard operation
opencode copied to clipboard

feat: add keybindings reference dialog to TUI

Open frankdierolf opened this issue 2 months ago • 7 comments

Problem

When using the TUI, there's no easy way to discover what keybindings are available. Users have to check documentation or dig through config files to find out what shortcuts they can use.

Solution

Added a searchable keybindings dialog accessible via <leader>? that displays all 88 keybindings with their descriptions.

What Changed

  • Created dialog-keybindings.tsx using the existing DialogSelect component
  • Added keybindings_list config option (default: <leader>? = ctrl+x + ?)
  • Registered in command palette under "System" category
  • Descriptions dynamically extracted from config schema using zodToJsonSchema

How to Use

Via Keybinding: Press ctrl+x then ?
Via Command Palette: Press ctrl+p, type "keybindings"

Implementation

Follows existing patterns:

  • Reuses DialogSelect component (same as model/theme lists)
  • Fetches keybindings from useKeybind() hook
  • Alphabetically sorted and searchable by default
  • Descriptions stay in sync with schema automatically (single source of truth)

Fixes #3886

frankdierolf avatar Nov 04 '25 11:11 frankdierolf

Hola,

Please take some seconds to review. Thats a feautre which tangles the UX space as, thats why^^

  • I throwed in under "System" which seemed reasonable to me:
  • And I made the decision for <leader> + ?
  • And I ordered the overview alphabetically.
  • Only READ
  • Didn't test how it will behave with custom keybindings. Should be fine, but don't know.
image image

Best regrads,

Frank :v:

frankdierolf avatar Nov 04 '25 11:11 frankdierolf

Updated to latest dev branch

frankdierolf avatar Nov 10 '25 11:11 frankdierolf