Page MenuHomePhabricator

Label aliases as aliases (VE dialog)
Closed, InvalidPublic3 Estimated Story Points

Description

Requirements

  • If alias is used in the wikitext for a parameter, show the alias when displaying the parameter in the dialog instead of the label.
  • Add a note displays which explains "(Alias of $Parameter label)". If the parameter has no label, then "(Alias of $Parameter name)". Match styling of the undocumented parameter note.

Situation:

Screen Shot 2022-05-25 at 10.17.37.png (197×512 px, 34 KB)
Screen Shot 2022-05-25 at 10.18.53.png (244×700 px, 27 KB)

Currently:

Screen Shot 2022-05-24 at 09.30.56.png (1×1 px, 308 KB)

Mock:
Alias label.png (773×916 px, 82 KB)

Event Timeline

ECohen_WMDE renamed this task from Adjust handling of parameter aliases (VE dialog) to Label aliases as aliases (VE dialog).May 25 2022, 2:11 PM
WMDE-Fisch set the point value for this task to 3.Jun 1 2022, 9:51 AM

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

[mediawiki/extensions/VisualEditor@master] Change template model to not merge conflicting aliased parameters

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

@ECohen_WMDE:

  • Note that this change will make the human-readable label pretty much invisible. The only place where the label is still shown is that little gray addendum. Just because there is an alias in the wikitext – something most VisualEditor users never see. Not saying there is anything wrong, just to document this.
  • The task description misses the quotes around the primary parameter name. I think we should use quotes. While we are not 100% consistent about this, most messages that mention template or parameter names also use quotes.
  • I find the capitalization odd. I think this applies: "If a parentheses interrupts the middle of a sentence, do not capitalize the first letter." Which means (alias of "$1") and (undocumented parameter). Is this ok for you?

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

[mediawiki/extensions/VisualEditor@master] Label aliases in the template dialog as aliases

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

Change 804264 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Change template model to not merge conflicting aliased parameters

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

@ECohen_WMDE We found an interesting edge case. When positional parameters are given, VE would nicely render these parameters using the canonical name. After implementing the feature as specified here, we're exposing the raw positional numbers which never appear in wikitext. I think this could potentially be more confusing, and be considered as a regression. For example, the wikitext {{Foo|surprise}} is displayed in the dialog as:

image.png (326×578 px, 26 KB)

@ECohen_WMDE, here are some more real-world examples.

de:Template:Tagesdifferenz is typically used with unnamed positional parameters: {{Tagesdifferenz|2022|02|01|2022|03|01}} in articles, because that's just convenient. This example calculates the difference between the two dates. The template also allows named parameters, e.g. {{Tagesdifferenz|Tag1=…|Monat1=…|Jahr1=…|…}}. But this is rarely used. Still the named parameters are documented as the primary parameter names via TemplateData. The positional parameters 1, 2 and so on are documented as aliases.

Before the changes specified in this ticket both would look the exact same in VisualEditor. We see the human-readable labels (e.g. "Jahr (1)") but never the internal parameter names (neither 1 nor Jahr1).

Screenshot from 2022-06-20 13-26-58.png (318×487 px, 35 KB)

After:

Screenshot from 2022-06-20 13-27-12.png (514×493 px, 45 KB)

Another example using de:Template:YouTube. Before:

Screenshot from 2022-06-20 13-40-42.png (639×867 px, 96 KB)

After:

Screenshot from 2022-06-20 13-40-30.png (642×867 px, 98 KB)

Questions:

  • What do we want to achieve with this change? This started as a discussion about duplicates. But it seems like it turned into "all templates should look the same to VisualEditor users as they look to wikitext users" or something like that. Is this what was requested?
  • We currently do this no matter if a duplicate exists or not. Is this really necessary? It seems like we should limit this behavior to situations that actually involve duplicates.
  • Maybe we can turn the message "X (alias of Y)" around and make it say "Y (used as X in the wikitext)"? This would emphasize the fact that there is a duplicate (the sidebar would again show two "Y") while still making them distinguishable on the right side.

I would echo Thiemo's concerns, and also:

What do we want to achieve with this change? This started as a discussion about duplicates.

I would say that even when there are duplicates, perhaps it's *better* to show them as the same label in the sidebar, and in the content pane do something like "Fancy Label (used as 'foo')" and "Fancy Label (used as 'alias-foo')", so that it becomes more obvious that there's a problem with the template invocation. Why would we make an incorrect (corner) case easier to use? Instead, we can highlight that there's a problem.

Lets talk about that in the next story time and let the patch wait until we have decided the next step. I would not want us to merge something now, that gets deployed tomorrow and where we decide against on later.

Lets talk about that in the next story time and let the patch wait until we have decided the next step. I would not want us to merge something now, that gets deployed tomorrow and where we decide against on later.

This sounds like a good plan @WMDE-Fisch

We've decided not to go ahead with change due to the issues listed above. Change as it is described (show aliases instead of label) should not be merged. Still to consider: whether to indicate aliases when a duplicate is detected.

We've decided not to implement a warning message or indication for when a duplicate is detected.

Change 804576 abandoned by Thiemo Kreuz (WMDE):

[mediawiki/extensions/VisualEditor@master] Label aliases in the template dialog as aliases

Reason:

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