-
-
Notifications
You must be signed in to change notification settings - Fork 2
#1 - Implement Cody Custom Management #3
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Update the `cody.chat.preInstruction` setting to provide more detailed information about the Cody++ extension - Enable the `cody.experimental.commitMessage` setting to generate AI-assisted commit messages
…mmands` directory
- Introduce a `CustomCommandService` to manage custom commands - Add support for loading, saving, adding, modifying, and removing custom commands - Integrate the custom commands feature into the Cody++ extension's UI - Leverage the `zod` library for schema validation of custom command data
- Add a new constant `CODY_CUSTOM_COMMANDS_FILE` to store the filename for custom Cody commands
- Introduce the `CustomCommandsTreeView` class to display a tree view of the user's custom commands - Leverage the `CustomCommandService` to fetch and manage the custom commands - Render each custom command as a tree item with the command ID and description - Implement the `getTreeItem` and `getChildren` methods to populate the tree view - Add a `refresh` method to trigger updates to the tree view when the custom commands change
- Add a new command `cody-plus-plus.addCustomCommand` to allow users to add new custom commands - Implement the command handler to open a UI for configuring the new custom command - Register the new command in the package.json file and add it to the "Cody++" command category - Add a new menu item in the "view/title" section to display the "Add New" command in the Custom Commands view - Introduce the `CustomCommandsTreeView` class to display the user's custom commands in a tree view - Register the `CustomCommandsTreeView` as a tree data provider for the "customCommands" view
- Add a new task "tasks: watch-webviews" to the .vscode/tasks.json file - The new task runs the "watch:webviews" script from the package.json file, which watches the src/webviews directory and rebuilds the webviews on changes - This allows developers to more easily work on and test the webview components of the extension
- Update tsconfig.json to exclude the "src/webviews" directory from the TypeScript compilation - Update .vscode/settings.json to include the "out" folder in the search exclude list
- Add a new file `src/constants/webview.ts` with a constant `DEV_WEBVIEW_URL` set to `'http://localhost:5173'` - Add a new file `src/utils/index.ts` with a `getNonce()` function that generates a random string of 32 characters
- Add a new file `src/commands/addCustomCommand.ts` with a function to open the custom command webview - Update `src/extension.ts` to register the `cody-plus-plus.addCustomCommand` command and call the `addCustomCommand` function - Add a new file `src/views/CustomCommandsWebview.ts` to implement the custom command webview, including logic to create and show the webview panel
- Add the `eslint-plugin-prettier` and `eslint-config-prettier` packages to the project - Update the `.eslintrc.cjs` file to include the `prettier` plugin and the `@typescript-eslint/no-explicit-any` rule - Add a `.prettierrc` file with the project's Prettier configuration
- Add `CustomCommandId` and `CreateCommandSchema` types to `customCommand.service.ts` - Update `CustomCommandsSchema` to use `CustomCommandId` type - Update `CustomCommandsTreeView` to use `CustomCommandsSchema` type for `commands` property
- Add a new form in the `App.tsx` component to allow users to create a new custom command - Implement the `handleSubmit` function to collect the form data and send a message to the extension via the `vscodeApi` module - Add the `vscodeApi` module to provide a wrapper around the VS Code API for sending messages and managing state - Update the `index.css` file to style the new custom command creation form
- Add `_handleMessage` method to handle incoming messages from the webview - Implement `_createCommand` method to handle the `CREATE_COMMAND` message, parse the command data, and add the command using the `CustomCommandService` - Update the webview HTML to include the `nonce` and `vscodeApi` setup - Add error handling to the `_createCommand` method to display errors to the user
- Add a new COMMANDS object with a CREATE_COMMAND property to the webview.ts file
- Add `codyPlusPlus.editCommand` and `codyPlusPlus.deleteCommand` commands to the `package.json` file - Implement the `editCommandDisposable` and `deleteCommandDisposable` in the `extension.ts` file to handle the edit and delete functionality - Update the `CustomCommandsTreeView` to set the `contextValue` property for each tree item to `'customCommand'`, enabling the context menu items - Add the new disposables to the `context.subscriptions.push` call in the `activate` function
- Add `codyPlusPlus.editCommand` and `codyPlusPlus.deleteCommand` commands to the `package.json` file - Implement the `editCommandDisposable` and `deleteCommandDisposable` in the `extension.ts` file to handle the edit and delete functionality - Update the `CustomCommandsTreeView` to set the `contextValue` property for each tree item to `'customCommand'`, enabling the context menu items - Add the new disposables to the `context.subscriptions.push` call in the `activate` function
…om command" - Update the header text in the App.tsx file to be more specific about creating a new Cody custom command - Add new CSS styles for the select element in the index.css file to match the styling of other form elements
- Add `codyPlusPlus.editCommand` and `codyPlusPlus.deleteCommand` commands to the `package.json` file - Implement the `editCommandDisposable` and `deleteCommandDisposable` in the `extension.ts` file to handle the edit and delete functionality - Update the `CustomCommandsTreeView` to set the `contextValue` property for each tree item to `'customCommand'`, enabling the context menu items - Add the new disposables to the `context.subscriptions.push` call in the `activate` function
- Add `codyPlusPlus.editCommand` and `codyPlusPlus.deleteCommand` commands to the `package.json` file - Implement the `editCommandDisposable` and `deleteCommandDisposable` in the `extension.ts` file to handle the edit and delete functionality - Update the `CustomCommandsTreeView` to set the `contextValue` property for each tree item to `'customCommand'`, enabling the context menu items - Add the new disposables to the `context.subscriptions.push` call in the `activate` function
- Add `retainContextWhenHidden`, `enableFindWidget`, and `enableCommandUris` options to the webview configuration - Set the webview panel icon to a custom icon - Reorganize the context section in the UI, moving the "Codebase" option to the bottom and adding a warning about its experimental nature
- Remove the `vscode:prepublish` script as it is redundant with the `package` script - Simplify the `vscode:package` script to directly call the `package` script and the `vsce package` command - Update the `build:webviews` script to first remove the `dist/webviews` directory before rebuilding the webviews assets
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What happened 👀
This PR aims to create a better UI for writing prompts with Cody's configuration properties (mode, context, etc). The main changes include:
Insight 📝
The rationale behind these changes is to provide a more user-friendly interface for managing custom commands within the Cody++ extension. By allowing users to add, edit, and remove commands directly from the UI, we enhance the usability and flexibility of the extension.
The improved webview configuration and UI options ensure a smoother and more intuitive user experience.
Proof Of Work 📹
Add a command
add-a-comand.-.01.mp4
Edit a command
edit-a-command.-.01.mp4
Remove a command
remove-a-command.-.01.mp4