Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Move current page to new tab will trigger another quick switcher #7

Open
2 of 3 tasks
Quorafind opened this issue Oct 19, 2022 · 3 comments
Open
2 of 3 tasks
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Quorafind
Copy link

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

  1. Install another quick switcher,
  2. Install new tab default page, and set new tab to trigger another quick switcher
  3. Move current page to new window
  4. It will trigger the open another quick switcher though current page is markdown view.

Obsidian Version

1.0.0

Which editor are you using?

  • New Editor
  • Legacy Editor

Checklist

  • I updated to the latest version of the plugin.
@Quorafind Quorafind added the bug Something isn't working label Oct 19, 2022
@chrisgrieser
Copy link
Owner

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)

@Quorafind
Copy link
Author

Quorafind commented Nov 4, 2022

@chrisgrieser Yes, I record video for explaining what I came across:

QQ.20221104205437.mp4
  1. Use move current tab to new window by clicking it in Ctrl+P;
  2. And though the tab I moved to new window is not a blank tab, the another quick switcher still opened

Hope this will help.

@chrisgrieser
Copy link
Owner

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 😅

@chrisgrieser chrisgrieser added the help wanted Extra attention is needed label Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants