zsviczian / obsidian-excalidraw-plugin

A plugin to edit and view Excalidraw drawings in Obsidian
3.68k stars 202 forks source link

FR: Hover Effect Setting (Markdown / Excalidraw Integration) #1795

Closed DJ-012345 closed 1 month ago

DJ-012345 commented 1 month ago

Is your feature request related to a problem? Please describe.

I'm frustrated when Excalidraw takes over the hover effect for links in my notes, which also results in empty hovers when I have excalidraw-plugin property in the note. I use Excalidraw as a back of note for all my notes, and I have an SVG on the front that previews the back of the card. Because of this, having the hover effect work for markdown only would be much better. This way, all hovers over links, including ones in dataview tables, will act normally.

Describe the solution you'd like

I would like a setting to turn off Excalidraw from taking over the hover effect, especially for notes with excalidraw-open-md as TRUE. This would ensure that hover effects for markdown links behave normally, including those in dataview tables. Additionally, I prefer not to use the "Excalidraw: Convert markdown note to Excalidraw Drawing" command because it adds friction and unwanted text in the markdown notes. Ideally, I want a single hotkey to flip the note without errors or additional steps.

Describe alternatives you've considered

One alternative is using the "Excalidraw: Convert markdown note to Excalidraw Drawing" command using hotkey, but it adds unnecessary friction and unwanted text to the notes. It also ruins the order of the YAML in my notes.

zsviczian commented 1 month ago

I will need to think about this... since the way you use the back side of the note sounds exactly the opposite of how I use it and how I've designed it. Practically all my notes are visual notes... with a few exceptions when I decide to use the markdown side to add some additional data. In this context if a file is tagged with the Exclidraw metadata in document properties the sensible thing is to show the image, not the text when the file is embedded in a document. But I understand your use case is different...

I don't understand, however, the "convert markdown to excalidraw" adding unnecessary friction... since if you want to draw on the back side of the note you will need to flip it over anyway. Flipping a note for the first time with a different hot key does not feel like (big) friction to me. I also don't fully understand "ruining the order of YAML properties". If your Excalidraw template includes only a single YAML key excalidraw-plugin: parsed, then this will be added to the top of the properties, that's all. Does not sound like "ruin".

With the SVG I wonder about the value of the back side of the note in your use case, since the SVG will be a second file in your Vault anyway. If you want to add an illustration to a note you could always create one with one of the "create embed" command palette actions and include the illustration in your note that way.

image

Now, technically there is no issue in adding a setting to disable Excalidraw hover previews when "excalidraw-open-md: true" is found.

zsviczian commented 1 month ago

I added a setting to 2.2.3 to address this. It will be released over the weekend image

DJ-012345 commented 1 month ago

Hi Zsolt, thank you very much for completing this feature. It improved my Obsidian experience a great deal even though it might have been a small change.

When I said "convert markdown to excalidraw" adds unnecessary friction, it's because even if it's not initially "big" friction, a small friction compounded over many notes makes it feel big.

Regarding "YAML key excalidraw-plugin: parsed" being added to the top of the properties, adding it to the top is exactly the problem. Being added to the bottom would have been better even though I wouldn't have been able to choose the exact row it's added on. The bottom can usually be left for setting-related YAML, but the top is prime real estate.

Regarding the SVGs, yes I know that it will be a second file, but the benefit is that I don't have to name a new drawing, it's just the backside of the current note. I use back of notes as visual summaries of notes or to visualize concepts that are interconnected. The SVG on the front are previews of the back so that I know there's something on the back and if I wanted to take a closer look at the drawing, I flip the note to the drawing.

Also, thanks for your video (https://www.youtube.com/watch?v=rWghRyI_MFc). I spent a long time reflecting on making Excalidraw the front and markdown the back, and it actually made me watch your other video on how you organize everything (https://www.youtube.com/watch?v=nJ660t5ku9A). It's great to see your system and even though I like and always aim to visualize as much as I can, sometimes I need to take notes quickly and brain dump on markdown before organizing on the back of note with Excalidraw. Also, if I take notes on my phone, it's going to be markdown first, then I visualize stuff on the desktop.

Thank you.

zsviczian commented 1 month ago

moving the excalidraw-plugin: parsed property to the bottom is not a big deal. I've opened another FR for that #1803 The "issue" is, I don't use/like document properties that much for metadata, I use it for plugin settings and configurations. Consequently I did not pay particularly much attention to how it is set up.