# Tab-completion should automatically add a space after a username

**URL:** https://meta.discourse.org/t/tab-completion-should-automatically-add-a-space-after-a-username/45155
**Category:** UX
**Tags:** pr-welcome
**Created:** [2 ביוני,‏ 2016,‏ 7:01pm UTC](https://meta.discourse.org/t/tab-completion-should-automatically-add-a-space-after-a-username/45155 "2016-06-02T19:01:41Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![jancborchardt](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jancborchardt/32/57442_2.png) [@jancborchardt](https://meta.discourse.org/u/jancborchardt)
#### Post date: [2 ביוני,‏ 2016,‏ 7:01pm UTC](https://meta.discourse.org/t/tab-completion-should-automatically-add-a-space-after-a-username/45155/1 "2016-06-02T19:01:41Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2 ביוני,‏ 2016,‏ 7:41pm UTC](https://meta.discourse.org/t/tab-completion-should-automatically-add-a-space-after-a-username/45155/2 "2016-06-02T19:41:50Z")

</div>

Interesting, how do you feel about this @sam?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2 ביוני,‏ 2016,‏ 7:45pm UTC](https://meta.discourse.org/t/tab-completion-should-automatically-add-a-space-after-a-username/45155/3 "2016-06-02T19:45:44Z")

</div>

> [@jancborchardt](#):
>
> Currently I always find my self needing to manually insert a space after I mention a name and tab-complete it.

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.

> [@jancborchardt](#):
>
> Other platforms with @mentioning like Github and Twitter simply insert a space automatically

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

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [4 ביוני,‏ 2016,‏ 6:49pm UTC](https://meta.discourse.org/t/tab-completion-should-automatically-add-a-space-after-a-username/45155/4 "2016-06-04T18:49:44Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![jancborchardt](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jancborchardt/32/57442_2.png) [@jancborchardt](https://meta.discourse.org/u/jancborchardt)
#### Post date: [4 ביוני,‏ 2016,‏ 7:40pm UTC](https://meta.discourse.org/t/tab-completion-should-automatically-add-a-space-after-a-username/45155/5 "2016-06-04T19:40:33Z")

</div>

@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?)

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [6 ביוני,‏ 2016,‏ 9:34am UTC](https://meta.discourse.org/t/tab-completion-should-automatically-add-a-space-after-a-username/45155/6 "2016-06-06T09:34:02Z")

</div>

> [@jancborchardt](#):
>
> 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«.

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.

---

<div class="post-metadata">

### Author: ![jancborchardt](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jancborchardt/32/57442_2.png) [@jancborchardt](https://meta.discourse.org/u/jancborchardt)
#### Post date: [6 ביוני,‏ 2016,‏ 12:43pm UTC](https://meta.discourse.org/t/tab-completion-should-automatically-add-a-space-after-a-username/45155/7 "2016-06-06T12:43:34Z")

</div>

It doesn’t sound trivial to me, that’s why I’m bringing it up. 😉 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. 🙂

---

<div class="post-metadata">

### Author: ![jancborchardt](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jancborchardt/32/57442_2.png) [@jancborchardt](https://meta.discourse.org/u/jancborchardt)
#### Post date: [30 באפריל,‏ 2017,‏ 2:38pm UTC](https://meta.discourse.org/t/tab-completion-should-automatically-add-a-space-after-a-username/45155/8 "2017-04-30T14:38:58Z")

</div>

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

## 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. 🙂 )

### 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](https://about.gitlab.com/)** 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](https://ghost.org/)** seems to mostly use/encourage Disqus for commenting, although **[Discourse](http://www.discourse.org/)** is possible.
- **[Mastodon](https://mastodon.social/)** appends " " (a space). Suggests names only with @.
- **[Taiga](https://taiga.io/)** 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](https://riot.im/)** 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](https://nextcloud.com)** still needs to implement the auto-complete part and the current spec is to [add a space automatically](https://github.com/nextcloud/server/issues/2443).

### 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](https://joindiaspora.com/)** 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](https://www.reddit.com/)**, **[Wikipedia](https://www.wikipedia.org/)**, **Pinterest** , **Snapchat** , **Meetup** , **[Signal](https://signal.org/)** (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](http://www.discourse.org/) 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:  
 ![](https://global.discourse-cdn.com/meta/original/3X/b/8/b82d06aaa1c8cd30366af9aefbc749234fa488aa.png)  
Cursor position after @mention, note the extra space behind the name/cursor:  
 ![](https://global.discourse-cdn.com/meta/original/3X/c/7/c7f1cdab6d4d6b47118d8c2dab7c2c97a4553713.png)

## 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?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [30 באפריל,‏ 2017,‏ 11:49pm UTC](https://meta.discourse.org/t/tab-completion-should-automatically-add-a-space-after-a-username/45155/9 "2017-04-30T23:49:05Z")

</div>

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

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [1 במאי,‏ 2017,‏ 9:23am UTC](https://meta.discourse.org/t/tab-completion-should-automatically-add-a-space-after-a-username/45155/10 "2017-05-01T09:23:52Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![grahamperrin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/grahamperrin/32/71406_2.png) [@grahamperrin](https://meta.discourse.org/u/grahamperrin)
#### Post date: [1 במאי,‏ 2017,‏ 1:40pm UTC](https://meta.discourse.org/t/tab-completion-should-automatically-add-a-space-after-a-username/45155/11 "2017-05-01T13:40:01Z")

</div>

> [@fefrei](#):
>
> … 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. …

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.
