-
Notifications
You must be signed in to change notification settings - Fork 6.4k
feat(tui): make dialog keybinds configurable (#6143) #6144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(tui): make dialog keybinds configurable (#6143) #6144
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds configurable keybinds for dialog actions in the TUI, allowing users to customize keyboard shortcuts for operations like deleting sessions/stash entries, renaming sessions, toggling model favorites, and opening the provider list. The default for session_rename has also been changed from none to ctrl+r.
Key Changes:
- Added five new configurable keybind options:
session_delete,session_rename(default changed),stash_delete,model_provider_list, andmodel_favorite_toggle - Updated dialog components to use the configurable keybind system instead of hardcoded values
- Enhanced
Keybind.match()andKeybind.toString()utility functions to handle undefined values
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/sdk/openapi.json | Adds OpenAPI schema definitions for the five new keybind configuration options with their default values |
| packages/sdk/js/src/v2/gen/types.gen.ts | Generates TypeScript type definitions for the new keybind options in the SDK |
| packages/sdk/js/package.json | Formatting fix (adds trailing newline) |
| packages/plugin/package.json | Formatting fix (adds trailing newline) |
| packages/opencode/src/util/keybind.ts | Updates match() and toString() to accept Info | undefined for safer handling of missing keybinds |
| packages/opencode/src/config/config.ts | Adds Zod schema definitions for the new keybind options with default values |
| packages/opencode/src/cli/cmd/tui/component/dialog-stash.tsx | Replaces hardcoded ctrl+d with configurable stash_delete keybind |
| packages/opencode/src/cli/cmd/tui/component/dialog-session-list.tsx | Replaces hardcoded ctrl+d and ctrl+r with configurable session_delete and session_rename keybinds |
| packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx | Replaces hardcoded ctrl+a and ctrl+f with configurable model_provider_list and model_favorite_toggle keybinds |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/opencode/src/cli/cmd/tui/component/dialog-session-list.tsx
Outdated
Show resolved
Hide resolved
packages/opencode/src/cli/cmd/tui/component/dialog-session-list.tsx
Outdated
Show resolved
Hide resolved
c1300af to
8cdfc63
Compare
|
Updated to address Copilot review feedback:
This PR also closes #3262. |
|
Yep these should all be configurable, good catch |
|
/review |
|
lgtm |
7e9d871 to
8cdfc63
Compare
|
this should be good to merge, ill do so after xmas |
0e6bafd to
00f3532
Compare
|
Noted, thanks. Will continue rebasing on top of release tags as they're set to make it easier for ya. |
|
/review |
1c85b18 to
a03102e
Compare
hey Aiden, this still on track to merge soon? ;) |
4e2bc8e to
2d33364
Compare
da7b6cd to
d78efad
Compare
Add session_delete, stash_delete, model_provider_list, and model_favorite_toggle to keybind config. Also change session_rename default from 'none' to 'ctrl+r'. Closes anomalyco#6143
d78efad to
4ac0372
Compare
|
yeah lemme test when i get home you have a few prs but im struggling to keep up, consider joining our discord or dming me somewhere to get my attention on these! |
done and done :D |
Summary
session_renamedefault fromnonetoctrl+rCloses #6143
New Keybind Options
session_deletectrl+dsession_renamectrl+rstash_deletectrl+dmodel_provider_listctrl+amodel_favorite_togglectrl+fUsage
{ "keybinds": { "session_delete": "super+d", "session_rename": "super+r" } }Note: If another PR touching
packages/sdk/openapi.jsonmerges first, rebase and rerunbun ./script/generate.ts, then updatepackages/sdk/js/src/v2/gen/types.gen.ts.