feat: add keybindings reference dialog to TUI
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. This makes it harder to learn and use the TUI efficiently.
Solution
I added a simple keybindings reference dialog that displays all available keybindings in one place. The approach was straightforward - the goal was to display keybindings, so I made them displayable. No overthinking, just a practical solution.
What Changed
New Component:
- Created
dialog-keybindings.tsxthat lists all keybindings with descriptions - Uses the existing
DialogSelectcomponent for consistency with other TUI dialogs (models, themes, sessions) - Automatically fetches all keybindings from the keybind context
- Shows them in a searchable/filterable alphabetical list
Configuration:
- Added
keybindings_listconfig option with default keybinding<leader>?(ctrl+x + ?) - Registered in the command palette as "Show keybindings"
Integration:
- Added import and registration in
app.tsx - Follows the same pattern as existing dialogs (model list, theme list, etc.)
How to Use
Via Keybinding:
- Press
ctrl+x(leader key), then?
Via Command Palette:
- Press
ctrl+p - Type "keybindings" or "Show keybindings"
- Hit enter
Implementation Notes
I followed the existing patterns in the codebase:
- Reused
DialogSelectcomponent (same as model/theme lists) - Used
useKeybind()hook to fetch all keybindings dynamically - Kept descriptions in sync with config schema
- Made it searchable by default (built into DialogSelect)
Simplicity first - just showing what's there, no extra features.
Fixes #3886
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.
Best regrads,
Frank :v:
Updated to latest dev branch