Page MenuHomePhabricator

Incomplete URLs for Custom translation suggestions do not fail gracefully
Closed, ResolvedPublic

Description

As part of the work to support Custom translation suggestions (T113257), the selection of filters is reflected in the URL (T369012). This is convenient in contexts such as Wikiprojects and events, to direct participants to specific topic areas. However, the current processing of the URL is not accommodating for errors, and any mistake results in filters being broken.

When all parameters are properly set (example) the URL works as expected. Below some examples based on variations of the previous URL to consider:

CaseResultNotes
filter-type is correct, but filter-id is not a valid topic ("invented" is used but it could be a topic that usedd to be valid in the past and was removed from ORES or just a typo, for example)
Screenshot 2024-10-25 at 10.04.21.png (634×1 px, 238 KB)
Filter options not shown in UI, error message in JS console.
filter-type is correct, but filter-id is missing
Screenshot 2024-10-25 at 10.03.00.png (633×1 px, 239 KB)
Filter options not shown in UI, error message in JS console.
filter-id is provided, but filter-type is missing
Screenshot 2024-10-25 at 10.22.12.png (637×1 px, 218 KB)
Suggestions not loading, filter options not shown in UI, error message in JS console.

This is problematic because the user gets a broken experience, and without the filtering UI they don't have a clear way to revert the issue.

Proposal

The following improvements are proposed:

  • Ignore incorrect parameters. A badly constructed URL such as those in the examples, should lead to the translation dashboard with the default filtering (same as if the filter parameters were not present at all).
  • When incorrect parameters are provided, a Mediawiki bubble notification will be shown to indicate the following: "Filters from the link are not valid. Check the options to filter the list of suggestions."
  • The "For you" and "Popular" seem to have their own filter-type and filter-id parameters with the same value. We may want to consider "For you", "Popular", and similar to be filter-type "automatic", and consider it as a default type so that a URL with filter-id="previous-edits" and no value for filter-type would still lead to "Popular" topics.

Event Timeline

Pginer-WMF triaged this task as Medium priority.Oct 25 2024, 8:42 AM
Pginer-WMF created this task.

Change #1085638 had a related patch set uploaded (by Sbisson; author: Sbisson):

[mediawiki/extensions/ContentTranslation@master] Validate filters in URL

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

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

[mediawiki/extensions/ContentTranslation@master] Use "automatic" filter type for "For you" and "Popular" filters

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

Change #1085638 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] Validate filters in URL

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

Change #1087192 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] Use "automatic" filter type for "For you" and "Popular" filters

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

Change #1087518 had a related patch set uploaded (by Sbisson; author: Sbisson):

[mediawiki/extensions/ContentTranslation@master] Case-insensitive URL filters validation

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

Change #1087519 had a related patch set uploaded (by Sbisson; author: Sbisson):

[mediawiki/extensions/ContentTranslation@master] topicGroupToFilterGroup: fix @return doc

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

Change #1087519 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] topicGroupToFilterGroup: fix @return doc

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

Change #1087518 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] Case-insensitive URL filters validation

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

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

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

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

Change #1089833 merged by jenkins-bot:

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

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

Nikerabbit subscribed.

For @Pginer-WMF as the reporter to check.

The cases described in the ticket are now well supported. Missing and incorrect parameters lead to the notification being shown and leading the user to the default selection with a functioning UI. Now the automatic group is considered the default, so omitting filter-type works too.

  NODES
Note 6
Project 7