Confirm note creation when clicking link to a non-existing note (or disable it)

rigmarole, thanks for the updated CSS snippet! I hope the Obsidian developers will make this more flexible in the future.

I can suggest another design option (I prefer it without stripes or waves under the text, and the unresolved link text itself should always be a nice, soft red color across both versions of the Obsidian theme):

:is(.markdown-reading-view, .markdown-source-view) .is-unresolved {
    color: #ff1155 !important;
	pointer-events: none !important;
	opacity: 1 !important;
}

.theme-light {
     --link-unresolved-color: #ff1155;
     --link-unresolved-filter: none;
	 opacity: 1 !important;
 }
 
 .theme-dark {
     --link-unresolved-color: #ff1155;
     --link-unresolved-filter: none;
	 opacity: 1 !important;
 }
1 Like

Use case or problem

Currently, there are two options when clicking a non-existing link:

  • Create note in root folder.
  • Create note in same folder.

My vaults consist of many folders, with notes that contain many links.
I never want to create a new note in the root folder, and I almost never want to link to a note in the same folder as the current note.
Please note that my workflow involves clicking on these links a lot. When I click on a non-existing link, I want Obsidian to just tell me that the file doesn’t exist.

Proposed solution

Since this feature is not popular, it should not be the default behaviour, but it would be preferrable to have this available as an optional setting:

  • Do not create new note when clicking on a non-existing link.

Current workaround

A suggested workaround that I have found is:

  • Not clicking on non-existing links. This is not an acceptable solution for me, because I don’t want to be ā€œpunishedā€ for clicking on links too quickly, and I never want to create new notes by clicking on links.

Related feature requests

Related posts I have found: (please note that none of these posts are 100% same to this one, this feature request asks for an option to completely disable current behavior in all cases)

4 Likes

Good idea! Another workaround is to include the path in your link so that worst comes to worst and you accidentally click the link, at least the note will be created in the correct folder.

For example, [[software/houdini]] would create the Houdini note within the software folder when clicked. And if the software folder doesn’t exist, it will be created. I understand this is likely not the solution for you, but thought it might be worth sharing just in case.

Good luck!

There’s also a bit of a problem for things like email addresses. E.g.

Email to [email protected]

[email protected] gets turned into a ā€œlinkā€.

  • Clicking on it creates a note called [email protected].
  • Prefixing with mailto: → mailto:[email protected] disables the ā€œimmediateā€ click. Control-clicking pops up a confirmation.

Surprised there isn’t a setting for this behavior!

As a work-around, I was able to prevent automatic note creation with this CSS snippet:

span.is-unresolved > a {
	pointer-events: none;
	touch-action: none;
}
3 Likes

I have tried @kitschpatrol’s solution but it doesn’t work for me. So I tried removing the element selector and the child selector and it worked.

.is-unresolved {
	pointer-events: none;
	touch-action: none;
}

We NEED this feature!

It’s shocking that we have no way to manage this.

We need full control with three settings options:

  • Ask whether to create a new note.
  • Create a note without asking.
  • Do NOTHING when clicking a link (at most, make it visually red when hovered over and ā€œshakeā€ visually when clicked).

This is important for situations where I want to prevent other users or myself from accidentally creating unnecessary entries, especially entries in the wrong place.

Furthermore, this is extremely harmful behavior – I don’t want random files and folders appearing in the knowledge base in unexpected locations if links have a relative path (and, for example, point to a location OUTSIDE the current Vault). This is especially true if I’m creating a distributed knowledge base (for example, by having vaults located next to each other in the same folder/repository or nested within each other (though this is less common, to avoid errors)—and I’m intentionally manually creating relative links between records in different vaults). Because now, clicking on a non-existent link (within the current vault context) creates a FOLDER OUTSIDE THE VAULT, which shouldn’t happen!