Page MenuHomePhabricator

Community-defined Translation Collections: Support collections with multiple sub-collections
Closed, ResolvedPublic8 Estimated Story Points

Description

Description

With more collections being added to the unified dashboard, we need to account for the growing numbers as certain campaign/event pages have translation lists in multiple sub-pages:
-Wikimedia_CEE_Spring_2024 ,
-WikiLoves Ramadhan 2025
-Wiki99

Screenshot 2025-03-13 at 15.20.22.png (1×717 px, 240 KB)

Depends On:

This Task depends on the implementation of T392753

Goal
  • Enable users to select either a specific sub-collections(e.g. "CEE Spring 2025 Albania") or the entire parent collection("CEE Spring 2025")
  • Implement an inline expansion mechanism for collections with sub-collections.
Design

System Preparedness

  • Requires backend functionality to identify which collections are parents and their associated sub-collections.
  • One potential approach to achieve this identification would be to analyze page naming patterns where "/" characters are used by community members (e.g., "CEE Spring 2025/Albania"), treating the prefix before the slash as the parent collection and the suffix as the sub-collection name.
01 Collections with Sub-collections.png (1×512 px, 76 KB)
Slice 1.png (422×657 px, 24 KB)

Visual Differentiation of Collection Chips:

    • Parent/Expandable Chip (Collapsed State):
      • Components: Folder icon (📁) + Parent Name + Sub-collection Count ((X)) + Collapse Chevron (▼).
      • Style: Uses the default/unselected chip appearance.
      • Example: 📁 CEE Spring 2025(41) ▼
  • Standalone/Specific Collection Chip:
    • Components: Pages icon + Collection Name.
    • Style: Uses the default/unselected chip appearance. Appears intermingled alphabetically with Parent chips in the list.

Parent/Expandable Chip (Expanded State):

  • Components: Folder icon (📁) + Parent Name + / Selected Item Name + Expand Chevron (▲). ("Selected Item Name" is "All" or the name of the chosen sub-collection).
  • Style: Uses the "selected" chip appearance
  • Example when 'All' selected: 📁 CEE Spring 2025(41) / All ▲ [Selected Style]
  • Example when 'Albania' selected: 📁 CEE Spring 2025(41) / Albania ▲ [Selected Style]

Sub-Collection Chip (Inside expanded group):

  • Components: Page icon (📄) + Sub-collection Name.
  • Style: Standard chip appearance; gets "selected" style when active.
  • Example: 📄 Albania

Interaction - Inline Expansion:

02 Collections with Sub-collections.png (1×512 px, 87 KB)
  • Clicking a collapsed parent item (📁 ... ▼) expands it inline below itself. The chevron updates (▲).
    • The expanded area displays all associated sub-collection chips, including the [ All ] chip first.
    • Clicking the parent item header again collapses the section.

Interaction - Selection (Single Topic):

03 Collections with Sub-collections.png (1×512 px, 87 KB)
  • Default [ All ] Selection: When a parent item is expanded, the [ All ] chip within its expanded section is selected by default.
  • Done Button State: The main Done button becomes active/enabled immediately upon expansion (due to default selection).
  • Explicit Selection Change: Clicking a different chip (a specific sub-collection 📄, the ☑️ All chip, or a different standalone/parent chip 📄/📁 elsewhere in the main list) updates the selection.
  • Mutual Exclusivity: Only one chip can be selected at any time within the entire dialog. Selecting any chip automatically deselects any previously selected chip.
  • No Disabling: All visible chips remain enabled and clickable.

Parent Item State Update: The parent expandable item (📁 ...) visually indicates the current selection made within its group:

  • Upon Expansion: Immediately gets "selected" style + / All label.
  • When Sub-item Selected: Remains "selected" style + label updates to / Sub-item Name.
  • When Collapsed: Retains "selected" style + summary label (/ All or / Sub-item Name).
  • When Deselected Entirely: Reverts to default collapsed, unselected state (📁 ... ▼).
  • Confirmation: The final selection is confirmed via the main Done button. (Decision Needed: Confirm this vs. immediate close).
Acceptance Criteria

This task will be considered complete when:

UI Implementation

  • All visual states are correctly implemented (collapsed, expanded, selected)
  • Inline expansion/collapse works correctly
  • Selection of parent collections and sub-collections functions as specified

Derived Requirements

  1. Support for Hierarchical Collections The Unified Dashboard must support community-defined translation collections structured as parent collections with sub-collections (e.g., CEE Spring 2025/Albania as a sub-collection of CEE Spring 2025).
  1. Visual & Interactive Chip Behavior The interface must:
    • Display parent chips with a 📁 icon, name, sub-collection count, and a collapse/expand chevron.
    • Allow inline expansion to reveal sub-collection chips (📄), starting with an \[All] option.
    • Visually indicate which item is selected (with selected chip styling).
    • Ensure mutual exclusivity: only one chip (standalone, parent, or sub-collection) is active at a time.
  1. Interaction & State Behavior
    • Clicking a 📁 parent chip expands its sub-collections inline.
    • The \[All] sub-collection is selected by default when expanded.
    • Clicking another chip (including other parents or standalones) deselects the current one.
    • When collapsed, the parent chip still reflects the selected sub-item (e.g., /All, /Albania).
    • Clicking “Done” finalizes the selection; UI must enable the Done button immediately on expansion.
  1. Back-End Requirements
    • The system must be able to identify parent-sub relationships via naming convention (/).
    • The frontend must render these dynamically based on backend-provided structure.
