Page MenuHomePhabricator

Consider length of Collection names on different views
Closed, ResolvedPublic

Assigned To
Authored By
PWaigi-WMF
Nov 25 2024, 9:02 AM
Referenced Files
F59611168: 2025-05-01_12-41-32.png
May 1 2025, 11:06 PM
F59611209: 2025-05-01_16-03-30.png
May 1 2025, 11:06 PM
F59611185: 2025-05-01_10-22-01.png
May 1 2025, 11:06 PM
F59611155: 2025-05-01_12-40-56.png
May 1 2025, 11:06 PM
F59611191: 2025-05-01_10-28-55.png
May 1 2025, 11:06 PM
F59611182: 2025-05-01_12-39-38.png
May 1 2025, 11:06 PM
F59611166: 2025-05-01_12-42-07.png
May 1 2025, 11:06 PM
F59611224: 2025-05-01_10-26-14.png
May 1 2025, 11:06 PM

Description

We need to explore how long Collection names can be displayed well in different views; based on the example below of Wikiproject Women's Health/Vital articles.

a) Suggestions view

Screenshot 2024-11-22 at 23.09.14.png (1×719 px, 293 KB)

b) Adjust the Suggestions view

Screenshot 2024-11-22 at 23.07.24.png (1×707 px, 207 KB)

UX improvements for collection label formatting

Scenario 1: Simple collection labels

Slice 1.png (772×714 px, 110 KB)

Examples:

  • Vital articles
  • Art+Feminism
  • WikiProject Women's Health

Rule:

  • Truncate when exceeds container width

Example: "WikiProject Women's Health" → "WikiProject Wom..."

Scenario 2: Collection labels with path

Slice 1.png (765×697 px, 115 KB)

Examples:

  • WikiProject Women's Health/Vital Articles
  • Art+Feminism/2024 Campaign
  • CEE Spring 2024/Structure/Russian Federation

Progressive truncation suggestion:

  • Split at last "/"
  • When exceeds container width:
    • Left part gets ellipsis: "CEE Spring.../Russian Federation"
    • In space-constrained UIs (like suggestions view): Ultra-short version → "Wiki.../Russian..."

Derived Requirement

Ensure that collection names are displayed appropriately across different views. Collection names should be truncated when they exceed the container width, following these rules:

  1. For simple collection labels (e.g., "Vital articles"), truncate at the container width (e.g., "WikiProject Women's Health" → "WikiProject Wom...").
  2. For collection labels with paths (e.g., "WikiProject Women's Health/Vital Articles"), split at the last "/" and apply progressive truncation. In space-constrained UIs, ultra-short versions should be displayed (e.g., "Wiki.../Russian...").
Test Steps

Test Case 1: Ensure Proper Truncation of Collection Labels in Different Views

  1. Navigate to the Suggestions view and identify collection labels.
  2. Verify that simple collection labels are truncated when they exceed the container width (e.g., "WikiProject Women's Health" → "WikiProject Wom...").
  3. Check collection labels with paths and ensure truncation follows the progressive approach. For example, "CEE Spring 2024/Structure/Russian Federation" should appear as "CEE Spring.../Russian Federation."
  4. In space-constrained areas, confirm that ultra-short versions are displayed (e.g., "Wiki.../Russian...").
  5. ✅❓❌⬜ AC1: Confirm that collection names are truncated or split according to the specified rules based on container width and view type.

QA Results - Test Wiki

ACStatusDetails
1T380702#10784765
2T380702#10784765

Event Timeline

PWaigi-WMF renamed this task from Consider length of Collection name on different views to Consider length of Collection names on different views.Nov 25 2024, 9:09 AM
PWaigi-WMF updated the task description. (Show Details)

In general we may want to adjust the styling of the collection tags for the label to be cropped with ellipses to prevent them exceeding the available width. That is, filter chips should take no more than one line and avoid making contents to overflow to the next line (e.g. some codepen examples illustrate the use of CSS to support this).

A special consideration we may want ot take into account is for cases where the collection is defined as a sub-page and gets the name from it.

Dealing with page paths

For cases where the collections are taking the name of the page, we can find long collection names consisting of pages and sub-pages such as "Wikiproject Women's Health/Vital articles", where cropping it depending on the space available could result in the last part of teh path to be not present at all (e.g., "Wikiproject Women's Heal..."). In that case, if there were three collections defined as sub-pages of "Wikiproject Women's Health" such as "Vital articles", "Level 1", and "Level 2". All three could get cropped as "Wikiproject Women's Heal...".

