More efficient toggling of ui components (e.g. file explorer)

Use case or problem

Currently we have keyboard shortcuts for showing stuff:

  • Show file explorer
  • Show bookmarks
  • Show backlinks
  • Show tags
  • Show file properties
  • etc.

Let’s consider the file explorer as an example.

Often, after showing the file explorer, and retrieving the information I need, I’d like to hide it again, with the same ease as when showing it:

If I press CMD+1 to show the file explorer, I want to be able to press CMD+1 again to hide the file explorer – in effect closing the left sidebar.

This is a common usage pattern in IntelliJ IDEA. In Obsidian however, to achieve this, I need to bind another keyboard shortcut to the command “Toggle left sidebar” and use that separate command to hide the file explorer. Having two separate keyboard shortcuts for a single concept is not necessary.

Which leads me to a proposed solution, which is basically how I think IntelliJ IDEA is handling this.

Proposed solution

I believe the commands listed in the previous section should be renamed to:

  • Toggle file explorer, or just “File explorer”
  • Toggle bookmarks, or just “Bookmarks”
  • Toggle backlinks, or just “Backlinks”
  • Toggle tags, or just “Tags”
  • Toggle file properties, or just “File properties”
  • etc.

Implementation suggestion: If the component being toggled is not visible then show it (as it is today). Otherwise, if the component being toggled is visible, hide the sidebar which hosts the component (and optionally hide the component itself if that is necessary, I’m not sure how the internals of Obsidian works in this regard).

This would enable a rapid show/hide by inputting the same command twice. This is way more efficient than having to use two different shortcuts.

Current workaround (optional)

Use a separate keyboard shortcut to toggle the left / right sidebar.

1 Like

The problem I see is that this may impair the workflow of people who have other widgets in a pane. For example, it is possible to insert place the Calendar plugin on top or bottom on one of the panes. Toggling a hotkey to open the File Pane while it is already open then would close entire pane, even if something else is open there.