esm7/obsidian-map-view

Open note in current/last selected pane

Darkbluetest opened this issue · 5 comments

Hi

I open a new issue just to keep things organized. It is related to the fact that for now, the plugin can't open a note in the last or current selected pane. If it can open a new pane reusing the last selected pane, I think the experience would be improved.

It seems to me that a smooth and transparent (no special action from user required) way of operating is the ideal, so if making the plugin keep track of selection change is possible, maybe it should be considered even if it does not seem to be the official way of Obsidian, or at least give an option.

The topic was revealed and discussed in this thread: #113 (comment)

Thank you!

esm7 commented

I added a setting under "Pane & Tab Usage", for the marker click actions (e.g. default action for map marker click) named "Open in last-used pane".
This should do what you wanted -- do you mind checking the attached build to verify it works indeed as you intended?
(clarification: you need to select the new behavior in the settings)

map-view.zip

Hi,
Thanks for this. Yes it does what I was expecting. And it works nicely !

Only one comment: if the last used pane is a pinned one, it does not respect the pin status and loads the note in it anyway.

I don't know how you have coded this option, but maybe a solution for this could be then to use the last used pane before the last used, and so on. And if all panes are pinned, then open a new one. I don't know if you keep track of the last panes used, though. If tracking of panes used is not available or difficult to implement, then a variant would be in case the last used is pinned, to switch to another pane not pined (regardless if it has been used just before or not), and open a new one if all open panes are pinned.
Maybe a easier option would be not to open at all, but then some warning to the user should be given.
Still another option could be just to open a new one, but that could mess up the layout of the user.

Thanks a lot for all your work in this plugin, I feel it si really reaching a mature and robust status.

esm7 commented

Oh that's definitely an overlook, I've never used pinned notes and should definitely add this to the logic (maybe not just for this feature).
I wrote this feature in a way that keeps track of the last used panes in the order they were used, so there shouldn't be a problem to keep trying them by order until a non-pinned one was found.
Thank you for the feedback!

Hi, the last updates have improved quite the plugin. But I see that the open in last pane option, which works fine, still does not respect the "pin" status of the pane. Do you plan to add this anytime soon or it has been added (but then it does not work on my side)?
Thanks!

esm7 commented

Sorry, the 'pin' support slipped my mind 🤦 Added in 4.0.0!