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

PRD: bug: Visible keyboard shortcuts for core chat and editing flows #2009

Closed
3 of 4 tasks
Tracked by #2599
toolmantim opened this issue Nov 30, 2023 · 8 comments
Closed
3 of 4 tasks
Tracked by #2599
Assignees
Labels

Comments

@toolmantim
Copy link
Contributor

toolmantim commented Nov 30, 2023

Designs

Description:

As a user I want to be able to use keyboard shortcuts to perform key actions. To do this the keyboard shortcuts need to be supported and to be visible.

The core actions we want to support are:

  • Returning to a chat when editing code (i.e. refocusing the message input of the most recently active visible chat)
  • Starting a new chat
  • Starting a code edit
  • Accepting, retrying and undoing a code edit

Objectives:

  • Allow the user to perform key actions without using the mouse
  • Allow the user to build expertise and speed

Acceptance Criteria:

Must have:

  • Keyboard shortcuts should be visible on the command treeview, code lenses, and chat message inputs
  • Platform specific keys are displayed (following how VS Code displays them across platforms)

Nice to have:

  • Modifying or removing keybindings should be reflected in the UI (would require reading the users’s keybindings.json file)

Design Tasks:

Design Tasks

Engineering Tasks:

Engineering Tasks

Related Docs:

How VS Code ouputs the modifier characters per-platform:

Mac Windows
Screenshot 2023-11-30 at 11 07 32 pm Screenshot 2023-11-30 at 11 06 45 pm

Design (see Figma) for latest and comments:

image

@taylorsperry
Copy link
Contributor

taylorsperry commented Nov 30, 2023

I love this, thank you, @toolmantim! I'm marking as P0 for now since I think this would be amazing to ship for GA (and I expect it's not too, too heavy a lift?), but we should bump to P1 if we get bug reports that are more important to fix. cc @kalanchan

@taylorsperry taylorsperry added prd-p0 bug Something isn't working labels Nov 30, 2023
@taylorsperry taylorsperry changed the title PRD: Visible keyboard shortcuts for core chat and editing flows PRD: bug: Visible keyboard shortcuts for core chat and editing flows Dec 6, 2023
@toolmantim
Copy link
Contributor Author

This was partially improved in the new welcome message content and styles in #2298, but we should still do this.

@toolmantim toolmantim removed their assignment Dec 13, 2023
@taylorsperry
Copy link
Contributor

@kalanchan I'd love to see this get prioritized in the next eng sprint. What's the best way for me to get it on the board?

@kalanchan
Copy link
Contributor

we'll do a grooming session with Beyang to get this on the board!

@umpox umpox self-assigned this Jan 4, 2024
@toolmantim
Copy link
Contributor Author

I've updated the above description with clearer Figma links, and designs for ghost text Edit discoverability too @umpox @beyang

@toolmantim
Copy link
Contributor Author

I think we should simplify our keyboard shortcuts too… aim for something as simple as Command-K and Command-L

umpox added a commit that referenced this issue Jan 16, 2024
## Description

Part of #2009

Keyboard functionality will be added in a follow up PR

<img width="492" alt="image"
src="https://github.com/sourcegraph/cody/assets/9516420/e729a511-53df-4fad-bf3f-8c0dbd5db41b">


## Test plan

1. Create an edit
2. Observe the code lens on complete

<!-- Required. See
https://sourcegraph.com/docs/dev/background-information/testing_principles.
-->
umpox added a commit that referenced this issue Jan 17, 2024
## Description


![image](https://github.com/sourcegraph/cody/assets/9516420/69fe8b2f-8885-4880-a33f-2ea0fe2f1a22)

This PR:
- Adds ghost decoration text for Edit and Chat commands
- Only shows when a user has made a selection that spans multiple lines
or covers all non-whitespace chars for a single line.
  - Debounced to avoid spamming
- Adds the Cmd+K shortcut for Edit, Cmd+L shortcut for chat
- Adds the `onLanguage` activation event to Cody.
- Runs before `onStartupFinished` but **not** as part of VS Code
startup. Helps ensure our decorator is registered first, as VS Code
ranks decorators in the UI depending on the order they are registered.
- Will only run if a file is open, so not bullet-proof but should be
activated most of the time.

Still TODO (implementing in a follow up PR):
- "Add to Chat" functionality from
[designs](https://www.figma.com/file/jEsnzgsf0hNuJbqB9pKaGm/VS-Code---Cody---Commands-up-front-and-ChatGPT%2B%2B?type=design&node-id=1161-33280&mode=design&t=9bkXawd1ct5ANDeV-0)
- Logic to fetch user overridden keyboard shortcuts and update labels
accordingly
- Do we want to show "Cmd+K to Generate" when the cursor is on an empty
line?

Part of issue: #2009

## Test plan

1. Enable the ghost hints `cody.internal.unstable`
2. Make a selection, check ghost text
3. Make no selection, check no ghost text
4. Select part of a single line, check no ghost text
5. Check ghost text disappears when edit quick pick shows

<!-- Required. See
https://sourcegraph.com/docs/dev/background-information/testing_principles.
-->
@beyang
Copy link
Member

beyang commented Feb 14, 2024

Closeable?

@beyang
Copy link
Member

beyang commented Mar 5, 2024

Closing, please reopen if still an issue

@beyang beyang closed this as completed Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants