Page MenuHomePhabricator

Custom translation suggestions: Search
Open, MediumPublic

Assigned To
Authored By
Pginer-WMF
Jul 9 2024, 7:45 AM

Description

As part of the work to support Custom translation suggestions (T113257), users can define their areas of interest in order to get relevant suggestions. While the initial support for topic selection allows users to select one (T368422) or more (T369268) topics from a list. This ticket is focused on the support for users to search for a specific filter to apply.

Searching allows for users to find topic areas across a much wider topic space. They should be able to search for:

  • Any of the items present in the "Adjust suggestions" menu (i.e., users can search for the "Videogames" option as a quick way to select this filter with no need for browsing).
  • Any Wikidata topic to get similar suggestions to it.
  • Lists of topics as part of group translation activities such as campaigns and wiki projects. This will be supported as part of the corresponding ticket about group translation support.

Search - One selection.png (985×2 px, 290 KB)

The core steps of the search process are illustrated below:

Search - One selection - Core steps.png (1×1 px, 97 KB)

  • Initial. A Search input component is used with a "Search topics or collections" placeholder.
  • Focused. The focused state will follow the usual behaviour in the Search input component (e.g., the input focus will result into the virtual keyboard showing on mobile).
  • Search results. Once the user provides some input, the elements below the Search input will be replaced by the search results. Some considerations:
    1. Clearing the search:
      • Clear option ("x" icon) appears when text is present
      • Clearing returns to previous state
      • Implemented using the "end icon" property of Text input element -Loading.
    2. Result structure:
      • The result items. The results will be displayed using the Menu item element.
      • Flat list structure without group headers
      • Visual differentiation through icons and metadata
      • Result appear in order of relevance(article, topic, collections)
    3. Result types and presentation:
      • Wikipedia/Wikidata articles:
        • Thumbnail when available
        • Title: Article name, 1 line, If more, truncate.
        • Secondary text: 1 line article description. If more, truncate.
      • Topic areas:
        • Search icon.
        • Title: Topic name, 1 line, If more, truncate.
        • Secondary text: "Topic • Browse articles
      • Collections:
        • Article group icon(icon name - cdxIconArticles)
        • Title: Collection name, 1 line, If more, truncate.
        • Secondary text: "Collections • [X] articles

Event Timeline

