microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
160.28k stars 28.09k forks source link

Why does Copilot preview of suggested tests uses two different UIs? #204372

Open delphinemlcarlson opened 5 months ago

delphinemlcarlson commented 5 months ago

Steps to Reproduce:

First UI

  1. In a file code.ts, open the inline chat and call /tests. Screenshot 2024-02-05 at 15 37 26

  2. After the test is generated, a preview of the new file is shown under the inline chat. Screenshot 2024-02-05 at 15 37 39

  3. When I hit the "Create" button, it will create a new test file code.test.ts for my file with the suggested test. Screenshot 2024-02-05 at 15 40 42

Second UI

  1. In a file code.ts, open the inline chat and call /tests. Note that a code.test.ts exists already. Screenshot 2024-02-05 at 15 42 57

  2. After the test is generated, a preview of the suggested test is shown in a Refactor Preview panel and I can Accept or Discard (buttons hard to see in screenshot, they are at the bottom left)

    Screenshot 2024-02-05 at 15 43 53

Questions

It looks like the inline chat UI is used for creating a new file with suggested tests and the refactor preview UI is used for adding suggested tests to an existing test file.

Some thoughts about why using one over the other:

delphinemlcarlson commented 5 months ago

@hbons this is the Github issue related to our questions. Could you please also forward this issue to relevant team mates who may have the answers?

hbons commented 5 months ago

@jrieken do you know more about this?

jrieken commented 5 months ago

There is two cases

  1. AI wants to create new file -> we show a preview of that with peek view
  2. AI wants to edit a file that isn't the current file -> we use the workspace/refactor preview UI for that

the 2nd case isn't very nice and need some polish