In order to consider this, we can think of the page name as two different segments: the path and the final sub-page separated by the last "/". The path can be cropped with elipsis after a certain length, and leave the rest of the space for the final sub-page name (which can be also cropped if it were longer than the available space. This would lead to the following examples:

  • "Wikiproject Wome.../Vital articles"
  • "Wikiproject Wome.../List of the most commo..."

That seems an improvement over having both collections labeleld the same as "Wikiproject Women's Heal..." because the differentiating part is at the very end.

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

[mediawiki/extensions/ContentTranslation@master] Handle the string formatting of long collection names

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

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

[mediawiki/extensions/ContentTranslation@master] Initial handling of long collection names

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

Change #1105040 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] Initial handling of long collection names

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

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

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

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

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

[mediawiki/extensions/ContentTranslation@master] Initial handling of long collection names

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

Change #1105057 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] Updated initial handling of long collection names

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

Change #1105049 abandoned by Sbisson:

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

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

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

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

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

Change #1105327 merged by jenkins-bot:

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

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

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

[mediawiki/extensions/ContentTranslation@wmf/1.44.0-wmf.8] CX3 Build 0.2.0+20241218

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

Change #1105336 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@wmf/1.44.0-wmf.8] CX3 Build 0.2.0+20241218

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

Mentioned in SAL (#wikimedia-operations) [2024-12-18T15:06:13Z] <kartik@deploy2002> Started scap sync-world: Backport for [[gerrit:1105336|CX3 Build 0.2.0+20241218 (T380702)]]

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

[mediawiki/extensions/ContentTranslation@master] Handle the string formatting of long collection names

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

Change #1101932 abandoned by Eamedina:

[mediawiki/extensions/ContentTranslation@master] Handle the string formatting of long collection names

Reason:

Different approach Ia232b6e79991cea6d841492260e7a36fbd9dcd8a

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

Note:
Once the task is done, let's test with full names:
<page-collection name="Sustainability"></page-collection> = should now show Wiki99/sustainability
<page-collection name="Essential Articles"></page-collection> = should now show List of articles every Wikipedia should have
<page-collection name="Climate"> </page-collection> should now show Wikimedians for Sustainable Development/Climate translation project
<page-collection name="Women's Health"> </page-collection> should now show Wikiproject Women's Health/Vital articles

Change #1105411 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] Handle the string formatting of long collection names

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

@eamedina Just a quick question regarding the 2nd slash. It does work but since the extra words are on the 2nd slash, shouldn't it show all the first word like "Wiki99/foodfoodfoodfoodfoodfoodfood...", besides "W.../foodfoodfoodfoodfoodfoodfoodfood..." ? Let me know what you think.

*UPDATE*- Good to go from T380702#10545707

Test Result - TestWiki

Status: ✅ PASS
Environment: TestWiki
OS: macOS Sonoma 15.3
Browser: Chrome 132
Device: MBA
Emulated Device: NA

Test Artifact(s):

https://test.m.wikipedia.org/w/index.php?title=Special:ContentTranslation&active-list=suggestions&from=es&to=en&filter-type=collections&filter-id=Sustainability
https://test.m.wikipedia.org/w/index.php?title=Special:ContentTranslation&active-list=suggestions&from=es&to=en&filter-type=collections&filter-id=Wiki99/food

Test Steps

Test Case 1: Ensure Proper Truncation of Collection Labels in Different Views

  1. Navigate to the Suggestions view and identify collection labels.
  2. Verify that simple collection labels are truncated when they exceed the container width (e.g., "WikiProject Women's Health" → "WikiProject Wom...").
  3. Check collection labels with paths and ensure truncation follows the progressive approach. For example, "CEE Spring 2024/Structure/Russian Federation" should appear as "CEE Spring.../Russian Federation."
  4. In space-constrained areas, confirm that ultra-short versions are displayed (e.g., "Wiki.../Russian...").
  5. AC1: Confirm that collection names are truncated or split according to the specified rules based on container width and view type.

Adjust Suggestions

✅ first slash❓ 2nd slash✅ No slash
2025-02-11_15-18-24.png (1×1 px, 258 KB)
2025-02-11_15-19-33.png (995×1 px, 255 KB)
2025-02-11_15-20-36.png (1×1 px, 273 KB)

Top Suggestions

✅ first slash❓ 2nd slashNo slash
2025-02-11_15-23-18.png (995×1 px, 234 KB)
2025-02-11_15-24-01.png (1×1 px, 227 KB)
2025-02-11_15-25-13.png (1×1 px, 221 KB)

New Pages/Section Suggestions

✅ first slash❓2nd slashNo slash
2025-02-11_15-27-27.png (1×1 px, 282 KB)
2025-02-11_15-28-04.png (997×1 px, 275 KB)
2025-02-11_15-29-57.png (1×1 px, 243 KB)

Hey @GMikesell-WMF, thanks for QAing. I think the string "W.../foodfoodfoodfoodfoodfoodfoodfood..." is fine in this case as I believe we can assume the second/last part is more definitive in identifying the collection (for example: "Wiki99/food" and "Wiki99/chemistry")

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

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

[mediawiki/extensions/ContentTranslation@master] CustomInfoChip: increase specificity

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

Change #1123406 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CustomInfoChip: increase specificity

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

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

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

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

Change #1124141 merged by jenkins-bot:

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

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

@eamedina Confirmed that collection names are truncated or split according to the specified rules based on container width and view type on mobile as seen in the screenshots below. I will move this to sign-off. Thanks for all your work!

Test Result - TestWiki

Status: ✅ PASS
Environment: TestWiki
OS: macOS Sonoma 15.3
Browser: Chrome 132
Device: MBA
Emulated Device: NA

Test Artifact(s):

https://test.m.wikipedia.org/w/index.php?title=Special:ContentTranslation&active-list=suggestions&from=es&to=en&filter-type=collections&filter-id=Sustainability
https://test.m.wikipedia.org/w/index.php?title=Special:ContentTranslation&active-list=suggestions&from=es&to=en&filter-type=collections&filter-id=Wiki99/food

Test Steps

Test Case 2: Ensure Proper Truncation of Collection Labels in Different Views for Mobile

  1. Navigate to the Suggestions view and identify collection labels.
  2. Verify that simple collection labels are truncated when they exceed the container width (e.g., "WikiProject Women's Health" → "WikiProject Wom...").
  3. Check collection labels with paths and ensure truncation follows the progressive approach. For example, "CEE Spring 2024/Structure/Russian Federation" should appear as "CEE Spring.../Russian Federation."
  4. In space-constrained areas, confirm that ultra-short versions are displayed (e.g., "Wiki.../Russian...").
  5. AC2: Confirm that collection names are truncated or split according to the specified rules based on container width and view type.

Mobile
Adjust Suggestions

✅ first slash✅ 2nd slash✅ No slash
2025-03-07_13-29-17.png (814×1 px, 162 KB)
2025-03-07_13-30-24.png (858×1 px, 168 KB)
2025-03-07_13-31-10.png (889×1 px, 201 KB)

Top Suggestions

✅ first slash✅ 2nd slashNo slash
2025-03-07_13-54-50 (1).png (811×1 px, 161 KB)
2025-03-07_13-55-33.png (821×1 px, 159 KB)
2025-03-07_13-56-10.png (846×1 px, 169 KB)

New Pages/Section Suggestions

✅ first slash❓2nd slashNo slash
2025-03-07_15-16-36.png (821×1 px, 161 KB)
2025-03-07_15-17-09.png (841×1 px, 164 KB)
2025-03-07_15-17-49.png (839×1 px, 168 KB)

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

[mediawiki/extensions/ContentTranslation@master] Remove unnecessary max-width constraint in CustomInfoChip

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

Change #1136438 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] Remove unnecessary max-width constraint in CustomInfoChip

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

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

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

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

Change #1136452 merged by jenkins-bot:

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

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

@eamedina Retest with the latest update of Remove unnecessary max-width constraint in CustomInfoChip. I will move this to sign-off. Thanks for all your work!

Test Result - Test Wiki

Status: ✅ PASS
Environment: TestWiki
OS: macOS Sonoma 15.4.1
Browser: Chrome 135
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 2: Ensure Proper Truncation of Collection Labels in Different Views for Mobile

  1. Navigate to the Suggestions view and identify collection labels.
  2. Verify that simple collection labels are truncated when they exceed the container width (e.g., "WikiProject Women's Health" → "WikiProject Wom...").
  3. Check collection labels with paths and ensure truncation follows the progressive approach. For example, "CEE Spring 2024/Structure/Russian Federation" should appear as "CEE Spring.../Russian Federation."
  4. In space-constrained areas, confirm that ultra-short versions are displayed (e.g., "Wiki.../Russian...").
  5. AC2: Confirm that collection names are truncated or split according to the specified rules based on container width and view type.

Mobile
Adjust Suggestions

✅ first slash✅ 2nd slash✅ No slash
2025-05-01_10-24-14.png (913×1 px, 215 KB)
2025-05-01_10-26-14.png (916×1 px, 193 KB)
2025-05-01_12-42-07.png (1×1 px, 198 KB)

Top Suggestions

✅ first slash✅ 2nd slashNo slash
2025-05-01_12-39-38.png (1×1 px, 217 KB)
2025-05-01_10-28-55.png (955×1 px, 201 KB)
2025-05-01_12-40-56.png (1×1 px, 212 KB)

New Pages/Section Suggestions

✅ first slash✅2nd slash✅No slash
2025-05-01_10-22-01.png (936×1 px, 233 KB)
2025-05-01_16-03-30.png (1×1 px, 249 KB)
2025-05-01_12-41-32.png (1×1 px, 204 KB)