-
Notifications
You must be signed in to change notification settings - Fork 3.6k
feat(tui): make dialog keybinds configurable #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
base: dev
Are you sure you want to change the base?
feat(tui): make dialog keybinds configurable #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
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 sst#6143
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 |
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" } }