blacksmithgu / obsidian-dataview

A data index and query language over Markdown files, for https://obsidian.md/.
https://blacksmithgu.github.io/obsidian-dataview/
MIT License
6.94k stars 411 forks source link

Support openning notes in a new pane by dragging to the pane title #650

Open wenlzhang opened 2 years ago

wenlzhang commented 2 years ago

Is your feature request related to a problem? Please describe. In preview mode of an ordinary note, one can open a note by dragging the note link to the title part of a new pane. For instance, Note A is opened in Pane A and it contains the link to Note B. Then one can open Note B in a new pane, Pane B, as follows:

It would be great if one can do the same for note linkd in Dataview results/tables, i.e. openning a note in a new pane by dragging the note link to the title part of the new pane.

Additional context The following is a related issue: https://github.com/blacksmithgu/obsidian-dataview/issues/290

blacksmithgu commented 2 years ago

I'm not sure why this doesn't work - the link elements are exactly the same. Here's the HTML of a normal link:

<a data-href="Obsidian - Dataview" href="Obsidian - Dataview" class="internal-link" target="_blank" rel="noopener">Obsidian - Dataview</a>

And here's the HTML of a Dataview-rendered link:

<a data-href="Obsidian - Dataview" href="Obsidian - Dataview" class="internal-link" target="_blank" rel="noopener">Obsidian - Dataview</a>

There must be some extra magic listener being added to the natively rendered links that Dataview does not get, but I'm not sure what or how.

wenlzhang commented 2 years ago

I notice a slight difference for these two cases. For an ordinary Obsidian link, the format would be app://obsidian.md/Note for me, when dragging into the title part of the new pane; for Dataview rendered links, the format would be app://obsidian.md/Note.md, i.e. with the .md extension.

Also, I realize that the issue mentioned in https://github.com/blacksmithgu/obsidian-dataview/issues/290 happens again for me now.

I am using Obsidian v0.13.2 and Dataview 0.4.20.

wenlzhang commented 2 years ago

It works for me now with Dataview version 0.4.21 and Obsidian version 0.13.7. Not sure if it would break with future versions of Obsidian or Dataview, though.

blacksmithgu commented 2 years ago

Likely some Obsidian bugfixes; I sadly have no idea if it will continue to work or break again.