Improve UX for adding custom display text to an internal link

Use case or problem

  1. Start typing an internal link to an existing note, e.g. [[Vault
  2. Use arrow keys to select an existing note and hit TAB to auto-complete and jump cursor to end of the note title.
  3. Now type the vertical bar character | to start adding custom display text, e.g. [[Vault is just a local folder|
  4. Confusingly, my selected note disappears from the auto-complete pop-up and I am shown an error message: “No match found”

This happens any time you add custom display text to a note that doesn’t have aliases pre-assigned in frontmatter. I would guess that for most people, that’s most of their notes.

I filed this as a bug but was informed that it’s expected behavior. Once I hit |, Obsidian switches search scope from ‘all note titles and aliases’ to the selected note’s aliases (as listed in its frontmatter).

This UX is confusing and limited for a few reasons:

  • The aliases are already in the search scope when auto-completing the note name so nothing new is offered by showing me options I already declined. That said, perhaps I missed it the first time.
  • This secondary search only shows results for notes that have aliases. Everything else gets ‘No match found’. I have a few notes with aliases but I’m 1000x more likely to be writing custom link text. It’s a shame to waste this functionality on such a narrow, rare use case.

Proposed solution

More than anything, this is confusing UX copy. Simplest solution would be to update the UI copy so it doesn’t confuse the user with an ambiguous error message. Two possible options:

  1. Make the new search scope explicit but confirm that all is well. “No matching aliases. Editing custom display text…” Or similar.
  2. Don’t show the error at all. If there are aliases, show them; if not, then no error.
2 Likes

Same here. I was just fighting this behavior.

Why does the internal link behavior support | as part of the link at all? Shouldn’t it immediately switch to display text mode when you type this character in the double square brackets? Maybe there’s a use case I’m missing.

Are you suggesting that typing | at any point after opening the double-brackets should be equivalent to typing tab then |, jumping immediately to editing display text? I think that’s a great addition to this feature request. It seems compatible since | is disallowed in note filenames.