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

add walkthrough for commands, update commands menu #648

Merged
merged 4 commits into from
Aug 10, 2023
Merged

Conversation

abeatrix
Copy link
Contributor

@abeatrix abeatrix commented Aug 10, 2023

feat: add walkthrough for cody commands and update commands menu

  • Add new walkthrough for Cody Commands.
  • Update welcome message suggested by chris here before we have the new design added Improve first time user experience for the command changes #633 (comment)
  • Update shortcut for Cody Commands Menu to alt + c due to conflict.
  • Update description for "Explain Code" command.
  • Update the title for Commands Menu to just "Commands".
  • Update telemetry to log command as recipe on right clicks before we have implemented the correct logs for commands

(Most of the changes are moved from #602)

Test plan

UI change to communicate UI change in last patch:

image

@abeatrix abeatrix requested a review from a team August 10, 2023 15:08
vscode/CHANGELOG.md Outdated Show resolved Hide resolved
@abeatrix abeatrix merged commit 7bdce68 into main Aug 10, 2023
9 checks passed
@abeatrix abeatrix deleted the bee/commands-key branch August 10, 2023 15:50
abeatrix added a commit that referenced this pull request Aug 11, 2023
RE feedback from beyang:

- Could we add tab-to-complete behavior, so if the user has typed in a
partial match for the command name (e.g., “/expla”) and then hits Tab,
we complete the command name (in this case “/explain”)?
- I noticed nothing happens if I execute /explain without anything
selected. It seems intuitive to me to use the currently open file as
context in this case.
- I think it makes sense to display any errors (like you need to have
something selected) as a response in the chat, rather than as a separate
error pop-up

This PR includes the following change:
1. for the default `/explain` & `/smell` command, run on visible content
when there is no selection in the current text document
1. Display error message from commands in chat as an error message from
the assistant when selection is required for a command (e.g. /doc and
/test) but currently missing:
1. log basic telemetryService for commands
1. also cleaned up the custom-prompt recipe that all commands depend on.
1. show error for invalid commands:
<img width="515" alt="image"
src="https://github.com/sourcegraph/cody/assets/68532117/85e86e59-916c-465e-9fd0-3ce4098e8dc3">
1. add `/smell`, command for code smell as the default command
1. display the file name and selection range when available
<img width="1363" alt="image"
src="https://github.com/sourcegraph/cody/assets/68532117/0d643db7-0499-4c9f-bef7-dec963c8f5c2">

#### Some UI changes were moved to separate PRs

See moved to #606 &
#648
- add tab-to-complete +  enter-to-complete behavior in the command list
- update the walkthrough to replace recipes with commands and add a new
commands section:
- add short instructions on how to use commands with the new menu. The
link also works as a button to open the command menu:
- update shortcut for commands menu to `alt+c` as it was using the same
key as `cody.fixup.new`

## Test plan

<!-- Required. See
https://docs.sourcegraph.com/dev/background-information/testing_principles.
-->

See the complete demo:



https://github.com/sourcegraph/cody/assets/68532117/64f18b91-1fa4-4bfa-ae8a-acbce6360a39

1. start cody from this branch
2. run `/doc` without code selection - error expected
3. run non-exisit command:`/exit` - error expected
4. run `/explain` and `smell` without code selection - both show work
with visible content
5. clicking on the `Cody Menu`button in the cody intro should open the
command menu for you
7. shortcut `alt+c` should bring up the command menu
8. run commands from the right-click menu, everything should work
accordingly

---------

Co-authored-by: Beyang Liu <beyang@sourcegraph.com>
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.

None yet

2 participants