Page MenuHomePhabricator

Explain the template mapping status
Closed, ResolvedPublic

Description

As part of the support for templates in Section Translation (T275374), a custom card will be provided for block templates (T294650). This card shows a "Mapping success indicator" to communicate how well the information on the template could be transferred across languages.

For the template card, this indicator is presented as an icon and a circle to communicate status and percentage of the mapping. This may be enough once users get familiar but it is not self-explanatory. Thus, this ticket proposes to make such indicator clickable and show a clarifying panel to make the information more explicit.

Mapping explained.png (768×1 px, 95 KB)

Design details

The panel will include:

  • The indicator
  • Overview. An explanation about the success of the mapping: total, partial, no mapping and no template.
  • Parameter counter. The number of parameters that can be transferred from the source template.
  • Additional context. The number of parameters form the target that must be filled (mandatory) or can be filled (optional), if any.
  • Actions to close and learn more (leading to a documentation page to learn more about the whole mapping process).

The diagram below illustrates the different combinations considering the optional pieces and conditions:

Mapping explained details.png (1×3 px, 246 KB)

Some variants (not illustrating all combinations) are shown below:

Mapping explained examples.png (768×2 px, 108 KB)

Event Timeline

Change 841558 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/services/cxserver@master] Add mandatory and optional target params inside template data-cx attr

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

Change 841852 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] SX block templates: Add template mapping status explanation dialog

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

Change 841558 merged by jenkins-bot:

[mediawiki/services/cxserver@master] Add mandatory and optional target params inside template data-cx attr

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

Change 850315 had a related patch set uploaded (by KartikMistry; author: KartikMistry):

[operations/deployment-charts@master] Update cxserver to 2022-10-27-102021-production

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

Change 850315 merged by jenkins-bot:

[operations/deployment-charts@master] Update cxserver to 2022-10-27-102021-production

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

Change 851053 had a related patch set uploaded (by KartikMistry; author: KartikMistry):

[operations/deployment-charts@master] Update cxserver to 2022-10-31-083825-production

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

Change 851053 merged by jenkins-bot:

[operations/deployment-charts@master] Update cxserver to 2022-10-31-083825-production

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

Change 841852 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] SX block templates: Add template mapping status explanation dialog

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

Change 853935 had a related patch set uploaded (by Santhosh; author: Santhosh):

[mediawiki/extensions/ContentTranslation@master] CX3 Build 0.2.0+20221107

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

Change 853935 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX3 Build 0.2.0+20221107

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

@ngkountas In the template dialog like the ones attached , there are no buttons for the "learn more", "Done" or "Open in wikidata" ( As shown in the sample above )

or was this not part of the scope for the first delivery ?

Screen Shot 2023-01-11 at 11.09.14 PM.png (770×1 px, 163 KB)

Screen Shot 2023-01-11 at 10.55.56 PM.png (733×1 px, 180 KB)

Screen Shot 2023-01-11 at 11.07.39 PM.png (759×1 px, 182 KB)

@Pginer-WMF as Emeka indicates above, currently the dialog for explaining the template status is missing the "actions" row at the bottom. The button for opening the template in wikidata is also missing, for cases with no equivalent templates. Since the link for the "Learn more" button is not present in the task description (and maybe the description for the expected behaviour when clicking on the "Open in wikidata" button could be enhanced), do you think it's better to create a follow-up ticket with the remaining details or we'd better resolve those issues in this task?

@Pginer-WMF as Emeka indicates above, currently the dialog for explaining the template status is missing the "actions" row at the bottom. The button for opening the template in wikidata is also missing, for cases with no equivalent templates. Since the link for the "Learn more" button is not present in the task description (and maybe the description for the expected behaviour when clicking on the "Open in wikidata" button could be enhanced), do you think it's better to create a follow-up ticket with the remaining details or we'd better resolve those issues in this task?

Makes sense. I already created a follow-up task: T326796: Provide additional actions when explaining the template mapping status
So we can consider these buttons out of the scope for now.
Given the diversity of templates and the complexity of the process, I'd recommend for the QA to test with a diverse set of examples and try to include information that helps to verify the mapping described represents hat actually happened. That is, sharing which parameters got information copied over, whether the template was missing in Wikidata for the language, etc.

Yes I agree. The idea here will be to test with different examples and clearly outline the mapping. Thank you

Tried with further examples. Please go through if there are other aspects I missed and feel free to put back into QA column

Thanks for reviewing this and providing examples @EChukwukere-WMF .

All the cases illustrated in the document seem to work as expected, except one:

Screenshot 2023-03-30 at 09.01.12.png (690×1 px, 207 KB)

There the circle is shown as complete while there are still some mandatory parameters to fill. This. does not align with the criteria described in the "Mapping success " section at T294650:

success_percentage = source_filled_parameters_successfully_mapped / (source_filled_parameters + target_mandatory_empty)

In the example there are 6 parameters in the source template (all of which are successfully transferred) and 7 mandatory parameters in the target template to be filled. The success percentage would be calculated as:

success_percentage = 6 / (6 + 7) = 6/13 = 46%

However, the circle in the screenshot suggests 100% instead.

Moving back to development as a whole ticket to check all cases again after the fix (to make sure nothing breaks for other calculations currently working)

@ngkountas, please let us know if more details are needed to identify the problematic case in addition to the screenshot above. Thanks!

Change 904521 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] SX Block template adaptation: Fix success percentage

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

Change 904521 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] SX Block template adaptation: Fix success percentage

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

Test Status: QA PASS ( After retesting)

@Pginer-WMF apparently the above issue you mentioned was showing the wrong template. Now I am unable to reproduce it as its showing the right template as shown below

@ EChukwukere-WMF thanks for checking. As we try new translations it would be good to keep an eye on how the different templates are represented. I added it as part of T296719, to have a set of examples that can be automated in the future to catch any regression.

One aspect that seems missing in the different cases is the footer where the "Learn more" and "Done" buttons are expected to be.
@ngkountas, do you prefer a separate ticket to be created for this?

@Pginer-WMF Sure, I will prefer a separate ticket for that, but lets see what Nik has to say. Thank you