Page MenuHomePhabricator

Handle "no parameter" templates
Closed, InvalidPublic3 Estimated Story Points

Description

  • If template has TemplateData and no parameters, show 'No parameters' text for that template, instead of checkboxes.
  • This text is not interactable
  • Separate label for each no-parameter template when multiple templates are shown.
  • Doesn't interfere with other templates' parameters.

Mock

No params.png (642×800 px, 25 KB)

Related Objects

StatusSubtypeAssignedTask
OpenNone
ResolvedWMDE-Fisch
ResolvedWMDE-Fisch
ResolvedAndrew-WMDE
ResolvedWMDE-Fisch
ResolvedAndrew-WMDE
ResolvedBUG REPORTawight
OpenNone
OpenNone
InvalidNone
ResolvedWMDE-Fisch
ResolvedLena_WMDE
ResolvedNone
Resolvedawight
ResolvedAndrew-WMDE
InvalidNone
Resolvedthiemowmde
ResolvedECohen_WMDE
OpenNone

Event Timeline

WMDE-Fisch set the point value for this task to 2.Jul 20 2021, 10:38 AM
WMDE-Fisch moved this task from Doing to Sprint Backlog on the WMDE-TechWish-Sprint-2021-07-21 board.
WMDE-Fisch added a subscriber: WMDE-Fisch.

Not done much here. Just some talking and looking into it. We decided to add a hasTemplateData property to the spec class to differentiate if a template has template data that could be loaded so we can assume if no parameters are intended from the data.

There is no recourse in the case that a template has no-parameter TemplateData. This could theoretically happen by accident (e.g. documenting the purpose of a Lua-wrapping template but without listing parameters explicitly). Might be fine, but we could also improve the text to explain how to remedy, by editing the TemplateData and adding the parameters.

A side note, TemplateData has no annotation for "this template accepts arbitrary parameters", or variable args, which I believe does apply in a few cases.

Where does "parameters" link to in the new interface message? A page about how template parameters work or maybe a TemplateData editor to add them to the template's documentation?

Or is this an example template description, not a generalized message?

Change 708982 had a related patch set uploaded (by Awight; author: Awight):

[mediawiki/extensions/VisualEditor@master] Accessor to track whether a template has TemplateData

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

What is the desired behavior if the TemplateData documents no parameters, but there are already actual parameters in the invocation? I think we'll need to show checkboxes, so the template should just behave normally?

Where does "parameters" link to in the new interface message? A page about how template parameters work or maybe a TemplateData editor to add them to the template's documentation?

Or is this an example template description, not a generalized message?

It will link to the updated documentation pages (not sure right now if it will be VE template dialog pages or TemplateData pages but @ECohen_WMDE will be able to confirm when she's back).

What is the desired behavior if the TemplateData documents no parameters, but there are already actual parameters in the invocation? I think we'll need to show checkboxes, so the template should just behave normally?

Are there cases in which this happens and actually works/is intended to work? If yes, the current help message seems misleading and maybe needs to be reviewed.

Change 709020 had a related patch set uploaded (by Awight; author: Awight):

[mediawiki/extensions/VisualEditor@master] Show \"no parameters\" text

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

Change 709021 had a related patch set uploaded (by Awight; author: Awight):

[mediawiki/extensions/VisualEditor@master] Disable toolbar \"add parameter\" button when no parameters allowed

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

Change 709022 had a related patch set uploaded (by Awight; author: Awight):

[mediawiki/extensions/VisualEditor@master] Suppress content \"add parameter\" when template takes no parameters

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

It will link to the updated documentation pages (not sure right now if it will be VE template dialog pages or TemplateData pages but @ECohen_WMDE will be able to confirm when she's back).

Okay, I'll create a placeholder message with TBD content and link.

What is the desired behavior if the TemplateData documents no parameters, but there are already actual parameters in the invocation? I think we'll need to show checkboxes, so the template should just behave normally?

Are there cases in which this happens and actually works/is intended to work? If yes, the current help message seems misleading and maybe needs to be reviewed.

I can't say off-hand whether this is ever supposed to happen, probably not, but it's simple and probable that people will hit this case, and if it does happen then it seems we should revert to the normal, "maybe has parameters" behavior otherwise we will be hiding actual parameters etc.

Change 709035 had a related patch set uploaded (by Awight; author: Awight):

[mediawiki/extensions/VisualEditor@master] Show long message about \"no parameters\" templates

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

awight changed the point value for this task from 2 to 3.Aug 2 2021, 7:17 AM

Waiting on discussions in progress:

  • If the template invocation already includes parameters, disable "no parameters" logic? [question repeated from above]
  • Edit long message "This template has no parameters and is meant to be used without them.", to be less authoritative and more descriptive or explanatory, e.g. "... and has no parameters listed in its <a>documentation."
  • Should we add a new flag in TemplateData such as allowsAdditionalParameters (defaults to true), providing a way to explicitly document an exhaustive parameter list (can be empty), and that no additional parameters should be passed?

And depending on the last question, there might be an investigation to learn whether the TemplateData API tells us whether its response was auto-detected or explicit.

Closing this as invalid because the implementation plan has changed. Requirements updated in T272487: New input for undocumented parameters to include this state (template with TD but no documented parameters) to show the undoc param input and associated notice. Wording to be updated there as well to cover this situation better and message to be changed from warning to notice as it's likely that nothing is actually wrong or needs fixing.

Change 709020 abandoned by Thiemo Kreuz (WMDE):

[mediawiki/extensions/VisualEditor@master] Show \"no parameters\" text

Reason:

I believe this is obsolete. The ticket was closed as invalid.

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

Change 708982 abandoned by Thiemo Kreuz (WMDE):

[mediawiki/extensions/VisualEditor@master] Accessor to track whether a template has TemplateData

Reason:

Obsolete via I39c6123.

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

Change 709022 abandoned by Thiemo Kreuz (WMDE):

[mediawiki/extensions/VisualEditor@master] Suppress content \"add parameter\" when template takes no parameters

Reason:

I believe this is obsolete. The ticket was closed as invalid.

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

Change 709035 abandoned by Thiemo Kreuz (WMDE):

[mediawiki/extensions/VisualEditor@master] Show long message about \"no parameters\" templates

Reason:

I believe this is obsolete. The ticket was closed as invalid.

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

Change 709021 abandoned by Thiemo Kreuz (WMDE):

[mediawiki/extensions/VisualEditor@master] Disable toolbar \"add parameter\" button when no parameters allowed

Reason:

I believe this is obsolete. The ticket was closed as invalid.

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