Don't reopen notes that are already open, just put the focus on them

Use case or problem

Let’s say I have 2 open notes, Parent and Child.
Parent has a link to Child.
If I click on [[Child]] from Parent and unless Parent is pinned, Obsidian will re-open Child.

Now I have 2 open copies of Child, and 0 of Parent.

Proposed solution

If the note Child is already open, just put the focus on it, even if Parent is not pinned. If the user really wants to open another copy of Child, they can just middle click on the link.

Current workaround (optional)

I quickly wrote a hacky monkey-patch to get around this: GitHub - scambier/obsidian-no-dupe-leaves: Automatically switch the focus to open notes instead of reopening them

Related feature requests (optional)

None.

21 Likes

This would be nice! :slightly_smiling_face:

1 Like

I need that. I wonder why not more would want this behavior. Of course there still should be the possibility to open the same note in a new pane by right-click-menu or shortcut.

But as a default I really want to simply focus the already open note!

This is also the behavior I expected when I first started using Obsidian. Thanks for requesting!

1 Like

I encounter this issue almost daily. It is one of those annoyances that I wish would go away but don’t take any steps to fix. I end up hitting my keyboard shortcut to “Navigate back” to see the Parent again. Thanks for writing up the problem and requesting the feature. It would be most appreciated if devs could provide this feature.

1 Like

This is now a community plugin: Plugins - Obsidian

4 Likes

I’ve just installed the “No Dup Leaves” plugin and it is creates exactly the Obsidian behavior I’d prefer. Thanks scambier for making this happen now via your plugin and I’ll add my vote to this Obsidian feature request.

Thanks for this! That duplication has really bothered me.

It’s worth noting that you can still create a second instance of a note by doing a “open current pane in new window”, which gives you a pop-out window. I can see that being useful sometimes.

We did some internal testing at some point about this. I understand some people like it, but the behavior is a bit jarring because sometimes you navigate in this tab and other times you move the focus somewhere else. This is also not how browsers work (nor code editors).

Another workflow trying to tackle the same problem is “reuse tab when opening in new tab”

1 Like

Some code editors, like VSCode, have this behavior, and I find it jarring :smiley: . Others like Jetbrains put the focus on the file if it’s already open. I agree that browsers work like that too, but a browser’s UI is different, and so is its usage :man_shrugging:

It would be nice if users could choose which behavior suits them best in Obsidian’s settings. Though from what I’ve gathered, I understand it is easier said than done.

Yes, some code editors have some form of reuse. But the crucial difference is that code editors don’t navigate within tab. You click on something and it either

  1. moves the focus to a tab where the target was already open or
  2. a new tab with the target is opened.

There’s no opening/navigating a link in this tab.

The way code editors and browsers handle this workflow is substantially different and hybrid approach is jarring.