Page MenuHomePhabricator

Custom translation suggestions: Search
Closed, ResolvedPublic8 Estimated Story Points

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

Derived Requirement

Enable users to search for translation suggestion filters by integrating a search component into the "Adjust suggestions" interface. The search functionality must allow users to locate:

  • Specific topics (e.g., “Videogames”) from the predefined list
  • Wikidata-based topics
  • Collections (e.g., campaign or wiki project article groups)

The search should return relevant results with visual cues (icons, titles, descriptions), support clearing input, and follow accessibility and UI consistency standards.

Test Steps

Test Case 1: Ensure search input is visible with correct placeholder

  1. Navigate to the Translation Dashboard.
  2. Click "Adjust suggestions".
  3. ✅❓❌⬜ AC1: Confirm that a search input field is visible with the placeholder text *"Search topics or collections"*.

Test Case 2: Verify keyboard focus behavior on mobile

  1. On a mobile device or emulator, tap the search input field.
  2. ✅❓❌⬜ AC2: Confirm that the virtual keyboard appears and the input is focused.

Test Case 3: Validate search results display for known topics

  1. Enter a topic name (e.g., *Videogames*) in the search input.
  2. ✅❓❌⬜ AC3: Confirm that a result appears for the topic, with a search icon, topic title (1 line max), and secondary text “Topic • Browse articles”.

Test Case 4: Validate search results display for Wikidata article

  1. Enter a known article name (e.g., *Albert Einstein*) in the search input.
  2. ✅❓❌⬜ AC4: Confirm that the result includes a thumbnail (if available), article title, and a 1-line description.

Test Case 5: Validate search results display for collections

  1. Enter a collection name (e.g., *Women in STEM*) in the search input.
  2. ✅❓❌⬜ AC5: Confirm that the result includes an article group icon, the collection name, and a secondary text like “Collections • \[X] articles”.

Test Case 6: Ensure results are sorted by relevance

  1. Search for a keyword common to multiple types (e.g., *Science*).
  2. ✅❓❌⬜ AC6: Confirm that the most relevant item types (e.g., articles, then topics, then collections) appear in that order.

Test Case 7: Validate clear functionality in the input field

  1. Type any text into the search input.
  2. Click the "x" icon that appears on the right.
  3. ✅❓❌⬜ AC7: Confirm that the input is cleared and the UI returns to the pre-search state.

Test Case 8: Verify truncation behavior for long titles/descriptions

  1. Search for an item with a long name and description.
  2. ✅❓❌⬜ AC8: Confirm that titles and descriptions are truncated to a single line with ellipsis if needed.

Test Case 9: Confirm visual consistency across result types

  1. Search for a mixed keyword (e.g., *History*) with multiple result types.
  2. ✅❓❌⬜ AC9: Confirm each result type (topic, article, collection) uses its corresponding icon and visual structure.

Test Case 10: Validate accessibility standards

  1. Use keyboard navigation (Tab, Enter) to focus on the search input and navigate results.
  2. ✅❓❌⬜ AC10: Confirm that all elements are reachable and actionable via keyboard.

QA Results - Test Wiki

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

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

Change #1137011 merged by jenkins-bot:

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

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

Change #1141940 had a related patch set uploaded (by Eamedina; author: Eamedina):

[mediawiki/extensions/ContentTranslation@master] CX3 Build 1.0.0+20250505

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

Change #1141940 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX3 Build 1.0.0+20250505

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

@ngkountas There were a few issues that I came across in AC1, AC8 & AC10. If you have any questions, please let me know

Test Result - Test Wiki

Status: ✅ PASS / ❓Need More Info / ❌ FAIL
Environment: Test Wiki
OS: macOS Sequoia 15.6
Browser: Chrome 136
Device: MBA
Emulated Device: NA

Test Artifact(s):

https://test.wikipedia.org/w/index.php?title=Special:ContentTranslation&active-list=suggestions&campaign=specialcx&filter-id=previous-edits&filter-type=automatic&from=en&to=cs#/

Test Steps

Test Case 1: Ensure search input is visible with correct placeholder

  1. Navigate to the Translation Dashboard.
  2. Click "Adjust suggestions".
  3. AC1: Confirm that a search input field is visible with the placeholder text *"Search topics or collections"*.

I would assume that was the previous placeholder text and now it's "Search for collections, regions or topics"

2025-06-03_09-35-01.png (419×401 px, 35 KB)

Test Case 2: Verify keyboard focus behavior on mobile

  1. On a mobile device or emulator, tap the search input field.
  2. AC2: Confirm that the virtual keyboard appears and the input is focused.

2025-06-03_09-39-50.mp4.gif (1×630 px, 1 MB)

Test Case 3: Validate search results display for known topics

  1. Enter a topic name (e.g., *Food*) in the search input.
  2. AC3: Confirm that a result appears for the topic, with a search icon, topic title (1 line max), and secondary text “Topic • Browse articles”.

2025-06-03_09-41-25.mp4.gif (846×406 px, 190 KB)

Test Case 4: Validate search results display for Wikidata article

  1. Enter a known article name (e.g., *Albert Einstein*) in the search input.
  2. AC4: Confirm that the result includes a thumbnail (if available), article title, and a 1-line description.

2025-06-03_09-42-40.png (634×402 px, 68 KB)

Test Case 5: Validate search results display for collections

  1. Enter a collection name (e.g., *Wiki99/food*) in the search input.
  2. AC5: Confirm that the result includes an article group icon, the collection name, and a secondary text like “Collections • \[X] articles”.

2025-06-03_09-45-01.mp4.gif (494×398 px, 101 KB)

Test Case 6: Ensure results are sorted by relevance

  1. Search for a keyword common to multiple types (e.g., *Science*).
  2. AC6: Confirm that the most relevant item types (e.g., articles, then topics, then collections) appear in that order.

