Page MenuHomePhabricator

Remove the colon at the end of mentions in Flow
Closed, ResolvedPublic1 Estimated Story Points

Description

The "mention" feature in Flow is very useful, but it forces a colon (as in {{ping|username}}) when in many contexts you don't want it (and this is why {{u|username}} exists. So far, I haven't found a way to get rid of the colon without removing the whole mention.

Would it be possible to remove that colon? If someone needs it, they can simply type it.

Event Timeline

Qgil raised the priority of this task from to Needs Triage.
Qgil updated the task description. (Show Details)
Qgil added a project: StructuredDiscussions.
Qgil subscribed.
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

The colon is part of the template. The template that is used is configurable via a MediaWiki message.

It can be configured for a particular wiki by editing MediaWiki:Flow-ve-mention-template. After doing so, wait five minutes, then hard refresh or clear your cache (it is cached in the startup module).

We could look at changing the default if we get more feedback. Note not all wikis have the same templates, nor do they necessarily have the same appearance/code even if the name is the same.

Mattflaschen-WMF triaged this task as Low priority.
Mattflaschen-WMF set Security to None.

Even if different wikis have different templates indeed, the need for flexibility is the same regardless of project/language. Sometimes you want to follow the IRC/IM style of communication using the mention with colon at the beginning of a sentence, sometimes you want to mention a user in other ways.

In fact, I would claim (without any data, subjectively) that mentions without colons are more frequent than mentions with colon. If the default template doesn't provide a colon, typing it is easy. If the default template provides a colon, removing it requires special permissions, and the removal will be for everybody, in all past, present, and future uses of that template in a wiki, making posted content look bad. So in practice, if a wiki starts using the template with colon, that colon will probably stay forever.

I think the correct decision is to remove the colon from the template now that we still have just a few Flow mentions in a few wikis.

Alright, I have no objection to that. If other people agree, there are basically two parts:

  1. Choose a new default template.
  2. Override template choice on any wikis where necessary (creating templates if necessary) to ensure no colon is used for new mentions.

@DannyH, this is one of those that looks trivial and unimportant today, but will grow as a snowball if there is no action upon it.

I agree, I've been annoyed by this myself. We'll talk about making this change. Quim, thanks for pointing it out.

DannyH raised the priority of this task from Low to Medium.Jun 2 2015, 4:38 PM
DannyH moved this task from Untriaged to Team discussion on the Collaboration-Team-Triage board.

I'm moving this to Bug queue because it's small and it's still bothering me.

Remember that the longer we keep this open, the more mentions we will have with an integrated colon, and the higher risk of upsetting someone will be when such colon is removed.

What other (existing) template do we want to use? Or do we want to create a new one on all those wikis?

I we have to use a template, then I would recommend to use https://www.mediawiki.org/wiki/Template:U

However, for such a simple action, do we really need to rely on templates at the mercy of wiki admins? What is wrong in using simply what U does (show the username linked to their user page)?

Yes, I agree. Just @[[Username]].

@[[User:Username|Username]] might work, but if so we have to rewrite the VE model integration which requires re-estimating this task. This is the right call if and only if we want to permanently enforce this convention on all wikis (there would no longer be any flexibility in appearance or behavior of the mention).

Also, there is nothing inherently tying templates to admins. Templates are unprotected by default, and templateeditor is a totally separate right.

It also means none of the existing templates would be editable (unless we support both template-based mentions and text-based mentions). Also, if someone manually types @[[User:Username|Username]] it will still behave and be editable as a mention (probably fine). Finally, this raw markup does not have the same wrapping behavior as Template:U (probably not a big deal).

Remember that the longer we keep this open, the more mentions we will have with an integrated colon, and the higher risk of upsetting someone will be when such colon is removed.

Only if we change an existing template, and fix transclusions to update when the template changes. We could instead add an additional recognized template, and make that the default when creating new mentions.

Alright, if simplifying this implementation is complicated at this point, then as a short term solution we can default to https://www.mediawiki.org/wiki/Template:U, which I believe is the exact match for the final result we want and it is available in most Wikimedia wikis.

Change 221607 had a related patch set uploaded (by Matthias Mullie):
Change mention inspector template

https://gerrit.wikimedia.org/r/221607

Just want to point out a couple of things here:

  • Template:U on most wikis is [[User:Username|Username]] (no @ in front of it)
  • hewiki has no Template:U
  • nlwiki has no Template:U & no Template:ping

I just put up a patch that changes the default to Template:U.
However, I think we should consider either:

-Note that if/when the patch for the new default template gets merged, the url to configure the template per wiki will change from: https://url/wiki/MediaWiki:Flow-ve-mention-template to https://url/wiki/MediaWiki:Flow-ve-mention-wiki-template (otherwise, it wouldn't get re-translated for other languages)

Hmm, that's too bad. I think we may have to bring this back to estimation to figure out.

We shouldn't use Template:U if that means we lose the @ sign, and some wikis don't have it anyway.

Hardcoding with @[[Username]] might be the right way to go, if the estimate isn't too bad. I don't have a problem with making it uneditable, because it's about as basic as it gets -- unless someone can think of a compelling case where a wiki might realistically need to change it.

The only concern I would have is that it should work correctly for RTL.

This is possibly a good time, to remind about T90055: [Spike] Changing the displayed username, in Flow and T95759: Auto-complete for alternate names in Flow mentions. I don't think our discussions about how to technically implement that, had come to any conclusions, and it might be relevant?

So what about creating a template that does exactly @[[Username]] and it's called i.e. FlowMentions, that would be created in every wiki where Flow is installed?

Updated the patch.

It will use Template:FlowMention (hardcoded, can't be configured per wiki)
There's also a script that will automatically create that template if it does not yet exist. Said template will be created as @[[User:name|name]] (but will accept a custom username as well, so we don't have to alter that template once we do T90055)

How about that?

Sounds like the best of both worlds (effective and simple to implement). Thank you @matthiasmullie!

It will use Template:FlowMention (hardcoded, can't be configured per wiki)
There's also a script that will automatically create that template if it does not yet exist. Said template will be created as @[[User:name|name]] (but will accept a custom username as well, so we don't have to alter that template once we do T90055)

How about that?

Seems fine.

I talked to Roan about this, we may have a simpler solution.

When you type @ or click on the mention icon, the modal pops up, you type the username.

When you insert, it injects wikitext in the form @[[User:Catrope|Catrope]]

We don't need a template for this. It's like bolding text, you press a button and it adds the appropriate wikitext. Can we do that?

Change 221607 merged by jenkins-bot:
Change mention inspector template

https://gerrit.wikimedia.org/r/221607

I reverted the patch (https://gerrit.wikimedia.org/r/#/c/223278/) since it looks like we'll want to hardcode it now.
I'll drag this back to Sprint E. Estimate will be a bit more than a 1, but shouldn't be huge.

Change 223363 had a related patch set uploaded (by Matthias Mullie):
Change mention inspector template

https://gerrit.wikimedia.org/r/223363

We're going to re-apply that patch, but make it translatable again. The script can create the appropriate template with the content language.

This will cause a temporary problem if someone changes the translation on TranslateWiki.net and there's no local override, but that can be easily fixed.

Change 223363 merged by jenkins-bot:
Change mention inspector template

https://gerrit.wikimedia.org/r/223363

QuimGil subscribed.

Template:FlowMention is missing at least in ca.wiki and pt.wiki, and this breaks mentions now -- see T106575: Template:FlowMention missing, new mentions of users are broken.

Reopening just to highlight that this is unfinished / urgent / important.

Re-resolving: the template has been created on the wikis where it was missing. There's also another card (T106575) to track this now.