Tab-completion should automatically add a space after a username

pr-welcome

(Jan-Christoph Borchardt) #1

Currently I always find myself needing to manually insert a space after I mention a name and tab-complete it. Other platforms with @mentioning like Github and Twitter simply insert a space automatically which is very convenient.


(Jeff Atwood) #2

Interesting, how do you feel about this @sam?


(Jay Pfaffman) #3

That’s what I expect to do after I type a word. I might say something like “@jancborchardt’s idea is really good”, and to do that the way you suggest, I’d need to backspace the automatic space.

Hmm. That seems annoying to have multiple ways for that to work. FWIW, Facebook doesn’t automatically add a space.


(Joshua Rosenfeld) #4

I’m in agreement with @pfaffman here, don’t want an automatic space. One of my jobs uses GroupMe, and it has always annoyed me that I have to backspace to add an apostrophe, slash, or dash after a name.


(Jan-Christoph Borchardt) #5

@pfaffman right, in the example you bring up it doesn’t make sense. However there are also many examples where a space is in order. Like at the beginning of the sentence as I just did, or saying »I like what @pfaffman said there«.

(Also, strangely enough a space is actually inserted after a mention. But the cursor is set before it. Do you know what I mean? This seems to point to that it’s actually intended that a space is inserted but there might be a bug @codinghorror?)


(Erlend Sogge Heggen) #6

True, but if I had to pick between.

  1. sometimes pressing space an extra time, and
  2. sometimes pressing backspace an extra time

I’d pick space every day of the week. I’ve already got both my thumbs resting on it! Whereas to click backspace, I actually have to reach for it. It sounds trivial but there’s a very real UX tradeoff here, and I firmly believe we already made the right choice.


(Jan-Christoph Borchardt) #7

It doesn’t sound trivial to me, that’s why I’m bringing it up. :wink: I’m a UX designer as well.

I’m just saying that it might not be »sometimes space« vs »sometimes backspace« but rather »very often space« vs »sometimes backspace« in addition to »bunch of related platforms with @mentioning also insert space so people are used to it«.

But it’s your call, and a good point with the space bar being way closer. :slight_smile:


(Jan-Christoph Borchardt) #8

I decided to spend my Sunday doing some more comprehensive research on how @mentions are handled on different other platforms. :tada:

What do other platforms do?

There are two main ways of doing it, as mentioned before:

  • Appending a space after the name.
  • Not appending a space after the name.

(I took the liberty to link the names of platforms which are open source / free software to promote them a bit. :slight_smile: )

Platforms which append a space

  • Twitter appends " " (a space). Suggests names only with @. Uses handles.
  • WhatsApp appends " " (a space). Suggests names only with @. Shows display names instead of handles, but does not allow modification.
  • Instagram appends " " (a space). Suggests names only with @. Uses handles.
  • Github appends " " (a space). Suggests names only with @. Uses handles.
  • GitLab appends " " (a space). Suggests names only with @. Uses handles.
  • Trello appends " " (a space). Suggests names only with @. Uses handles.
  • Disqus appends " " (a space). Suggests names only with @. Shows display names instead of handles, but does not allow modification.
  • Ghost seems to mostly use/encourage Disqus for commenting, although Discourse is possible.
  • Mastodon appends " " (a space). Suggests names only with @.
  • Taiga appends " " (a space). Suggests names only with @.
  • Slack appends " " (a space). Suggests names both with and without @, but only mentions them when an @ was used.
  • Asana appends " " (a space). Suggests names only with @, but cuts the @ automatically. Shows display names instead of handles, but does not allow modification.
  • Riot appends ": " (a colon and a space). Suggests names both with and without @, but cuts the @ automatically. Shows display names instead of handles, but does not allow modification.
  • Nextcloud still needs to implement the auto-complete part and the current spec is to add a space automatically.

Platforms which append nothing

  • Facebook appends nothing. Suggests names both with and without @, but cuts the @ automatically. Shows display names instead of handles, and allows modification of those while keeping the mention intact (like cutting the last name).
  • Facebook Messenger appends nothing. Suggests names both with and without @, but prepends the @ automatically. Shows display names instead of handles, and allows modification of those while keeping the mention intact (like cutting the last name).
  • Medium appends nothing. Suggests names only with @, but cuts the @ automatically. Shows display names instead of handles, and allows modification of those while keeping the mention intact (like cutting the last name).
  • LinkedIn appends nothing. Suggests names only with @. Shows display names instead of handles, not sure if it allows modification (didn’t want to send an actual message cause I was testing on someone elses account).
  • Google Plus appends nothing. Suggests names with + or @, but replaces @ with a + automatically. Shows display names instead of handles, but does not allow modification.
  • Diaspora appends nothing. Suggests names only with @, but cuts the @ automatically. Shows display names instead of handles, but does not allow modification.

Other ways of doing it

  • Skype, YouTube, Reddit, Wikipedia, Pinterest, Snapchat, Meetup, Signal (to just include some other popular services) don’t do @mentioning or have their own mechanism for doing it which doesn’t use autocompletion (like Reddit’s /u/username).
  • Discourse suggests names only with @. Shows handles. Funnily enough it appends a space but puts the cursor before the space instead of after:
    Cursor position before @mention:

    Cursor position after @mention, note the extra space behind the name/cursor:

Conclusion

The two main ways of doing it have some different/opposing defining characteristics:

  1. Appending " " (a space). In that case the common other characteristics are:
  • Mostly a user handle is shown, sometimes a full/display name. This depends on which kind of name is prominently visible in other parts of the interface as otherwise it would be confusing.
  • You need to use a @ to get suggestions.
  • The @ is kept in front of the name.
  • You can not modify the handle or display name or it will break the mention.
  1. Appending nothing. In that case the common other characteristics are:
  • The full/display name is shown, not a user handle.
  • Names are suggested both with and without @.
  • The @ is cut from the front of the handle.
  • You can modify the name while keeping the mention intact, which is useful for cutting the last name if you want to be less formal.

In the case of Discourse, all defining characteristics of case 1 (appending a space) are fulfilled. Hence I would recommend to add the space, or rather also put the cursor behind the space. Or if you want to go for appending nothing, drive forward full/display names.

(Not appending a space based on anecdotal evidence that people like to add colons or apostrophes seems to be an edge-case. If you’re so inclined, you could run a metric across the Discourse Meta forum posts: What is the most common character after a user mention: 1) A space 2) A colon : 3) An apostrophe ’/’ 4) A sentence ending mark ./!/? 5) A slash / 6) A dash -/– 7) Something else?)

What do you think @erlend_sh @codinghorror?


(Sam Saffron) #9

I am fine to amend the autocompleter so it moves the cursor AFTER the space it appends. #pr-welcome


(Felix Freiberger) #10

There is a compromise between adding a space and not adding a space which I have not seen in @jancborchardt’s awesome list above: Add a space and place the cursor behind it, but watch what the user types next: If it is punctuation, silently remove the space. If the user types a single space, simply ignore it, assuming the user did not notice that the space was already there.

This is the behavior that is implemented by iOS when a word from the predictive typing suggestions is selected.


(Graham Perrin) #11

That’s a vaguely familiar set of behaviours but (sorry) at the time of writing, I can’t recall where I found the set. For me, it probably was not with iOS. Wherever it was: I recalled liking the behaviours.