Skip to content

Commit

Permalink
enable model selection via keyboard shortcut and refactor ModelSelect…
Browse files Browse the repository at this point in the history
…Field

This commit introduces a keyboard shortcut (Cmd/Ctrl+M) to open the model selection dropdown in the webview.

The ModelSelectField component has been refactored to:

- Use a ref to directly control the popover's open/close state.
- Add an Escape key listener to close the dropdown.
- Remove the forwardRef and useImperativeHandle, simplifying the component's structure.
- Remove the openDropdownRef prop.
- Add a modelSelectorRef prop to allow parent components to control the dropdown.

These changes improve the user experience by providing a quick way to access the model selection and ensure the dropdown can be closed with the Escape key.
  • Loading branch information
abeatrix authored and julialeex committed Mar 4, 2025
1 parent 4b7d457 commit 5fd0c8f
Show file tree
Hide file tree
Showing 4 changed files with 284 additions and 313 deletions.
2 changes: 1 addition & 1 deletion vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@
},
{
"command": "cody.chat.new",
"key": "shift+alt+/",
"key": "cmd+n",
"when": "cody.activated && !editorTextFocus"
},
{
Expand Down
Loading

0 comments on commit 5fd0c8f

Please sign in to comment.