esm7 / obsidian-map-view

Interactive map view for Obsidian.md
MIT License
546 stars 25 forks source link

Marker Popup Mechanism Change #235

Open rchaklashiya opened 3 months ago

rchaklashiya commented 3 months ago

First I want to say thank you for the frequent updates on this plugin! I really like almost all the new changes post-5.0.0. However, one thing that I feel strongly about is the note popup mechanism on the map upon hovering over a marker. I also noticed that in the changelog it was stated that if anyone feels strongly about it to make it an issue on Github, so I'm doing that now.

I find that because I often add lots of properties to my notes, that the new way of doing the marker note popup mechanism makes it difficult to see a good snapshot of what is happening in the note. The previous popup mechanism was perfect in that it could be made to be live preview or reading mode, so that I could instantly see the top of the note minus the properties. Usually in my use case, the first thing in my notes on the map is an image, which makes them easy to recognize/distinguish--however, the new popup mechanism would not allow that to show up, because it cannot scroll, and it shows things in raw form (with properties showing up).

I understand the need for less complexity long-term, and am wondering if a simple fix could be to simply enable changing how the note shows up from raw mode to reading mode or live preview mode. For my own use case, that might be enough. Adding the ability to scroll would be ideal but I understand if that would be too much.

In any case, thanks for all that you do, and for working on this!

esm7 commented 3 months ago

Thank you for the feedback, it's exactly what I was looking for :pray:

I can eventually bring back the old mechanism as a setting, however, since it's an undocumented Obsidian API that often breaks (then I need to ping the devs and they sometimes have other priorities), I rather try to get the new way right.

  1. One thing I'm curious about is that you mentioned "raw form" vs reading/live preview. Can you elaborate on that, maybe with a snippet of your note and a screenshot? In theory the new preview should show notes similarly to how Obsidian shows them in reading view, as it uses the Obsidian Markdown rendering API. If you are seeing the popups in "raw form" then something is wrong.
  2. Showing the full note with an ability to scroll, similarly to how the native Obsidian preview does it, is certainly an option. If it's gonna help with your use case it'll give this a bump in priority. But I wonder how important that is if the issue in (1) is resolved.
rchaklashiya commented 3 months ago

No problem!

  1. By raw form and reading/live preview I mean what it currently shows is source mode (or maybe live preview, I'm realizing now that both would result in what I'm seeing). Here is an example of what it looks like rn: image

If I were to open it up in hover editor in reading view then it would show up how map view used to show it, which is what I'm looking for, see here: image

I'm realizing this specific one isn't the best example because here the image is in the first property, so some of it does actually show up in the first view I just shared, but it would not be the case always, see this for an example:

current view: image

desired view: image

  1. I'm realizing now that maybe having the ability to scroll is still necessary--even if the image is at the top, it will be cut with the current view. It will definitely help my use case if it's returned.
esm7 commented 3 months ago

If I understand your screenshots correctly, the preview renders your note differently than the "real" Reading View or the Obsidian popup, but not in source mode, which would not show images at all. Like you mentioned, maybe it's more similar to Live Preview. This is what the Obsidian Markdown rendering API provides, and while it had gotten better compared to a few months ago, it doesn't provide to plugins the fully-featured Reading View renderer :(

So:

  1. Is there a stand-alone source you can share that will enable me to recreate a similar result, and investigate if I can improve the preview for your use case?
  2. If the conclusion would be that that's the best result that can be achieved with the formal Obsidian rendering API, would the inclusion of scrolling make enough of a difference for this to be usable for your use case, or is the "old" preview (the undocumented Obsidian preview hack) the only way to go?
rchaklashiya commented 3 months ago

Thanks for looking into this!

  1. Yes, you can try out with this note, it's the "starter town" note that I shared screenshots of: starter town.md
  2. I think that at minimum what might be needed is inclusion of scrolling + collapse of properties--if both of those together are there, then I think it should work