In the design, 'Search for a topic' is about searching a topic like "Arts", "Maths", "Geography" (as in https://www.mediawiki.org/wiki/ORES/Articletopic)?
Should the user type an article title like London_Fashion_Week. From the example "Cubism" I assume it is about searching an article and then use that as a seed for suggestions.

Any Wikidata topic to get similar suggestions to it.

We mean wikidata items like https://www.wikidata.org/wiki/Q42934 (Cubism) right?

Also, should "Areas" match with the terminology in recommendation system - ie Collection?

In the design, 'Search for a topic' is about searching a topic like "Arts", "Maths", "Geography" (as in https://www.mediawiki.org/wiki/ORES/Articletopic)?
Should the user type an article title like London_Fashion_Week. From the example "Cubism" I assume it is about searching an article and then use that as a seed for suggestions.

Search is intended to help users find different 3 different types of content that help them customize their suggestions:

  1. An ORES-based topic. "Arts", "Maths", or "Geography" from ORES/Articletopic. This is the same as choosing those from the filters in the menu. That is, to select Geography-related tickets you could tap the "Geography" option or search for it.
  2. A Wikipedia article/Wikidata item. Searching for Cubism will find the Wikipedia article for Cubism (or the Wikidata item associated) and use it as a seed to find suggestions similar to it.
  3. A Collection. Lists of articles/Wikidata IDs that are created by the community. For example, "Planets of the solar system" can be a collection created by the community for the Wiki Astronomy Week.

Any Wikidata topic to get similar suggestions to it.

We mean wikidata items like https://www.wikidata.org/wiki/Q42934 (Cubism) right?

Yes.

Also, should "Areas" match with the terminology in recommendation system - ie Collection?

We need to review the labels as we are exploring this space and the terms are solidifying.
As I mentioned above, we have 3 types of content that we may want to differentiate in some way. For example, someone searching for "Geography" can find in the results the 'Geography' ORES topic, the Wikipedia Geography article and maybe a collection named Geography too.

The original designs were grouping results in two groups: topics (for Wikipedia articles/Wikidata items) and areas (for ORES items and Collections). We can adjust the naming and/or the grouping (e.g., 3 separate groups instead of 2).

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

[research/recommendation-api@master] Add endpoint to fetch all page collections with their metadata

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

Change #1084155 merged by jenkins-bot:

[research/recommendation-api@master] Add endpoint to fetch all page collections with their metadata

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

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

[mediawiki/extensions/ContentTranslation@master] Add api method to fetch page collections

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

Change #1084205 abandoned by Nik Gkountas:

[mediawiki/extensions/ContentTranslation@master] Add api method to fetch page collections

Reason:

squashed into Ie0e7c54cde4ce0d76b28831393a994ecc1968149

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

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

[operations/deployment-charts@master] Update recommendation-api to 2024-11-06-190017-production

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

Change #1088276 merged by jenkins-bot:

[operations/deployment-charts@master] Update recommendation-api to 2024-11-08-142328-production

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

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

[mediawiki/extensions/ContentTranslation@master] add search for custom suggestion filters

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

SGautam_WMF subscribed.

We have simplified the search result presentation based on the feedback. Unlike initial proposed design, now we are presenting search results as a flat list. Users can differentiate between types of search results based on the different icons and secondary information available. Rest of the flow stays the same here.

Change #1090941 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] Add search for custom suggestion filters

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

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

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

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

Change #1118478 merged by jenkins-bot:

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

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

@Pginer-WMF @ngkountas, I am currently testing this story. This will require much more test scenarios than I initially thought. If your sprint ends tomorrow can we move this ticket? if not please you can ignore my request.

cc @GMikesell-WMF

Test status: QA PASS

  • Checked the empty state message for a wiki
  • users are able to search for a topic of interest
  • checked the popular state
  • checked the "for you" and more combination
  • checked the "popular" and more combination
  • users are able to search topics using the different sections : Automatic, Collections, Regions, Culture, History and Society, Science, technology and math ( Each selection displays contents related to it under the "Create new pages" and "Expand with new sections" )
  • When a section is selected ( e.g climate under collections) and user switches from "Suggestion" to "In progress" or "Published" and returns back to Suggestions, the state is maintained.

    Recommendation:
  • When searching for a topic that returns no results, it shows a blank white screen. Some kind of message to let the user know that the search keywords should be revise as this returns no results

Lovely feature and implementation team.

I did create a defect ( T388257 ) from this ticket but does not affect this implementation

Screenshot 2025-03-07 at 9.44.09 AM.png (845×1 px, 208 KB)

Screenshot 2025-03-07 at 9.39.48 AM.png (645×1 px, 90 KB)

Screenshot 2025-03-07 at 9.40.57 AM.png (869×1 px, 144 KB)

Screenshot 2025-03-07 at 9.42.52 AM.png (841×1 px, 166 KB)

Screenshot 2025-03-07 at 10.10.51 AM.png (819×593 px, 35 KB)

The general functionality seems in place. Some details on labelling captured below:

The search placeholder

The placeholder should be "Search topics and collections".

CurrentProposed
bn.wikipedia.org_w_index.php_title=Special_ContentTranslation&active-list=suggestions&filter-id=previous-edits&filter-type=automatic&from=en&to=bn(Wiki Mobile).png (568×320 px, 44 KB)
bn.wikipedia.org_w_index.php_title=Special_ContentTranslation&active-list=suggestions&filter-id=previous-edits&filter-type=automatic&from=en&to=bn(Wiki Mobile) (1).png (568×320 px, 44 KB)

The list of results

Once the user provides a search query (e.g., "Food") results of different kinds can be shown. The following adjustments are needed to align with the above specs:

  • Remove labels for the groups. Note that the "Topics" and "Areas" headings are removed in the example below, but the results are still provided with all the results of the same type together.
  • Adjust position, icon and description for the default topic areas. A topic area such as "Food and drink" in the example below should (a) be displayed before community-created collections, (b) use the search icon, and (c) use "Topic • Browse articles" as the description.
  • Add description for collections. Collections should include a "Collection • X articles" where X is the number of articles of such collection.
CurrentProposed
bn.wikipedia.org_w_index.php_title=Special_ContentTranslation&active-list=suggestions&filter-id=previous-edits&filter-type=automatic&from=en&to=bn.png (800×320 px, 66 KB)
bn.wikipedia.org_w_index.php_title=Special_ContentTranslation&active-list=suggestions&filter-id=previous-edits&filter-type=automatic&from=en&to=bn (3).png (800×320 px, 68 KB)

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

[mediawiki/extensions/ContentTranslation@master] Suggestion filters search: Fix inconsistencies with specifications

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