Page MenuHomePhabricator

Unified Dashboard: Support country-level filtering under custom suggestions view
Closed, ResolvedPublic

Description

Description

Existing translation suggestion filters are limited to regions and with recent progress in making search possible with the articlecountry: keyword T388942, we would like to include country filters on the unified dashboard for editors to access.

User Story

As an editor,
I want to access country-specific translation suggestions,
So that I can choose an article or section to translate based on a chosen country.

Design Input
Tab Structure & Organization

All.png (1×512 px, 80 KB)

1. "All" Tab-Region Display

  • Display continent/region-level chips (Africa, Asia, Europe, etc.) with expansion chevrons (▼)
  • Each region chip includes a count indicator showing the number of countries (e.g., "Africa (54)")
  • Region chips are arranged horizontally, wrapping to multiple rows as needed
  • "View all regions" link appears at the bottom of the Regions section

2. Region Expansion in "All" Tab

Regions.png (1×512 px, 81 KB)

  • When a region chip is clicked in the "All" tab, it expands inline
  • Expanded state shows:
    • "All [Region Name]" chip at the top (e.g., "All Africa") with blue/selected styling
    • Limited subset of 5-7 representative
    • "See more countries in [Region]..." link at the bottom of the expanded area

3. "Regions" Tab - Comprehensive View

Regions.png (1×512 px, 26 KB)
  • All continent/region chips are shown with expansion chevrons and count indicators
  • Each region can be expanded to show ALL countries within that region
  • Countries are arranged alphabetically within their region
  • Expanded regions display all countries as selectable chips
Navigation & Interaction

1. Link Behavior

Regions - Pre Selected.png (1×512 px, 63 KB)
  • "View all regions" link: Takes user to the Regions tab with no specific region pre-expanded
  • "See more countries in [Region]..." link: Takes user to the Regions tab with that specific region pre-expanded

2. Selection Model

  • Only one filter can be selected at a time (single selection model)
  • Users can select either:
    • An entire region (e.g., "All Africa")
    • A specific country (e.g., "Egypt")
  • Selection in any tab is preserved when switching between tabs
  • Selecting a new item automatically deselects any previously selected item
Acceptance Criteria
  • Users can expand regions to see a preview of countries in the "All" tab
  • Users can view all countries within a region in the "Regions" tab
  • Navigation between tabs maintains context and selection state
  • Users can select either entire regions or individual countries

Understood — I’ll remove all --- dividers and ensure that \ is never used before ====Test Steps when presenting results.

Here is the revised version of your test result following all guidelines:

Derived Requirement
Enable country-level filtering in the custom suggestions view of the unified dashboard, allowing editors to browse and select translation suggestions by either region or specific country, with a single-selection model and preserved context across tabs.

Test Steps

Test Case 1: Ensure country preview appears on expanding a region in the 'All' tab

  1. Navigate to the unified dashboard.
  2. Click the "All" tab.
  3. Click on a region chip (e.g., "Asia").
  4. ✅❓❌⬜ AC1: Confirm that the region expands inline and shows:
    • "All \[Region]" chip (e.g., "All Asia") with selected styling
    • A subset of 5–7 country chips
    • A link labeled "See more countries in \[Region]..."

Test Case 2: Ensure full country list appears on expanding a region in the 'Regions' tab

  1. Navigate to the "Regions" tab.
  2. Click on a region chip (e.g., "Europe").
  3. ✅❓❌⬜ AC2: Confirm that all countries in that region are displayed alphabetically and as selectable chips.

Test Case 3: Ensure 'View all regions' link navigates correctly

  1. On the "All" tab, scroll to the bottom of the Regions section.
  2. Click the "View all regions" link.
  3. ✅❓❌⬜ AC3: Confirm that it navigates to the "Regions" tab without any region expanded.

Test Case 4: Ensure 'See more countries in \[Region]' navigates with pre-expanded region

  1. On the "All" tab, expand a region (e.g., "Africa").
  2. Click the "See more countries in Africa" link.
  3. ✅❓❌⬜ AC4: Confirm that the "Regions" tab opens with the Africa region expanded automatically.

