alejandro5042 / azdo-userscripts

A collection of userscripts to improve the Azure DevOps UI
https://alejandro5042.github.io/azdo-userscripts/
MIT License
40 stars 23 forks source link

period shortcut for vscode.dev doesn't always open the same branch #171

Open davidcorrigan714 opened 2 years ago

davidcorrigan714 commented 2 years ago

When using the period shortcut to go from an Azure DevOps Repo to vscode.dev it doesn't always open the right branch. I'd guess it's because Azure DevOps doesn't always have the branch name in the URL. I think Azure DevOps only adds the branch name to the URL when you change it in the UI or use a link that contains the branch. Otherwise it always opens to the last branch you were viewing but doesn't add that to the URL even if it's not the main or default branch for the repo.

welcome[bot] commented 2 years ago

Thanks for opening your first issue here! Please refer to our support and troubleshooting docs.

alejandro5042 commented 2 years ago

OK will look at this!

alejandro5042 commented 2 years ago

Can you send me a link where it doesn't work if you press .?

davidcorrigan714 commented 2 years ago

It's not a specific link but it's easy enough to reproduce. Essentially whenever you navigate to the repo with the "Files" button it resets the query parameters in the URL but not the branch you're viewing. So to reproduce:

  1. Create a new branch in a repo
  2. Add a file in the root of the repo so you can tell which branch you're on in VSCode.dev. Also add some content to the file, seems like VSCode.dev has issues with empty files which I've reported to them.
  3. Click the "Files" button again to clear the URL.
  4. Hit . to open in VSCode.dev and you should end up in the main branch.
  5. Go back to AzDO.
  6. Change the branch with the drop down at the top, notice that it's in the URL now.
  7. Go to VSCode.dev with the period shortcut, notice you're now in the branch.

I really thought there was a way in the VSCode.dev UI to see what branch you're on, but couldn't find it this time so I used the new file trick to tell the difference. Curious if you see another way to tell what branch it has open.

The "Files" nav button I'm referring to above: image