azdo-userscripts icon indicating copy to clipboard operation
azdo-userscripts copied to clipboard

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

Open davidcorrigan714 opened this issue 2 years ago • 4 comments

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.

davidcorrigan714 avatar Nov 16 '21 16:11 davidcorrigan714

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

welcome[bot] avatar Nov 16 '21 16:11 welcome[bot]

OK will look at this!

alejandro5042 avatar Nov 16 '21 21:11 alejandro5042

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

alejandro5042 avatar Nov 16 '21 22:11 alejandro5042

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

davidcorrigan714 avatar Nov 17 '21 16:11 davidcorrigan714