Hotkeys \ commands should apply to sidebar notes when they are focused

Steps to reproduce

I couldn’t find this request so please link if necessary. At first I was logging it as a feature request, but I can’t imagine that this is the expected behavior.

  1. Focus on a sidebar note
  2. Attempt to execute a hotkey (e.g., toggling edit/preview mode)

Expected result

The executed hotkey should be applied to the sidebar note that is presently in focus.

Actual result

The hotkey instead applies to the most recent focused note in the default/main view (even though the current focus is on the sidebar note).

Environment

  • Operating system: osx
  • Obsidian version:0.7.4

Additional information

5 Likes

this will happen… someday.

Sorry for my bad english, hope you can understand my description.

Steps to reproduce

  1. Block a text in side pane note
  2. press hotkeys for italic/bold/highlight/insert link

Expected result

  • blocked text in side pane becomes bold/italic/highlighted

Actual result

  • but the bold/italic/highlight mark comes in main pane, not in text which I was blocked in side pane. but other hotkey, like ctrl+z (undo), still work in side pane.

Environment

  • Operating system: Windows 10
  • Obsidian version: 0.7.6

Additional information


when I press the bold hotkey, the bold mark comes into the main pane where my last typing cursor was there (see heading 1).

I am also experiencing this issue on Windows 10 Obsidian v0.7.6. Definitely a step up to be able to toggle between edit and view, but without the keystroke the sidebar isn’t quite as helpful. For reference I keep my todos in a tab over there, which is great for easily toggling them in and out of focus.

1 Like

Steps to reproduce

  1. Click on a note pinned to left sidebar
  2. Press the keyboard shortcut to toggle between edit and preview modes.

Expected result

Toggle should happen

Actual result

Toggling happens in note in the main pane.

Environment

  • Operating system: Windows
  • Obsidian version: 0.8.1

Additional information

1 Like

+1. I tend to park my Day Notes in the sidebar and it would be good to be able to use the editing shortcuts.

2 Likes

Steps to reproduce

  1. Open the graph view & place it as a sidebar.
  2. Try to navigate using the keyboard.

Expected result

The keyboard to control navigation of the graph view as it does when it’s in a normal pane rather than a sidebar.

Actual result

The keyboard graph view navigation controls do not function.

Environment

  • Operating system: Windows 10
  • Obsidian version: 0.9.2

Additional information

When note is docked in a sidebar, focused and in edit mode, shortcuts for

  • marking task done/not-done
  • moving paragraph up and down

(and possibly other shortcuts) work on a currently open note in main area and not on the focused note in a sidebar.

Steps to reproduce

  • dock a note on a sidebar (eg. next to backlinks, tags or above them)
  • try using Ctrl-Enter for switching task status of a current paragraph

Expected result

  • this should edit currently focused note sitting in a sidebar

Actual result

  • insteed focus is moved to another document (whatever is opened in main area)

Environment

  • Operating system: Windows 10
  • Obsidian version: 0.9.20

Just chiming in, have just struck this bug as well - shortcut keys (Cmd E, Cmd B, Cmd Enter etc ) when used for a note in the sidebar are applied to the last focused pane in the main area. Annoying because I’ve moved all my “management” daily/task list notes and so on into the sidebar so I can minimise it away and have my real work front and center.

:slightly_frowning_face: because that arrangement/workflow would be ideal for me to maintain focus on actually working. Workaround is to have a second workspace with the daily setup present, but that’s annoying because I have to update it every day with the new daily note.

EDIT: had the thought that maybe I could trigger the commands via the palette and that might work - have just tested trying to set selected text to bold, and it doesn’t work either, same behaviour as with the shortcut keys.

EDIT #2: On OSX 11.1, Obsidian 0.10.1 Installer 0.9.17

I think this issue likely arises from the fact that app.workspace.setActiveLeaf() does not support setting a sidebar document as the active leaf, and presumably commands are always applied to the active leaf.

Specifically, setActiveLeaf() checks whether the new leaf’s getRoot() is equal to the workspace root, but a sidebar document’s getRoot() is the top-level split of its associated ribbon.

ISTM setActiveLeaf() should be checking for rightSplit and leftSplit as well as rootSplit. I’ve tested this with a quick monkeypatch from the developer console, and it allows both commands and hotkeys to work, and also allows the cycle-through-panes plugin to cycle properly, even cycling through the sidebar documents.

There does seem to be one other glitch that it doesn’t fix, though: toggling the edit mode of a sidebar document causes the first pane in the main split to become active. Clicking again in the sidebar document returns it to an active state, however.

There is also no visual indication that a sidebar document is active, and activating a document whose tab isn’t selected doesn’t cause that tab to become selected. Similarly, selecting the tab of a sidebar document doesn’t cause it to become active.

So, it looks like more work will be needed to fix this besides just making it possible for a sidebar pane to be set active… although just supporting that would be a big help.

While investigating this issue I also discovered why the history behaves so oddly in 0.9.x; it apparently includes navigation between panes as part of the history. It sounds like that might have been changed in 0.10.x, though.

Steps to reproduce

Create 2 new notes.
Open both of them up.
Drag one into one of the side panels.
Focus the note in the side panel.
Try editor shortcuts (e.g. bold, delete line, etc) or the same shortcut form the command palette.

Expected result

Editor commands are only apply to the panel in focus regardless of where it’s placed.

Actual result

Commands are applied to the last focused editor that is not in a side panel at the last place the cursor was focused regardless of whether an editor is focused in the side panel.

Environment

  • Operating system: Windows 10
  • Obsidian version: v0.12.3

Additional information

Strangely as you can see at the end of the recording, copy/paste do work correctly.

Just a quick note on this… it’s basically because setActiveLeaf() explicitly doesn’t allow leaves to be active if they’re in a side pane. At one point I played around with having pane-relief patch it to allow sidebar panes to be active, but I ran into some difficulty with the question of whether moving to the “next” or “previous” panes should include the panes in the sidebars, and if so, which ones, etc.

Anyway, the majority of commands in Obsidian do something to the “active” pane, and since sidebar panes can’t be “active”, that produces this result.

(What I don’t know is why they’re specifically disallowed from being active.)

1 Like