Page MenuHomePhabricator

Add reactive notices and warnings in VE template dialog
Closed, ResolvedPublic1 Estimated Story Points

Description

Background

Currently, there are only two states with descriptions. Template descriptions from TemplateData and a message about templates missing TemplateData. We are expanding how many states/types of content get messages.

This is being done to give users better information about what they are seeing, why it looks the way it does and what they need to do next based on that. Each will also have links directly to relevant documentation for confusing terms and concepts.

Requirements

  • Add new notices and warnings, showing the various relevant ones as needed for each state described below. Use OOUI components: MessageWidget (type: 'notice') and (type: 'warning').
  • Show messages for single templates also when they are part of a transclusion with multiple parts (row 3 in the table below).
  • All links open in new tabs

Note: current no TemplateData message is removed in T288465: VE template dialog: Update description margins and help text

New mocks and text

StateMessageWidgetMockText
Single Templatewithout TemplateDataparams autogeneratedWarning
No TD-updated.png (1×1 px, 72 KB)
This template is missing TemplateData[3], and its parameters have been autogenerated[4]. As a result the template and its parameters lack descriptions. There might be additional information on this template’s page[1].
Single Templatewith OR without TemplateDatano parameters are documented OR params cannot be autogeneratedNotice
Undoc params input.png (642×800 px, 35 KB)
This template may be intended for use without parameters[2]. If this template does contain parameters, they are undocumented[4].
Template content (previously multi-part)--Notice
Linked template-updated.png (642×800 px, 47 KB)
You are currently editing a template and one or more pieces of connected content[4] (wikitext and/or additional templates).
Mocks and specs when combined
  • 48px between "chunks"
  • 16px between elements within "chunks"

Specs - vertical spacing.png (1×657 px, 119 KB)
Specs - vertical spacing2.png (1×657 px, 128 KB)

Links
[1] Link to the template page
[2] https://www.mediawiki.org/wiki/Help:Templates#Parameters
[3] https://www.mediawiki.org/wiki/Help:VisualEditor/User_guide#Template_parameters (content to be improved)
[4] (content to be created, link to documentation to come)

Event Timeline

Lena_WMDE set the point value for this task to 5.Mar 10 2021, 3:00 PM
Lena_WMDE renamed this task from DRAFT: Reactive notices/warnings/descriptions in VE to Reactive notices/warnings/descriptions in VE.Apr 14 2021, 1:50 PM
Lena_WMDE updated the task description. (Show Details)
ECohen_WMDE renamed this task from Reactive notices/warnings/descriptions in VE to Add reactive notices and warnings in VE template dialog.Aug 10 2021, 7:29 AM

Following up from story time: the TemplateData API does respond with a notemplatedata flag along with the list of autodetected template parameters. Currently, VE doesn't store this information but here's logic that already inspects the field: https://github.com/wikimedia/mediawiki-extensions-VisualEditor/blob/master/modules/ve-mw/dm/models/ve.dm.MWTransclusionModel.js#L348

We would just need to carry that flag through to the template spec model.

thiemowmde changed the point value for this task from 5 to 3.Aug 18 2021, 8:25 AM

Change 714349 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/extensions/VisualEditor@master] Add message on multipart content

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

General question: Should this be behind a feature flag? The one with the new sidebar? Or do we want to roll that out as soon as it gets merged and deployed by the train? @ECohen_WMDE @Lena_WMDE

@WMDE-Fisch great question - please put it behind a feature flag with the new sidebar.

[4] (content to be created, link to documentation to come)

Is also missing. I will leave this link out for now.

Is also missing. I will leave this link out for now.

Ya go ahead and leave out for now. I'm working on this at the moment but will just include this in the follow-up ticket with the others once the documentation has been updated since I'm not sure exactly when that's going to be. Currently have a placeholder but it needs work: T284985: Add links to documentation in help messages

Change 714367 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/extensions/VisualEditor@master] [WIP] Add notes and warning for missing paramter documentation

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

WMDE-Fisch moved this task from Doing to Sprint Backlog on the WMDE-TechWish-Sprint-2021-08-18 board.
WMDE-Fisch subscribed.

Change 714367 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/extensions/VisualEditor@master] [WIP] Add notes and warning for missing paramter documentation

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

Feel free to hijack ticket and patch.

Change 714349 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Add message on multipart content

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

Another question here @ECohen_WMDE @Lena_WMDE

This template is missing TemplateData[3], and its parameters have been autogenerated[4]. As a result the template and its parameters lack descriptions. There might be additional information on this template’s page[1].

Do we also show this message, when we have

  • no template data
  • autogenerated parameters
  • AND undocumented parameters?

For the latter case case we might want to extend the text. Or do we really just want to show this if we have exclusively autogenerated parameters?

Edit: Or this is a fourth case. Editing a template but it has only undocumented or auto-generated parameters

Change 714979 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/extensions/VisualEditor@master] Create title object for all cases on the template page

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

Change 714979 abandoned by WMDE-Fisch:

[mediawiki/extensions/VisualEditor@master] Create title object for all cases on the template page

Reason:

See comments

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

@WMDE-Fisch After some thought and talking through with Lena, we will go ahead and implement as-is.

If a template is auto-generated, then by definition it has not TD and is already undocumented. I'm not sure why (or even how?) someone would add a parameter which does not appear after the autogeneration since it is automatically pulling out all of the parameters which actually exist in the template.

Undocumented parameters are needed when either the template cannot be autogenerated or when a template has not been documented fully (either because it cannot or the TD needs editing).

In the rare case that template might show autogenerated parameters and somehow an undocumented one, then I think it's ok to simply show the autogen message. The undocumented parameters will be marked and the the undoc input will show, which has additional explanation.

Edit: Or this is a fourth case. Editing a template but it has only undocumented or auto-generated parameters

I'm not sure I understand this. Both of these cases are already covered.

Sorry for the late response but the TL;DR is to go ahead as originally laid out in the ticket so hopefully no extra work is created :)

All good, all questions answered. Thanks! :-)

Change 715716 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/extensions/VisualEditor@master] Make sure links in notices open in new tabs

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

WMDE-Fisch changed the point value for this task from 3 to 1.

Only last part of review left all other things done.

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

[mediawiki/extensions/VisualEditor@master] Fix \u2026TemplateSpecModel reporting missing pages as documented

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

In the context of T290140: Handling non-existing templates in the new dialog I just wanted to note here, that we're currently planing on not showing the This template may be intended for use without parameters[2]. If this template does contain parameters, they are undocumented[4]. message for templates that do not exist on the wiki.

Re: non-existing templates

In the context of T290140: Handling non-existing templates in the new dialog I just wanted to note here, that we're currently planing on not showing the This template may be intended for use without parameters[2]. If this template does contain parameters, they are undocumented[4]. message for templates that do not exist on the wiki.

Based on the discussion in storytime today we agreed on showing the undoc param input (and its associated instructions), but not this additional message. I would continue with that plan and leave this out.

Change 715938 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Fix \u2026TemplateSpecModel reporting missing pages as documented

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

Change 714367 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Add notes and warning for missing parameter documentation

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

Change 715716 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Make sure links in notices open in new tabs

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