Test Steps

Test Case 1: Display and Expand Parent Collections

  1. Go to the Unified Dashboard with translation collections enabled.
  2. Locate a parent collection (e.g., 📁 Wiki99 (3) ▼).
  3. ✅❓❌⬜ AC1: Confirm that the chip includes a folder icon, label, item count, and expand chevron.
  4. Click the parent chip to expand it.
  5. ✅❓❌⬜ AC2: Confirm that sub-collections (e.g., 📄 food) appear inline, and \[All] is listed first.

Test Case 2: Selection Behavior and Chip State Updates

  1. With the parent chip expanded, confirm the \[All] chip is selected by default.
  2. ✅❓❌⬜ AC3: Confirm the Done button becomes active immediately.
  3. Select a sub-collection chip (e.g., 📄 food).
  4. ✅❓❌⬜ AC4: Confirm the parent chip label updates to / food and maintains selected styling.

Test Case 3: Mutual Exclusivity Across All Chips

  1. Expand a second parent chip or select a standalone collection chip.
  2. ✅❓❌⬜ AC5: Confirm that the previously selected chip becomes deselected since only one chip is ever active at any time.

Test Case 4: Collapse, Deselect, and Confirmation Behavior

  1. Click the expanded parent chip again to collapse it.
  2. ✅❓❌⬜ AC6: Confirm that it still shows the selected sub-collection (/ food) in its label.
  3. Click the same parent chip’s label or the \[All] chip again.
  4. ✅❓❌⬜ AC7: Confirm selection is retained unless a different chip is selected.
  5. Click the Done button.
  6. ✅❓❌⬜ AC8: Confirm the dialog closes and the selection is applied.

QA Results - TestWiki

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
PWaigi-WMF renamed this task from Community-defined Translation Collections: Support campaign pages with multiple sub-pages to Community-defined Translation Collections: Support collections with multiple sub-collections.Apr 25 2025, 8:11 PM

Adding a potential approach for identifying parent-child relationships to the System Preparedness section.

@SGautam_WMF The proposal looks good. One aspect we may want to detail a bit more is how naming defines sub-collections. We may want to clarify whether the parent collection needs to be defined explicitly or not for sub-collections to exist. Some examples below of how the naming conventions could work:

  • If there are three collections named A, A/B, and A/C, the collection A will be represented as a folder that contains the options "all", A/B, and A/C.
  • If there are two collections named X/Y, and X/Z, an implicit collection X will be represented as a folder that contains options "all", X/Y and X/Z. Note that the collection "X" was not defined explicitly
  • If there is one collection named A/S/D/F, i t is presented just as a regular collection. The slashes in the name only imply the use of sub-collections when there is an overlapping segment of it with other collections.

The specific examples above are just for illustration, the point is we may want to capture whichever are the rules more explicitly.

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

[research/recommendation-api@master] PoC: Collection grouping support

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

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

[research/recommendation-api@master] Add "page-collection-groups" endpoint

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

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

[research/recommendation-api@master] Add support for fetching collection group recommendations

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

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

[mediawiki/extensions/ContentTranslation@master] CX Suggestion filters: Add support for collections with sub-collections

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

Change #1149747 abandoned by Sbisson:

[research/recommendation-api@master] PoC: Collection grouping support

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

Change #1153311 merged by jenkins-bot:

[research/recommendation-api@master] Add "page-collection-groups" endpoint

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

Change #1153312 merged by jenkins-bot:

[research/recommendation-api@master] Add support for fetching collection group recommendations

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

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

[operations/deployment-charts@master] Update recommendation-api to 2025-06-10-203235-production

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

Change #1155359 merged by jenkins-bot:

[operations/deployment-charts@master] Update recommendation-api to 2025-06-10-203235-production

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

