LemmyNet / lemmy-ui

The official web app for lemmy.
https://join-lemmy.org/
GNU Affero General Public License v3.0
892 stars 334 forks source link

Mentions autocomplete does not work properly with `@` as instance separator #2652

Open Nothing4You opened 3 months ago

Nothing4You commented 3 months ago

Requirements

Summary

When only a single @ is used, autocompleting usernames for mentions works and the text is replaced as desired. When a second @ is added at the end to indicate the end of the username, which separates the username from the instance name, this gets treated as the start of the mention once again, rather than extending the previous mention autocomplete.

Raised from https://sh.itjust.works/comment/13097608

Steps to Reproduce

  1. Type @threelon in a comment

  2. Autocomplete suggests @threelonmusketeers@sh.itjust.works

    image
  3. Click autocomplete option, which inserts [@threelonmusketeers@sh.itjust.works](https://sh.itjust.works/u/threelonmusketeers)

  4. Start new mention, type @threelonmusketeers@

  5. Autocomplete suggests the same. Sometimes this also moves the autocomplete suggestion to the second @ instead of the first one

    image
  6. Clicking the autocomplete option inserts [@threelonmusketeers@sh.itjust.works](https://sh.itjust.works/u/threelonmusketeers) in the place of the second @, leaving @threelonmusketeers[@threelonmusketeers@sh.itjust.works](https://sh.itjust.works/u/threelonmusketeers) as the full text

  7. Start a new mention, type @threelonmusketeers@sh

  8. Autocomplete only searches for the text after the second @

    image

Technical Details

Firefox 128.0.3

Lemmy Instance Version

0.19.5

Lemmy Instance URL

https://voyager.lemmy.ml

dessalines commented 2 months ago

I don't have time to work on this one, but the autocomplete was never supposed to work with multiples of the same symbols (and I have no idea how that would work).