Skip to content

Conversation

@frankdierolf
Copy link
Contributor

@frankdierolf frankdierolf commented Nov 4, 2025

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
Copy link
Contributor Author

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 ✌️

@frankdierolf
Copy link
Contributor Author

Updated to latest dev branch

@frankdierolf
Copy link
Contributor Author

@agentic-ai-forge Thanks for mentioning, forgot about that PR. Let me work that out.

@frankdierolf frankdierolf force-pushed the feat/keybindings-dialog branch from 9a40c91 to eb74d64 Compare January 3, 2026 13:59
@frankdierolf
Copy link
Contributor Author

Updated to latest dev + fixed some stuff:

  • Rebased clean (no merge mess)
  • Added all 89 keybindings now (was missing like 40)
  • Fixed patterns: added useDialog hook, onSelect handler, memoized options
  • Dialog now closeable with Escape/Enter

btw, I don't really understand why these 3 tests fail (patch/revert/diff with worktrees) - seems like a CI thing? Our changes only touch dialog-keybindings.tsx and auto-generated types. @thdxr you've been working on the snapshot/worktree stuff lately, maybe you can take a quick look and explain what's wrong? ^^

Ready for another look ✌️

@frankdierolf frankdierolf force-pushed the feat/keybindings-dialog branch from eb74d64 to 4c9ce6d Compare January 4, 2026 06:57
@frankdierolf
Copy link
Contributor Author

frankdierolf commented Jan 4, 2026

Hola,

First of all:
Tests are passing now after rebasing onto latest dev.

The failures were because the branch was missing recent worktree infrastructure commits (0b4af95 and 5944443 from yesterday). The snapshot tests need those to properly handle worktree contexts. Rebased cleanly since this PR only touches UI components - no conflicts.

Second,
if that keybinding help feature is desired it looks good to me, i just followed the already given patterns in the codebase, Technically not much concering at least to my eyes^^

Said that, the question remains, it involves UX. Currently the command pallete already shows shortcuts so that could be seens as a duplicate. Depends on the taste of the opencode community. Personally, I still have to look up shortcuts ^-^

Thanks for the great work, its a joy to see the project grow in that fast pacing space 😁

Happy new year everyone and best regards,
Frank ✌️

*Edit: Rushed thruh my head, the keybindings are currently static, thats maybe not optimal.

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

Features:
- Accessible via ctrl+x then ? or command palette
- Shows all keybindings in alphabetical order
- Searchable and filterable using DialogSelect
- Descriptions dynamically extracted from config schema

Implementation:
- Created dialog-keybindings.tsx component
- Added keybindings_list config option (default: <leader>?)
- Registered in command palette under "System" category
- Uses zodToJsonSchema to extract descriptions at runtime

This ensures descriptions stay in sync with schema definitions
automatically - single source of truth, zero maintenance.

Fixes anomalyco#3886
@frankdierolf frankdierolf force-pushed the feat/keybindings-dialog branch from 4c9ce6d to 45fdcf4 Compare January 4, 2026 07:33
@frankdierolf
Copy link
Contributor Author

Fixed the static descriptions issue from my edit above ^^

Now using zodToJsonSchema to dynamically extract descriptions from the config schema - same pattern we use in server.ts. This way descriptions stay in sync automatically, single source of truth.

Also squashed everything into one clean commit and rebased onto latest dev for nice history.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing keybindings reference in TUI

1 participant