Mentioned in SAL (#wikimedia-operations) [2025-06-11T13:48:55Z] <kart_> Updated Recommnedation-API to 2025-06-10-203235-production (T374695)

Change #1153317 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX Suggestion filters: Add support for collections with sub-collections

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

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

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

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

Change #1159555 merged by jenkins-bot:

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

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

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

[mediawiki/extensions/ContentTranslation@wmf/1.45.0-wmf.6] CX3 Build 1.0.0+20250616

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

Change #1160123 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@wmf/1.45.0-wmf.6] CX3 Build 1.0.0+20250616

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

Mentioned in SAL (#wikimedia-operations) [2025-06-17T14:22:31Z] <sbisson@deploy1003> Started scap sync-world: Backport for [[gerrit:1160123|CX3 Build 1.0.0+20250616 (T374695 T395415 T396628 T396711 T396716 T396836)]]

Mentioned in SAL (#wikimedia-operations) [2025-06-17T14:24:43Z] <sbisson@deploy1003> sbisson: Backport for [[gerrit:1160123|CX3 Build 1.0.0+20250616 (T374695 T395415 T396628 T396711 T396716 T396836)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-06-17T14:33:53Z] <sbisson@deploy1003> Finished scap sync-world: Backport for [[gerrit:1160123|CX3 Build 1.0.0+20250616 (T374695 T395415 T396628 T396711 T396716 T396836)]] (duration: 11m 21s)

@ngkountas Please review AC5 and AC6 comments.

Test Result - TestWiki

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

Test Artifact(s):

https://test.wikipedia.org/w/index.php?title=Special:ContentTranslation&filter-type=collections&filter-id=Wiki99%2Fsustainability&active-list=suggestions&from=fr&to=es#/

Test Steps

Test Case 1: Display and Expand Parent Collections

  1. Go to the Unified Dashboard with translation collections enabled.
  2. Locate a parent collection (e.g., 📁 Wiki99 (3) ▼).
  3. AC1: Confirm that the chip includes a folder icon, label, item count, and expand chevron.

2025-06-26_12-33-15.png (556×716 px, 68 KB)

  1. Click the parent chip to expand it.
  2. AC2: Confirm that sub-collections (e.g., 📄 food) appear inline, and \[All] is listed first.

See AC1

Test Case 2: Selection Behavior and Chip State Updates

  1. With the parent chip expanded, confirm the \[All] chip is selected by default.
  2. AC3: Confirm the Done button becomes active immediately.

2025-06-26_12-43-45.png (647×731 px, 84 KB)

  1. Select a sub-collection chip (e.g., 📄 food).
  2. AC4: Confirm the parent chip label updates to / food and maintains selected styling.

See AC3

Test Case 3: Mutual Exclusivity Across All Chips

  1. Expand a second parent chip or select a standalone collection chip.
  2. AC5: Confirm that the previously selected chip becomes deselected since only one chip is ever active at any time.

There's not 2nd parent chip folder but I did click other chips and region and confirmed that it was deselected and collapses when doing that. Is that ok?

Test Case 4: Collapse, Deselect, and Confirmation Behavior

  1. Click the expanded parent chip again to collapse it.
  2. AC6: Confirm that it still shows the selected sub-collection (/ food) in its label.
  3. Click the same parent chip’s label or the \[All] chip again.

Parent folder does not collapse if you click on the parent folder, only when you select another chip outside the parent. Also, did you want the standalone to be highlighted along with the Parent chip that it's associated with or being separate is fine?

  1. AC7: Confirm selection is retained unless a different chip is selected.

See AC6

  1. Click the Done button.
  2. AC8: Confirm the dialog closes and the selection is applied.

See AC6

@SGautam_WMF can you please check "Test Case 4: Collapse, Deselect, and Confirmation Behavior" and specifically AC6, and address George's questions?

Parent folder does not collapse if you click on the parent folder, only when you select another chip outside the parent. Also, did you want the standalone to be highlighted along with the Parent chip that it's associated with or being separate is fine?

@ngkountas I've tested the implementation and can confirm AC6 findings. Additionally, I discovered another related issue. Documented these in following task - T398682

@SGautam_WMF when the user selects a child collection (e.g. Wiki99/food), do we want both the child chip ("food") and the parent child ("Wiki99") to be highlited (dark blue background color)?

@SGautam_WMF when the user selects a child collection (e.g. Wiki99/food), do we want both the child chip ("food") and the parent child ("Wiki99") to be highlited (dark blue background color)?

@ngkountas sorry for late reply, so when a user selects a child collection(e.g. Wiki99/food), here's the expected behavior:

  • Parent chip gets blue background(selected state)
  • Parent chip label updates to show: Wiki99(3)/food
  • Child chip also gets highlighted for clarity
  • This persists whether expanded or collapsed.

Some other issues also documented in T398682 along with this one.

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

[mediawiki/extensions/ContentTranslation@master] Suggestion filters: Use active bg color for group chip if child selected

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

Change #1173344 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] Suggestion filters: Use active bg color for group chip if child selected

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

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

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

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

Change #1175492 merged by jenkins-bot:

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

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

@ngkountas Parent chip now collapses. Also parent chip is highlighted when a child chip is highlighted, as seen in the video. I will now move this to Sign-off. Thanks for all your work!

Test Case 4: Collapse, Deselect, and Confirmation Behavior

  1. Click the expanded parent chip again to collapse it.
  2. AC6: Confirm that it still shows the selected sub-collection (/ food) in its label.
  3. Click the same parent chip’s label or the \[All] chip again.

GMikesell-WMF updated Other Assignee, removed: GMikesell-WMF.
GMikesell-WMF moved this task from Needs QA to Design Signoff on the LPL Hypothesis board.
Nikerabbit set the point value for this task to 4.
ngkountas changed the point value for this task from 4 to 8.Sep 4 2025, 12:07 PM