cribeiro84 / azure-devops-pull-request-hub

Azure DevOps Pull Request Manager Hub
MIT License
57 stars 35 forks source link

Revert "Make pull request button a link" #275

Closed cribeiro84 closed 3 months ago

cribeiro84 commented 3 months ago

Reverts cribeiro84/azure-devops-pull-request-hub#262 due the issue it has created that's now opening the PR details on both new window and same tab.

sonarcloud[bot] commented 3 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

cribeiro84 commented 3 months ago

@kimsey0 - I had to revert the change due the impact it caused on the behavior of the extension. Currently, the extension supports a preference settings to open on the same or new tab. Let me know what exactly you want to solve so we can come up with a different approach.

kimsey0 commented 1 month ago

Sorry for the delay in coming back to you.

I want to be able to middle-mouse (scroll wheel) and control click links to have them open in a background tab, specifically for when I'm reviewing multiple pull request. With the current (button, not link) behavior, I have to click a pull request to open it in a new, active tab, then go back to the pull request manager hub tab, and repeat the process for each pull request I want to review. That's slow.

We can probably get the behavior you want with the preference settings by removing the onClick handler completely and just setting target="_blank" when the preference is set to open in a new tab. Does that sound agreeable @cribeiro84?

cribeiro84 commented 1 month ago

No problem. My suggestion is to install the local dev version on an account you have so you can test it locally with debugger and everything else. Then you can simulate the clicks and check if the behavior was affected or not. You can try to check which button was clicked on the click event method: onClick={onClickPullRequestTitleHandler}

It's required to ensure the behavior won't affect other uses that prefer to keep the existing process. Perhaps you can add a new user preference flag that can be changed based on each preference of the user.

kimsey0 commented 1 month ago

I believe we can keep the existing behavior for all users without JavaScript at all. Let me try to code it up and test locally. :-)