Skip to content
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

refactor: replace recipes with commands #386

Merged
merged 59 commits into from
Aug 3, 2023
Merged

Conversation

abeatrix
Copy link
Contributor

@abeatrix abeatrix commented Jul 26, 2023

The main goal of this PR is to deprecate recipes and migrates the popular recipes into commands, a new alternative to recipes.

See Test Plan on how to enable it for testing.

Note: The Custom Commands feature is still in the exploring stage and has not been finalized. Use at your own risk.

This PR includes:

  • 3 new default commands created with a JSON file:
    • Document Code
    • Explain Code
    • Generate Unit Tests
  • Added e2e test for Custom Commands
  • renamed the my-cody directory to custom-prompts
  • rename custom recipes to custom commands
  • refactored custom recipes files and removed unused methods to custom commands
  • renamed and clean up methods for custom commands
  • remove redundant debug output from LocalAppDetector
  • new command menu in command palette, with item to start inline chat
  • image
  • command menu can be invoked from icon in doc context menu, or shortcut cmd + shift + v
  • image
  • new custom commands config menu for managing custom commands config files
  • image
  • added code lenses for Cody that trigger the new command menu in text files
  • image
  • New slash commands panel invokable from chat box:
  • image
  • Moved cody items up in context menu
  • image
  • New cleaner UI with Recipes tab removed
  • image

Test plan

added e2e test for custom commands and updated current tests to work with new default commands

@abeatrix abeatrix marked this pull request as ready for review July 26, 2023 22:33
@abeatrix abeatrix requested a review from a team July 26, 2023 22:34
@abeatrix abeatrix changed the title wip: refactor custom recipes + clean ups custom recipes: refactor custom recipes + clean ups Jul 26, 2023
Copy link
Contributor

@toolmantim toolmantim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't have a chance to run it locally, but reviewed as much of the UI copy as I could

vscode/src/editor/EditorCodeLenses.ts Outdated Show resolved Hide resolved
@@ -2,6 +2,8 @@ import { VSCodeButton } from '@vscode/webview-ui-toolkit/react'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to suggest some cleanups to this based on the changes I had in #374, but it's all going to get rm'd and switched to a quickpick yeah?

vscode/src/custom-recipes/CustomRecipesMenus.ts Outdated Show resolved Hide resolved
vscode/src/custom-recipes/helper.ts Outdated Show resolved Hide resolved
vscode/src/custom-recipes/MyPromptController.ts Outdated Show resolved Hide resolved
vscode/src/custom-recipes/CustomRecipesMenus.ts Outdated Show resolved Hide resolved
vscode/src/custom-recipes/CustomRecipesMenus.ts Outdated Show resolved Hide resolved
vscode/src/editor/EditorCodeLenses.ts Outdated Show resolved Hide resolved
vscode/src/editor/EditorCodeLenses.ts Outdated Show resolved Hide resolved
vscode/test/e2e/custom-recipes.test.ts Outdated Show resolved Hide resolved
@abeatrix abeatrix changed the title custom recipes: refactor custom recipes + clean ups custom recipes: refactor recipes + clean ups Aug 1, 2023
@abeatrix abeatrix changed the title custom recipes: refactor recipes + clean ups WIP refactor: recipes > commands Aug 1, 2023
@abeatrix
Copy link
Contributor Author

abeatrix commented Aug 1, 2023

@toolmantim i just pushed some updates so that you won't need to set the feature flag to get those to work. I've also finished with the clean up and updated the PR so it's good to test! Happy to sync up later if you want.

@abeatrix abeatrix changed the title WIP refactor: recipes > commands refactor: replace recipes with commands Aug 2, 2023
@toolmantim
Copy link
Contributor

It took a lot of fighting, but I got it looking pretty good across all themes, including high contrast! I also added a proper focus outline to the input too.

command.picker.mov

A few outstanding things I couldn't fix @beatrix:

  1. The items are still in reverse alphabetical order (Z-A) but should be A-Z
  2. I feel like escape should clear the input, making it feel as fast as the standard quickpick. It's a bit odd for a textarea but I think it makes more sense.
  3. The command chooser should disappear when the input loses focus (and reappear when it does, if the input has a slash command in it). A few times I've accidentally deleted code in the editor mis-understanding the focus/cursor.

@abeatrix abeatrix merged commit 7eaacad into main Aug 3, 2023
8 checks passed
@abeatrix abeatrix deleted the bee/custom-recipes-refactor branch August 3, 2023 04:32
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.

3 participants