2025-06-03_09-46-08.png (715×400 px, 80 KB)

Test Case 7: Validate clear functionality in the input field

  1. Type any text into the search input.
  2. Click the "x" icon that appears on the right.
  3. AC7: Confirm that the input is cleared and the UI returns to the pre-search state.

gif

2025-06-03_09-47-07.mp4.gif (692×400 px, 226 KB)

Test Case 8: Verify truncation behavior for long titles/descriptions

  1. Search for an item with a long name and description.
  2. AC8: Confirm that titles and descriptions are truncated to a single line with ellipsis if needed.

They do not truncate to a single line with ellipsis

❌Title❌Description
2025-06-03_09-49-44.png (741×401 px, 67 KB)
2025-06-03_09-51-15.png (642×400 px, 68 KB)

Test Case 9: Confirm visual consistency across result types

  1. Search for a mixed keyword (e.g., *Technology*) with multiple result types.
  2. AC9: Confirm each result type (topic, article, collection) uses its corresponding icon and visual structure.

2025-06-03_09-55-37.png (741×399 px, 75 KB)

Test Case 10: Validate accessibility standards

  1. Use keyboard navigation (Tab, Enter) to focus on the search input and navigate results.
  2. AC10: Confirm that all elements are reachable and actionable via keyboard.

See gif

2025-06-03_09-58-50.mp4.gif (570×1 px, 1023 KB)

GMikesell-WMF updated the task description. (Show Details)
GMikesell-WMF updated the task description. (Show Details)
GMikesell-WMF moved this task from Needs QA to In-progress on the LPL Hypothesis board.

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

[mediawiki/extensions/ContentTranslation@master] CX filter search: Truncate result title/description when exceed one line

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

Change #1154270 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX filter search: Truncate result title/description when exceed one line

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

Change #1154846 had a related patch set uploaded (by Eamedina; author: Eamedina):

[mediawiki/extensions/ContentTranslation@master] CX3 Build 1.0.0+20250609

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

Change #1154846 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX3 Build 1.0.0+20250609

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

@ngkountas title and description are now displayed with ellipsis as seen in the screenshots below. Test case 10, when I click tab to navigate, it only navigates through the browser and not within the Adjust suggestions as seen in the gif.

Test Case 8: Verify truncation behavior for long titles/descriptions

  1. Search for an item with a long name and description.
  2. AC8: Confirm that titles and descriptions are truncated to a single line with ellipsis if needed.

They do not truncate to a single line with ellipsis

✅Title✅Description
2025-06-16_12-15-15.png (827×460 px, 61 KB)
2025-06-16_12-16-42.png (828×461 px, 63 KB)

Test Case 10: Validate accessibility standards

  1. Use keyboard navigation (Tab, Enter) to focus on the search input and navigate results.
  2. AC10: Confirm that all elements are reachable and actionable via keyboard.

See gif

2025-06-16_12-20-06.mp4.gif (960×992 px, 1 MB)

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

[mediawiki/extensions/ContentTranslation@master] CX suggestion filters search: Support keyboard navigation in results

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

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

[mediawiki/extensions/ContentTranslation@master] CX suggestion filters: Support keyboard navigation between filter chips

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

QA'ed this patch: 1166195: CX suggestion filters search: Support keyboard navigation in results | https://gerrit.wikimedia.org/r/c/mediawiki/extensions/ContentTranslation/+/1166195

highlight-item-suggestion.png (1×622 px, 71 KB)

Some padding around the menu items would be good. Currently the highlight item background color touches the contents.

Change #1166195 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX suggestion filters search: Support keyboard navigation in results

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

Change #1166196 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX suggestion filters: Support keyboard navigation between filter chips

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

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

[mediawiki/extensions/ContentTranslation@master] CX3 Build 1.0.0+20250707

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

Change #1166887 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX3 Build 1.0.0+20250707

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

Nikerabbit subscribed.

Technically belongs to last year's hypothesis, but not creating old milestones retroactively.

@GMikesell-WMF can you please re-test this task? I believe that only AC10 needs QA, as AC1 seems fine according to T392753 (look for specifications mentioned in this subsection Search placeholder text by tab)

@ngkountas Please review my results for AC10, thanks!

Test Case 10: Validate accessibility standards

  1. Use keyboard navigation (Tab, Enter) to focus on the search input and navigate results.
  2. AC10: Confirm that all elements are reachable and actionable via keyboard.

See gif

2025-06-16_12-20-06.mp4.gif (960×992 px, 1 MB)

Test Case 10: Validate accessibility standards

  1. Use keyboard navigation (Tab, Enter) to focus on the search input and navigate results.
  2. AC10: Confirm that all elements are reachable and actionable via keyboard.

See gif

❓- It goes through all the chips and links but is it ok that it does not go to the other tabs (e.g., Collections, Regions, Topics)?

Search w/no words

❌- When I type in the search box (e.g., Technology), I was not able to navigate to the other articles

Search w/word
GMikesell-WMF changed the task status from Open to In Progress.Jul 17 2025, 9:06 PM
GMikesell-WMF updated the task description. (Show Details)
GMikesell-WMF moved this task from Needs QA to In-progress on the LPL Hypothesis board.

@GMikesell-WMF Tabs are reachable by using left/right arrow keys. As for the search results; after typing in the search input, you can navigate the results by clicking the down arrow. This behaviour is basically provided by the Codex components (tabs and menu components), so this implementation is aligned with Codex approach:

Nikerabbit set the point value for this task to 8.Sep 4 2025, 10:26 AM

We have an another task(T398721) in place to improve other aspects of search experience so moving this task for product signoff.

Nikerabbit added a project: Design.