Make label manager columns sortablePublicFeature
| Samwilson | |
| Nov 18 2025, 8:14 AM |
| F71106141: 2025-12-17_08-55-18.webm | |
| Dec 17 2025, 5:23 PM |
| F71106130: 2025-12-17_08-43-42.webm | |
| Dec 17 2025, 5:23 PM |
| F71092102: 2025-12-15_11-37-55.mp4 | |
| Dec 16 2025, 7:55 PM |
Description
The 'Label' and 'Items' columns of Special:WatchlistLabels should be sortable.
Derived Requirement
Enable sorting for the Label and Items columns on *Special:WatchlistLabels*.
Users must be able to sort labels in ascending and descending order by label name and by the number of watchlist items.
Sorting behavior must be consistent, deterministic, and correctly reflected in the table UI.
Test Steps
Test Case 1: Verify Label column is sortable
- Log in to the wiki.
- Navigate to *Special:WatchlistLabels*.
- Click the Label column header.
- Observe the order of labels.
- Click the Label column header again.
- ✅❓❌⬜ AC1: Confirm labels sort alphabetically in ascending order on first click and descending order on second click.
Test Case 2: Verify Items column is sortable
- On *Special:WatchlistLabels*, click the Items column header.
- Observe the order of labels based on item count.
- Click the Items column header again.
- ✅❓❌⬜ AC2: Confirm labels sort numerically by item count in ascending order on first click and descending order on second click.
Test Case 3: Verify sorting indicators are displayed
- Click the Label column header.
- Observe the column header UI.
- ✅❓❌⬜ AC3: Confirm a visual indicator (e.g., arrow) appears showing the active sort column and direction.
Test Case 4: Verify sorting persists during interaction
- Apply sorting to either Label or Items column.
- Refresh the page.
- ✅❓❌⬜ AC4: Confirm the selected sort order persists after refresh or resets consistently to a documented default.
QA Results -Beta
| AC | Status | Details |
|---|---|---|
| 1 | ✅ | T410356#11471646 |
| 2 | ⬜ | T410356#11466151 |
| 3 | ✅ | T410356#11466151 |
| 4 | ✅ | T410356#11466151 |
Details
Related Objects
- Mentioned In
- T412887: Sort labels alphabetically on Special:Watchlist
T408775: Add table of labels to Special:WatchlistLabels - Mentioned Here
- T413046: Codex-PHP: Table sort URLs don't keep other parameters
rMWec5cd6e2d38c: Use a lock in DatabaseBlockStore::doAutoblock
rMWb7d0aef192e9: mediawiki.content.json: Use neutral tokens for JSON tables
T411611: Create popup for adding labels
Event Timeline
Change #1214467 had a related patch set uploaded (by Samwilson; author: Samwilson):
[mediawiki/core@master] Add sorting to Special:WatchlistLabels
Change #1214467 merged by jenkins-bot:
[mediawiki/core@master] Add sorting to Special:WatchlistLabels
@Samwilson Please review AC1, thanks!
Test Result - Beta
Status: ✅ PASS ❌ FAIL
Environment: Beta: 1.46.0-alpha (b7d0aef) 19:07, 16 December 2025
OS: macOS Tahoe 26.1
Browser: Chrome 142
Device: MBA
Emulated Device: NA
Test Artifact(s):
Test Steps
Test Case 1: Verify Label column is sortable
- Log in to the wiki.
- Navigate to *Special:WatchlistLabels*.
- Click the Label column header.
- Observe the order of labels.
- Click the Label column header again.
- ❌AC1: Confirm labels sort alphabetically in ascending order on first click and descending order on second click.
Sorting is off with ascending and descending, as seen in the video below.
Test Case 2: Verify Items column is sortable
- On *Special:WatchlistLabels*, click the Items column header.
- Observe the order of labels based on item count.
- Click the Items column header again.
- ⬜ AC2: Confirm labels sort numerically by item count in ascending order on first click and descending order on second click.
Cannot link Items just yet, until T411611: Create popup for adding labels is completed
Test Case 3: Verify sorting indicators are displayed
- Click the Label column header.
- Observe the column header UI.
- ✅ AC3: Confirm a visual indicator (e.g., arrow) appears showing the active sort column and direction.
See AC1
Test Case 4: Verify sorting persists during interaction
- Apply sorting to either Label or Items column.
- Refresh the page.
- ✅ AC4: Confirm the selected sort order persists after refresh or resets consistently to a documented default.
See AC1
Change #1218864 had a related patch set uploaded (by Samwilson; author: Samwilson):
[mediawiki/core@master] Sort Special:WatchlistLabels columns by unformatted values
Thanks for finding this @GMikesell-WMF the sorting has been broken since we added the checkboxes! Oops. Hopefully the above patch will fix it up.
Change #1218864 merged by jenkins-bot:
[mediawiki/core@master] Sort Special:WatchlistLabels columns by unformatted values
@Samwilson Sorting on Desktop looks good, but on mobile, when I click on the sorting, it goes to the home page for some reason. Also a side issue, when I click on sorting, the delete button flickers. I'm not sure if it matters or if you'd like a separate task for it.
Test Result - Beta
Status: ✅ PASS ❌ FAIL
Environment: Beta: 1.46.0-alpha (ec5cd6e) 15:05, 17 December 2025
OS: macOS Tahoe 26.1
Browser: Chrome 143
Device: MBA
Emulated Device: NA
Test Artifact(s):
Test Steps
Test Case 1: Verify Label column is sortable
- Log in to the wiki.
- Navigate to *Special:WatchlistLabels*.
- Click the Label column header.
- Observe the order of labels.
- Click the Label column header again.
- ❌AC1: Confirm labels sort alphabetically in ascending order on first click and descending order on second click.
| ✅Desktop | ❌Mobile |
|---|---|
Thanks!
- The weird mobile behaviour is not due to mobile, but because you're viewing the page there via the ?title=Special:WatchlistLabels rather than /Special:WatchlistLabels. I've opened a bug report for it: T413046: Codex-PHP: Table sort URLs don't keep other parameters
- The flicker of the delete button is due to the speed of loading of the Javascript interface (i.e. it loads for the non-JS interface as not disabled, and is then disabled when JS comes along and determines that nothing is yet selected), and I don't think is anything to worry about.
So all good here, and I'll try to sort out the bug separately.
Got it! I'll mark this as Resolved since there is another task for Mobile. Thanks for all your work!