Page MenuHomePhabricator

TemplateData editor shouldn't use comma to separate aliases
Closed, ResolvedPublic

Description

Currently, the TemplateData editor uses commas to separate parameter aliases. But the comma is a valid character to use in the parameter (alias) name, and this causes problems.

An example can be found by the link: https://ru.wikipedia.org/wiki/Шаблон:Трамвай/doc.
When you editing any parameter with an alias that contains a comma, this alias will be split into two.

For this reason, we need to use a delimiter character that will definitely not be used in the parameter name. There are quite a few such characters, and the most logical of them for separating values ​​is the pipe. It is also used to split aliases on Wikidata.

Event Timeline

@ECohen_WMDE Seems reasonable to me, but do you have usability suggestions? I don't personally want to type "|" any more often than needed... maybe "," is still the default separator and breaks the each parameter into a tag-pill as it is typed, but an immediate <backspace> after "," undoes the pill, making the text editable and appending a literal "," a la autotext.

Change 748093 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/TemplateData@master] Edit aliases via a proper widget instead of comma-separated

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

We implemented this for suggestedvalues already. Can't we just use that? There is no comma needed. The moment I press enter the input so far turns into a tag-pill. Backspace allows me to edit the last one.

https://gerrit.wikimedia.org/r/670461 was the patch that did this, T271897 the ticket.

We implemented this for suggestedvalues already. Can't we just use that?

Yes, that's the one. Thanks for pointing this out!

Change 748093 merged by jenkins-bot:

[mediawiki/extensions/TemplateData@master] Edit aliases via a proper widget instead of comma-separated

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

I agree it's the same problem that we decided to solve with the pill widget for suggested values. Makes sense to use the same here and keep it consistent!

awight renamed this task from TemplateData editor should use pipe to separate aliases to TemplateData editor shouldn't use comma to separate aliases.Jan 4 2022, 9:17 AM
thiemowmde claimed this task.