olrenso / obsidian-home-tab

A browser-like search tab for your local files in Obsidian.
MIT License
248 stars 7 forks source link

[Feature request] Replace home-tab when Opening Files #23

Closed coderlemon17 closed 1 year ago

coderlemon17 commented 1 year ago

Hi, thanks for the cool plugin and I really like the browser-style interaction. But currently when I open a new file from the home-tab, it will open the file in a new tab rather than replacing the home-tab.

I think the later is more like what you would do in Chrome, you open a new tab, type something in the search bar, click Enter and you will go to the page within the same tab.

I would really appreciate it if we could customize how the file is opened.

olrenso commented 1 year ago

Hi, thank you. The plugin uses the default hotkeys of Obsidian Quick switcher, so with Enter (or click) you can open the file in the current tab, and with Ctrl + Enter (or Ctrl + click) you can open the file in a new tab.

It could be a bug, do you mind making a screen recording or giving me more details (OS, Obsidian version, ...)?

coderlemon17 commented 1 year ago

Thanks for the quick response, sorry I think the problem comes from the conflicts between home-tab and Obsidian-Opener, which is a plugin that allows me to open files on the side-bar by Click (not Ctrl+Click).

Is it possible to configure the behavior of the home-tab to close home-tab even opening files in a new tab, or I might have to choose between those two plugins?

coderlemon17 commented 1 year ago

Another thing Obsidian-Opener does (and I think it's helpful) is that it will go to the existing tab if the file is previously opened, instead of opening a new tab of that file, which is the default obsidian behavior.

I'm not sure whether this will affect the home-tab.

olrenso commented 1 year ago

Is it possible to configure the behavior of the home-tab to close home-tab even opening files in a new tab, or I might have to choose between those two plugins?

I'll take a look and see what I can do.

Another thing Obsidian-Opener does (and I think it's helpful) is that it will go to the existing tab if the file is previously opened, instead of opening a new tab of that file, which is the default obsidian behavior.

I was thinking of adding this feature as an option in the settings. Are you sure it's the default Obsidian behavior? If I try to open an already open note from the quick switcher (or from the sidebar) it always opens a new tab. Not sure why it wasn't working as expected, I'll surely add this feature.

olrenso commented 1 year ago

~Are you sure it's the default Obsidian behavior? If I try to open an already open note from the quick switcher (or from the sidebar) it always opens a new tab.~ Not sure why it wasn't working as expected, I'll surely add this feature.

Apparently, Obsidian-Opener does not unload correctly, and even after being disabled it still overrides the default Obsidian behavior (which does not seem to focus the tab where the file is already open).

I'll take a look and see what I can do.

On my side, I can't do much to fix this issue since Obsidian-Opener overrides the default Obsidian openFile function.

coderlemon17 commented 1 year ago

Apparently, Obsidian-Opener does not unload correctly, and even after being disabled it still overrides the default Obsidian behavior (which does not seem to focus the tab where the file is already open).

Hi, I'm new to Obsidian so I'm a little confused. Are you suggesting that Obsidian will naturally go to the existing tab if the file is previously opened?

I've disabled all third-party plugins and reopened Obsidian, but it seems that whenever I want to open an already opened file in a new tab (either through Ctrl+Click or default Quick Switch), the file will be reopened in a new tab instead of activating existing tab.

olrenso commented 1 year ago

Hi, I'm new to Obsidian so I'm a little confused. Are you suggesting that Obsidian will naturally go to the existing tab if the file is previously opened?

No, maybe I was unclear. Obsidian will always open a new tab.

I've disabled all third-party plugins and reopened Obsidian, but it seems that whenever I want to open an already opened file in a new tab (either through Ctrl+Click or default Quick Switch), the file will be reopened in a new tab instead of activating existing tab.

Exactly.

coderlemon17 commented 1 year ago

Well, it might be its own design philosophy. Thanks for ur help!