When having many open file tabs and searching for a file with CTRL+O, then it’s easy to get into a situation where the same file unintentionally is open in multiple tabs.
Steps to reproduce
- Given John has two open files - “Foo” and “Bar” (“View #1 into file”)
- And file tab “Foo” is active
- When John is pressing CTRL+O to open “Bar” (in the “Foo” tab)
- Then “Bar” is also opened in this tab (“View #2 into file”) - as a result, “Bar” is now open in two tabs
- And “Foo” is no longer open
Expected result
- Give the user a warning (“Tab is already open - do you want to switch to the open tab?”), and/or:
- Automatically redirect the user to the open tab (sometimes, the user might want to open two views into the same file)
To detail the expected result:
- Given John has two open files - “Foo” and “Bar” (“View #1 into file”)
- And file tab “Foo” is active
- When John is pressing CTRL+O to open “Bar” (in the “Foo” tab)
- Then Obsidian informs John that “Bar” is already open in another tab and asks, “Switch to tab?”
- When John chooses to switch to tab “Bar”:
- Then John is redirected to tab “Bar”
- And tabs “Foo” and “Bar” are now open
- When John chooses not to switch to tab “Bar”:
- Then a new view into file “Bar” is opened in a separate tab (as today)
- And tab “Bar” is now opened in two tabs
- And tab “Foo” is closed
Environment
Version: 1.1.9
Windows 10