When calling core:open-note it would be nice to have an argument like selectInSidebar where when the passed noteID belongs to a notebook, that notebook is also selected on the sidebar so it keeps the context consistent.
Or if this is not possible, a separate API (command) to select a notebook from the sidebar would be enough. I can just call those one after the other.
Would be more than happy to contribute this, but not sure if the source code is open or closed?
Thank you for the suggestion. core:open-note should not affect other UIs because user interaction flow is basically side bar → note list → editor.
Sidebar’s selection state is tied with query context which represents currenty used query for showing the content of note list in order to make consistent between components.
So, you have to manipulate query context to change the sidebar state based on currently editing note.
There are some commands to help do that:
But those commands automatically open the first note in the note list. It would be nice to add an option like selectFirstNote so that you can disable this behavior in the next version.
Yes, I want my default notebook selected on sidebar.
This works when run through dev console but not when added to init.js, I presume that’s because init.js is exercuted early on while the sidebar hasn’t been loaded yet so will try this on a plugin later.
It works! well that was silly of me. , thanks. Now time to turn this into a plugin, can’t believe I’ve been putting this off when it was an easy implementation.