|
| 1 | +# Tips and Tricks |
| 2 | + |
| 3 | +This document contains assorted tips and tricks for using Copilot Workspace effectively. |
| 4 | + |
| 5 | +## File Selection |
| 6 | + |
| 7 | +To determine how to address a task, Copilot Workspace must determine which files in a repo are relevant to the task. |
| 8 | +This is hard, and Copilot Workspace may not always select the right files. If that happens, you may see low-quality |
| 9 | +results. |
| 10 | + |
| 11 | +We're working hard to improve this, but in the meantime, you can help by reviewing and steering the file selection. |
| 12 | + |
| 13 | +To review the files that were selected, in the Specification panel, click the "View references" button: |
| 14 | + |
| 15 | +<img src="images/references.png" width=600 alt="Show references dialog"> |
| 16 | + |
| 17 | +To steer Copilot Workspace towards better file selection, you can mention file names, directory names, etc. in the issue/task panel. Just write it naturally, as if you were writing a normal issue. |
| 18 | + |
| 19 | +## The Issue/Task Panel |
| 20 | + |
| 21 | +The Issue/Task panel may be prepopulated with content depending on how you entered Copilot Workspace. For example, if you started from an Issue, the Issue panel will be prepopulated with the content of the issue. This content is ephemeral -- edits aren't synced back to the issue -- and so feel free to edit it to provide more context or to steer Copilot Workspace towards better results. |
| 22 | + |
| 23 | +## If at First You Don't Succeed... |
| 24 | + |
| 25 | +If you're not happy with the results you're getting, you can try regenerating the spec and/or plan. To do this, click the "Regenerate" button in the Spec or Plan panels: |
| 26 | + |
| 27 | +<img src="images/regen.png" width=600 alt="Regenerate button"> |
| 28 | + |
| 29 | +## Iterating on the Implementation |
| 30 | + |
| 31 | +Often Copilot Workspace will get a task *mostly right*, but may have trouble with some parts. In this case, you can reimplement specific files with new or additional instructions. After implementing and reviewing the code, you can select file(s) in the Plan panel and add bullet points, then click "Update selected files" to reimplement those file(s) with the new instructions that you've provided. |
| 32 | + |
| 33 | +<img src="images/file-iteration.png" width=600 alt="Update selected files flow"> |
| 34 | + |
| 35 | +## Sharing Copilot Workspace Sessions |
| 36 | + |
| 37 | +You can share your Copilot Workspace session with others by clicking the "Share" button in the top right corner of the screen. This will generate a link that you can share with others. These links can be shared with guests, even if they are not part of the Copilot Workspace preview. |
| 38 | + |
| 39 | +Shared sessions are copies of the original session. Non-guest users can use them a as a starting point to continue |
| 40 | +the task or explore alternative solutions without interfering with the original session. Guest users can view the session but cannot use the workspace to make changes. |
| 41 | + |
| 42 | +<img src="images/share-link.png" width=200 alt="Share button"> |
| 43 | + |
| 44 | +## Auto-Saved Sessions |
| 45 | + |
| 46 | +Your sessions are automatically saved, so you won't lose work if you close the browser or navigate away from the page. You can return to your session by going to [your Copilot Workspace dashboard](https://copilot-workspace.githubnext.com). |
| 47 | + |
| 48 | +## Separate Repos for Issues and Code |
| 49 | + |
| 50 | +<!-- TODO(eaftan): fill this in --> |
| 51 | + |
| 52 | +Some teams use separate repositories for issues and code. If you're working in a repository that's different from the one where the issue was filed, you can still use Copilot Workspace. TODO. |
| 53 | + |
| 54 | +## Conifgurating the Terminal for Your Repository |
| 55 | + |
| 56 | +We provide a built-in terminal so that you can validate the code changes that Copilot Workspace suggests. We use GitHub Codespaces to provide this terminal, and we use the `devcontainer.json` file in your repository to configure the container that powers the terminal. If you need to make changes to the default container to e.g. install necessary software, etc., you can do so by creating a `devcontainer.json` file in your repository. Learn more about Development Containers at https://containers.dev/. |
| 57 | + |
| 58 | +## Using the Terminal or Codespace to Edit Files |
| 59 | + |
| 60 | +Modified files are two-way-synced between Copilot Workspace and the terminal/codespace. Feel free to edit in either |
| 61 | +place, and your changes will be reflected in the other. |
| 62 | + |
| 63 | +## Undo/Redo |
| 64 | + |
| 65 | +Undo and redo are supported via the standard keyboard shortcuts: `Ctrl-Z` and `Ctrl-Y` on Windows and Linux, and `Cmd-Z` and `Cmd-Y` on macOS. |
| 66 | + |
| 67 | +## Experiments |
| 68 | + |
| 69 | +We're always trying new things in Copilot Workspace. You can opt into our current experiments by clicking on your avatar in the top right corner of the screen and selecting "Experiments": |
| 70 | + |
| 71 | +<img src="images/experiments.png" width=200 alt="Experiments selector"> |
0 commit comments