Fix multiple tab opening of Simple Browser#197188
Fix multiple tab opening of Simple Browser#197188robincaloudis wants to merge 1 commit intomicrosoft:mainfrom
Conversation
In microsoft#182795 it was shown that a new Simple Browser tab was created whenever the vscode window has been reloaded with an active view not being a Simple Browser tab. This led to strange user experience and weird editor behaviour. Make sure no new instance of the Simple Browser will be created if there exist already one in the active tab group. Fixes microsoft#182795
|
Hello @mjbvz, I'd appreciate a review. Thank you. |
|
Could some of the other maintainers please have a look? Thank you. |
|
@Tyriar @lszomoru @meganrogge Any update? |
|
@robincaloudis Stop pinging random people. I'll review this when I have a chance but the issue it fixes is low priority |
|
Now I do understand the reason for the absence of a review. Thanks for your answer and explanation. |
|
@mjbvz, any update? Thanks in advance! |
y0sh1ne
left a comment
There was a problem hiding this comment.
This PR is much more like a hotfix which solve the multi-open problem, but it seems will cause another problem: Nothing will be shown when the command be called with another unfocused (also unrestored) 'Simple Browser' tab exist. Because you just return in this condition.
What's more:
-
vscode.window.tabGroups.activeTabGroup.tabsis instanceofTabinstead ofTabGroup. And I will usetabto represent the item oftabsbelow. -
You use the
tab.label === SimpleBrowserView.titleto implement the function ofexistInTabGroup, but in fact, I can easily create a file called 'Simple Browser' and open it as a tab with label=='Simple Browser'. The below video has shown this point. I suggest to use thetab.input.viewType.
2024-06-20.175102.mp4
At last, I have a solution at #182795 (comment)
and #182795 (comment) .
But I have some trouble on implementation.
|
Is this still relevant? |
Why
In #182795 it was shown that a new Simple Browser
tab was created whenever the vscode window has
been reloaded with an active view not being a Simple
Browser tab. This led to strange user experience and
weird editor behaviour.
What
Make sure no new instance of the Simple Browser will
be created if there exist already one in the active tab
group.
Fixes #182795