zadam / trilium

Build your personal knowledge base with Trilium Notes
GNU Affero General Public License v3.0
26.91k stars 1.88k forks source link

(Feature request) Cancelling the `@` trigger when we really just want to use the @ character #4692

Closed diyoyo closed 6 months ago

diyoyo commented 6 months ago

Describe feature

Very often, I want to type word with an @ that are not related to note-linking. Just because I like the emphasis it gives to a word, or because I'm implicitly writing that I'm referring to an instagram account or whatsoever.

Additional Information

Currently, the only way to skip the 'linking note' automation, is to use the right-arrow key. But that's never enough, any time I edit the note, the 'linking note' automation comes back and interfere with my current flow.

At the end of the day, this is almost a bug report rather than a feature request, I'd say.

meichthys commented 6 months ago

It probably doesn't help much, but typing any charachter before the @ symbol prevents the note linking dropdown from showing up. so you could do something like .@yourt_text if that's not too much of a distraction.

diyoyo commented 6 months ago

It probably doesn't help much, but typing any charachter before the @ symbol prevents the note linking dropdown from showing up. so you could do something like .@yourt_text if that's not too much of a distraction.

Well, that is too much of a distraction, since I have cases where the previous character must be a space, in a long sentence ending with @something . Yes, I'm being picky here, sorry 🙈 I tried adding special code quotes: @helloworld like in markdown , and I'm not bothered by the menu while I am typing. But... the menu appears after I type the closing quote :(

diyoyo commented 6 months ago

I must add that the problem is not so much the menu itself.

What happens is that when you go back on it and the focus is at the end of the @ word, if you hit enter inadvertantly , you'll link the @ word to an inexisting note, which will result in a [missing note] link, make the word unreadable

  1. image
  2. image
  3. image
  4. Then hit 'Enter' to go to next line

  5. Then realize that you triggered the note menu and hit 'Escape'

  6. image
meichthys commented 6 months ago

Also probably too much of a distraction, but you can add a @ at the end of your word to cancel the dropdown like this:

@yourword@

I'm only trying to help you within the confines of the existing feature-set since Trilium is in maintenance mode and will likely not receive feature updates. TriliumNext will carry Trilium forward with new feature requests and the like, but a TriliumNext release is still a little ways off.

X-Bruce-Y commented 6 months ago

Hi I'm thinking about 2 ways. If it does not distract you much, you can finish typing the whole paragraph after @ and finally ESC. Otherwise you may try always use AT or some rare combinations you like to indicate @ and write a script to replace AT with @ hourly or manually through launch bar.

diyoyo commented 6 months ago

Hi I'm thinking about 2 ways. If it does not distract you much, you can finish typing the whole paragraph after @ and finally ESC. Otherwise you may try always use AT or some rare combinations you like to indicate @ and write a script to replace AT with @ hourly or manually through launch bar.

Actually, I tried using ESC, but it's tricky, because everytime you mistakenly click and place the cursor anywhere after the @, then the auto-completion is triggered.

meichthys commented 6 months ago

Another one that works is:

!@your_word_here

zadam commented 6 months ago

Hi, I implemented a workaround which should deactivate the "mention UI" on escape.

It's kind of a hack by inserting an "n space" character which acts as a disallowed character for the autocomplete.

Unfortunately the implementation in CKEditor is regex based and given we allowed spaces for searching in the autocomplete, we need some other way to terminate the autocomplete.

This will be released in the next patch release.