continuedev / continue

⏩ Continue is the leading open-source AI code assistant. You can connect any models and any context to build custom autocomplete and chat experiences inside VS Code and JetBrains
https://docs.continue.dev/
Apache License 2.0
19.25k stars 1.66k forks source link

[VS Code] [Accessibility] Add shortcuts to jump between code suggestion in chat #1245

Open d-mahard opened 6 months ago

d-mahard commented 6 months ago

Validations

Problem

First of all, thanks for the great tool! I have tested many AI VScode clients and this is the best in terms of features and user experience (especially the sleek UI that integrates very well with the VSCode workbench).

I am trying to use keyboard as much as possible, including when using continue.dev. This is my typical workflow:

  1. writing a code in my editor
  2. ask continue.dev a question (usually using continue.focusContinueInput shortcut)
  3. at this point my cursor position will jump to the continuedev prompt field. I will then type my question
  4. I get the answer. I would want to scroll up and down to read the answer (using mouse)
  5. In many cases there are multiple code suggestions (see example below), I would want to choose one of them and then either copy the code or insert at cursor. (still using mouse)
  6. Sometimes I just want to copy just part of the suggested code (therefore, I cannot using the copy or insert-at-cursor button) - so I use my mouse to select the code I want and either press Ctrl+C or right click on the mouse to copy.

image

Solution

For step 4, 5, and 6 above, would be nice to have some shortcut commands.

For step 4: First of all, we need a way to move focus from the prompt field to the whole continue.dev view by using keyboard. From there I think up and down arrow or even PgUp and PgDown should work. I tried to get the focus manually to the view, and the arrows work fine. EDIT: there is a command for that: continue.continueGUIView.focus. Does not have a default shortcut but can be assigned. To go back to the prompt field: continue.focusContinueInputWithoutClear)

For step 5: We need two things:

For step 6: A step further after getting focus to the code box, we should have a cursor to select text and copy (so the code box should behave like a read-only text editor).

I am not sure if we can use monaco elements/classes, e.g. monaco editor for the code box , so that the styling will simply follow the one that is active in the workbench (eg. a focused element will have --vscode-focusBorder color). Would be great if that's possible.

sestinj commented 6 months ago

Love the alt+[ idea. I think this would be a great improvement

In order to focus the window rather than just the text box, you can use alt+ctrl+L (the command for toggling the Continue sidebar)

d-mahard commented 6 months ago

In order to focus the window rather than just the text box, you can use alt+ctrl+L (the command for toggling the Continue sidebar)

From what I see on my side, that would simply close the aux sidebar instead of focusing on it. But you gave me a clue, so I found that the command is continue.continueGUIView.focus which does not have a default shortcut but can be assigned. That will do for step 4, thanks!

And to go back to the prompt field is continue.focusContinueInputWithoutClear. That's nice.