Test Case 5: Ensure only one region or country can be selected at a time

  1. In either tab, select a region (e.g., "All Europe").
  2. Then select a country (e.g., "France").
  3. ✅❓❌⬜ AC5: Confirm that selecting "France" deselects "All Europe" and vice versa — only one item remains selected.

Test Case 6: Ensure selection is preserved when switching tabs

  1. Select a country (e.g., "India") in the "All" tab.
  2. Switch to the "Regions" tab.
  3. ✅❓❌⬜ AC6: Confirm that "India" remains selected in the new tab view.

QA Results - Test Wiki

Event Timeline

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

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

[research/recommendation-api@master] Support for articlecountry

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

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

[mediawiki/extensions/ContentTranslation@master] Add country suggestion filters

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

SBisson triaged this task as High priority.Apr 17 2025, 6:54 PM

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

[mediawiki/extensions/WikimediaMessages@master] Central articlecountry definitions

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

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

[integration/config@master] WikimediaMessages: add cldr as phan dependency

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

Change #1140208 merged by jenkins-bot:

[integration/config@master] Zuul: [mediawiki/extensions/WikimediaMessages] Add cldr as phan dependency

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

Mentioned in SAL (#wikimedia-releng) [2025-05-02T06:52:04Z] <James_F> Zuul: [mediawiki/extensions/WikimediaMessages] Add cldr as phan dependency, for T391230

Change #1140568 had a related patch set uploaded (by Jforrester; author: Jforrester):

[integration/config@master] Zuul: [mediawiki/extensions/WikimediaMessages] Add cldr as full CI dependency too

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

Change #1140568 merged by jenkins-bot:

[integration/config@master] Zuul: [mediawiki/extensions/WikimediaMessages] Add cldr as full CI dep too

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

Mentioned in SAL (#wikimedia-releng) [2025-05-02T07:00:08Z] <James_F> Zuul: [mediawiki/extensions/WikimediaMessages] Add cldr as full CI dep too, for T391230

One aspect worth detailing/illustrating is how collapsible items work in search. For example, how a query such as "Africa" could let users find both the African continent and the South Africa country.

Change #1137342 merged by jenkins-bot:

[research/recommendation-api@master] Support for articlecountry

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

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

[operations/deployment-charts@master] Update recommendation-api to 2025-05-26-081343-production

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

Change #1150664 merged by jenkins-bot:

[operations/deployment-charts@master] Update recommendation-api to 2025-05-26-081343-production

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

Change #1137343 abandoned by Sbisson:

[mediawiki/extensions/ContentTranslation@master] Add country suggestion filters

Reason:

New/cleaner patch coming up

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

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

[mediawiki/extensions/ContentTranslation@master] CX Dashboard: Regions/Countries suggestion filters

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

Change #1140205 merged by jenkins-bot:

[mediawiki/extensions/WikimediaMessages@master] Provide a central 'articlecountry' definition registry for filtering/etc.

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

Change #1156386 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX Dashboard: Regions/Countries suggestion filters

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

@KCVelaga_WMF could you add "suggestion_region" and "suggestion_filter_region" (or other similar names) to the event_source field for those new filters based on regions/countries?

@SBisson created an MR, I have used suggestion_filter_region for consistency with other filters. Also, can we capture the name of the region in event_context similar to topic areas and lists?

@KCVelaga_WMF yes, the specific country ("vnm" for Vietnam) or region (asia) is specified in the event_context.

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

[mediawiki/extensions/ContentTranslation@master] Use region filters event_sources

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

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

[mediawiki/extensions/ContentTranslation@master] Add link to see more countries in [region]

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

Change #1160174 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] Use region filters event_sources

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

Change #1160249 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] Add link to see more countries in [region]

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

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

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

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

Change #1162019 merged by jenkins-bot:

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

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

@SBisson Review AC1 and AC2 please.

Test Result - TestWiki

Status: ✅ PASS / ❓Need More Info / ❌ FAIL
Environment: TestWiki
OS: macOS Sequoia 15.5
Browser: Chrome 137
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Ensure country preview appears on expanding a region in the 'All' tab

  1. Navigate to the unified dashboard and click "...More".
  2. Click the "All" tab.
  3. Click on a region chip (e.g., "Asia").
  4. ✅❌ AC1: Confirm that the region expands inline and shows:
    • ❌"All \[Region]" chip (e.g., "All Asia") with selected styling
    • ✅ A subset of 5–7 country chips
    • ✅A link labeled "See more countries in \[Region]..."

Is it ok that it just says "All" besides "All Asia"

2025-07-09_13-56-35.png (847×527 px, 120 KB)

Test Case 2: Ensure full country list appears on expanding a region in the 'Regions' tab

  1. Navigate to the "Regions" tab.
  2. Click on a region chip (e.g., "Europe").
  3. ✅❓ AC2: Confirm that all countries in that region are displayed alphabetically and as selectable chips.

It confirms all countries within the region and is alphabetical order. For places like " 'Aland Islands ", did you want characters to be at the beginning or end?

2025-07-09_13-58-44.png (846×537 px, 126 KB)

Test Case 3: Ensure 'View all regions' link navigates correctly

  1. On the "All" tab, scroll to the bottom of the Regions section.
  2. Click the "View all regions" link.
  3. AC3: Confirm that it navigates to the "Regions" tab without any region expanded.

Test Case 4: Ensure 'See more countries in \[Region]' navigates with pre-expanded region

  1. On the "All" tab, expand a region (e.g., "Africa").
  2. Click the "See more countries in Africa" link.
  3. AC4: Confirm that the "Regions" tab opens with the Africa region expanded automatically.

Test Case 5: Ensure only one region or country can be selected at a time

  1. In either tab, select a region (e.g., "All Europe").
  2. Then select a country (e.g., "France").
  3. AC5: Confirm that selecting "France" deselects "All Europe" and vice versa — only one item remains selected.

Test Case 6: Ensure selection is preserved when switching tabs

  1. Select a country (e.g., "Armenia") in the "All" tab.
  2. Switch to the "Regions" tab.
  3. AC6: Confirm that "Armenia" remains selected in the new tab view.

GMikesell-WMF changed the task status from Open to In Progress.Jul 9 2025, 11:29 PM
GMikesell-WMF updated Other Assignee, added: GMikesell-WMF.
GMikesell-WMF updated the task description. (Show Details)
GMikesell-WMF moved this task from Needs QA to In-progress on the LPL Hypothesis board.

AC1: 'All [region]'

I've decided to leave it to 'All' for consistency with expandable collection groups. The 'All' chip is only shown directly under the region name so I don't think there is any ambiguity. Something for @SGautam_WMF to consider.

AC2: Alphabetical order

PHP default sorting doesn't work well in this case. I'll submit a new patch to use a better language-aware sorting.

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

[mediawiki/extensions/WikimediaMessages@master] Sort regions and countries with Collator

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

Change #1167892 merged by jenkins-bot:

[mediawiki/extensions/WikimediaMessages@master] Sort regions and countries with Collator

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

@SBisson As seen from the screenshots below, AC 1 & 2 now pass. I will move this to Sign-off. Thanks for all your work!

AC1: 'All [region]'

I've decided to leave it to 'All' for consistency with expandable collection groups. The 'All' chip is only shown directly under the region name so I don't think there is any ambiguity. Something for @SGautam_WMF to consider.

Test Case 1: Ensure country preview appears on expanding a region in the 'All' tab

  1. Navigate to the unified dashboard and click "...More".
  2. Click the "All" tab.
  3. Click on a region chip (e.g., "Asia").
  4. AC1: Confirm that the region expands inline and shows:
    • ✅"All \[Region]" chip (e.g., "All") with selected styling
    • ✅ A subset of 5–7 country chips
    • ✅A link labeled "See more countries in \[Region]..."

Is it ok that it just says "All" besides "All Asia"

2025-07-09_13-56-35.png (847×527 px, 120 KB)

AC2: Alphabetical order

PHP default sorting doesn't work well in this case. I'll submit a new patch to use a better language-aware sorting.

Test Case 2: Ensure full country list appears on expanding a region in the 'Regions' tab

  1. Navigate to the "Regions" tab.
  2. Click on a region chip (e.g., "Europe").
  3. AC2: Confirm that all countries in that region are displayed alphabetically and as selectable chips.

2025-07-21_15-38-58.png (756×428 px, 88 KB)