new-tab-default-page
                                
                                 new-tab-default-page copied to clipboard
                                
                                    new-tab-default-page copied to clipboard
                            
                            
                            
                        [Bug]: Move current page to new tab will trigger another quick switcher
Bug Description
Move current page to new tab will trigger another quick switcher though current page is markdown view already.
Relevant Screenshot
None.
To Reproduce
- Install another quick switcher,
- Install new tab default page, and set new tab to trigger another quick switcher
- Move current page to new window
- It will trigger the open another quick switcherthough current page is markdown view.
Obsidian Version
1.0.0
Which editor are you using?
- [X] New Editor
- [ ] Legacy Editor
Checklist
- [X] I updated to the latest version of the plugin.
This is actually not a bug, but somewhat intended.
When you only have one tab open and close the tab, you get an empty file, which also triggers this plugin. This effect is unintended, but when noticing it I was actually happy about this behavior, since you never want to have an empty tab anyway.
Now when you run the "move tab to new window" command, and that tab is your only tab, it would normally leave behind an empty file in the main Obsidian window, essentially having the same effect as closing the last tab.
While this effect may be a bit unintuitive, I think it is overall desirable, since otherwise it would leave a useless, empty window behind. (Also, figuring out how to detect popout windows from the API looks a bit daunting to me 😅 )
So unless I am misunderstanding your issue, I think I regard this rather as a welcome side effect than a bug 😊 (If I misunderstood you, please comment and I'll re-open)
@chrisgrieser Yes, I record video for explaining what I came across:
https://user-images.githubusercontent.com/13215013/199977753-c8e1ef81-e2ae-4460-ad7b-4783c9d2d098.mp4
- Use move current tab to new windowby clicking it inCtrl+P;
- And though the tab I moved to new window is not a blank tab, the another quick switcher still opened
Hope this will help.
ah, I see. Okay, I think I get the problem. What happens here is actually a special case of what I described:
when the tab is moved to a new window and leaves behind an empty tab, that empty tab triggers the plugin, in your case AQS. But at the moment AQS is triggered, the window focus has already moved to the popout window, so AQS occurs there (instead of the main window, there is could have made sense as I argued).
However, does seem straightforward. Like, as a check before the new tab plugin is triggered, it must ensure that the empty file is the only tab in the current window, and that there is a recently opened popout window. I went through the api for popout windows, I am not sure how to do that 😅