Page MenuHomePhabricator

Create popup for adding labels
Closed, ResolvedPublic

Assigned To
Authored By
Cparle
Dec 3 2025, 12:00 PM
Referenced Files
F71457096: 2026-01-06_12-07-40.mp4
Jan 6 2026, 11:02 PM
F71457075: 2026-01-06_11-56-08.mp4
Jan 6 2026, 11:02 PM
F71457072: 2026-01-06_11-55-03.mp4
Jan 6 2026, 11:02 PM
F71457114: 2026-01-06_11-55-03.mp4
Jan 6 2026, 11:02 PM
F71456882: 2026-01-06_12-02-24.png
Jan 6 2026, 11:02 PM
F71456878: 2026-01-06_12-00-52.png
Jan 6 2026, 11:02 PM
F71456864: 2026-01-06_11-53-51.mp4
Jan 6 2026, 11:02 PM
F71456858: 2026-01-06_11-39-07.png
Jan 6 2026, 11:02 PM

Description

Add a new button beside the "remove page" button that says "assign label"

The new button should be disabled unless one or more checkboxes is clicked, with a hover state saying "please select one or more watched items you want to assign labels to"

When the new button is clicked, if one or more checkboxes are clicked, show a modal containing

  • all labels with checkboxes beside them
  • text saying "select the labels you want assigned to ..." and then a list of the first 3 page titles, plus the number of other pages that will be affected
  • an "assign" button to confirm the assignment
  • a "cancel" button for closing the modal without action

image.png (1×2 px, 268 KB)

Actually assigning the labels is covered by the parent task


Derived Requirement

Ensure that users can initiate label assignment for watched pages via a dedicated Assign label action that is conditionally enabled based on selection state. When activated with one or more selected items, the system must present a modal that allows users to select labels and confirm or cancel the assignment. The feature must provide clear feedback when no items are selected and must not perform any label assignment unless explicitly confirmed by the user.

Test Steps

Test Case 1: Assign Label Button Disabled When No Items Are Selected

Preconditions

  • The user has access to a list of watched pages that support bulk actions.
  • No checkboxes are selected.
  1. Navigate to the page containing the list of watched items.
  2. Locate the Assign label button next to the Remove page button.
  3. Hover over the Assign label button.
  4. Attempt to click the Assign label button.
  5. ✅❓❌⬜ AC1: Confirm that the Assign label button is disabled when no checkboxes are selected and that hovering displays the message “please select one or more watched items you want to assign labels to”.

Test Case 2: Enable Assign Label Button When One or More Items Are Selected

Preconditions

  • Same as Test Case 1.
  1. Select one watched item using its checkbox.
  2. Observe the state of the Assign label button.
  3. Select multiple watched items using their checkboxes.
  4. Observe the button state again.
  5. ✅❓❌⬜ AC2: Confirm that the Assign label button becomes enabled when one or more watched items are selected.

Test Case 3: Display Assign Labels Modal with Correct Content

Preconditions

  • One or more watched items are selected.
  1. Click the enabled Assign label button.
  2. Observe the modal that appears.
  3. Review the contents of the modal.
  4. ✅❓❌⬜ AC3: Confirm that the modal displays a list of all available labels with checkboxes, includes instructional text indicating labels will be assigned to the selected items, shows the first three selected page titles with a count of additional affected pages if applicable, and provides both Assign and Cancel buttons.

Test Case 4: Cancel Assign Labels Modal Without Action

Preconditions

  • The Assign Labels modal is open.
  1. Click the Cancel button in the modal.
  2. Observe the state of the page after the modal closes.
  3. ✅❓❌⬜ AC4: Confirm that the modal closes without performing any label assignment and that the selection state of watched items remains unchanged.

Test Case 5: Confirm Assign Action Triggers Label Assignment Flow

Preconditions

  • The Assign Labels modal is open.
  • One or more labels are selected in the modal.
  1. Select one or more label checkboxes in the modal.
  2. Click the Assign button.
  3. Observe the immediate system response.
  4. ✅❓❌⬜ AC5: Confirm that clicking Assign initiates the label assignment confirmation flow and closes the modal, without errors or unintended side effects.

QA Results -Beta

ACStatusDetails
1Pass per T411611#11498358
2T411611#11498186
3T411611#11498186
4T411611#11498186
5Pass per T411611#11498358

Event Timeline

Cparle updated the task description. (Show Details)

Change #1218713 had a related patch set uploaded (by Samwilson; author: Samwilson):

[mediawiki/core@master] Special:EditWatchlist: Assign labels to pages

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

Change #1218722 had a related patch set uploaded (by Samwilson; author: Samwilson):

[mediawiki/core@master] New ResourceLoader modules for Special:EditWatchlist

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

Change #1218722 merged by jenkins-bot:

[mediawiki/core@master] New ResourceLoader modules for Special:EditWatchlist

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

Samwilson changed the task status from Open to In Progress.Dec 18 2025, 8:12 AM

Change #1218713 merged by jenkins-bot:

[mediawiki/core@master] Special:EditWatchlist: Assign labels to pages

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

Could we get a {{PLURAL:}} variable for how many pages the labels are being assigned to on watchlistlabels-editwatchlist-dialog-intro? The grammar in Finnish is sligtly different depending whether it is a single page or multiple pages. Thanks.

Change #1222830 had a related patch set uploaded (by Samwilson; author: Samwilson):

[mediawiki/core@master] Watchlist labels: Add label and page counts to i18n message

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

@Samoasambia Good point, thanks!

There might also only be one label listed, so there also needs to be a plural on labels.

Change #1222830 merged by jenkins-bot:

[mediawiki/core@master] Watchlist labels: Add label and page counts to i18n message

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

Thanks @Samwilson!

There is a small issue left: if you try to use $3 in a translation the interface says it is a unknown parameter and the translation gets marked as outdated.

@Samwilson Can you please review AC1 and AC5? Thanks!

UPDATE: AC1 & AC5 Pass per T411611#11498358

Test Result - Beta

Status: ✅ PASS
Environment: Beta
OS: macOS Tahoe 26.1
Browser: Chrome 143
Device: MBA
Emulated Device: NA

Test Artifact(s):

https://en.wikipedia.beta.wmcloud.org/wiki/Special:EditWatchlist

Test Steps

Test Case 1: Assign Label Button Disabled When No Items Are Selected

Preconditions

  • The user has access to a list of watched pages that support bulk actions.
  • No checkboxes are selected.
  1. Navigate to the page containing the list of watched items.
  2. Locate the Assign label button next to the Remove page button.
  3. Hover over the Assign label button.
  4. Attempt to click the Assign label button.
  5. AC1: Confirm that the Assign label button is disabled when no checkboxes are selected and that hovering displays the message “please select one or more watched items you want to assign labels to”.

Mobile does not have an option or shows all the pages

✅Desktop❌ Mobile✅Lang=es✅ Lang=ar
2026-01-06_11-39-07.png (803×1 px, 156 KB)
2026-01-06_12-00-52.png (898×1 px, 178 KB)
2026-01-06_12-02-24.png (909×1 px, 113 KB)

Test Case 2: Enable Assign Label Button When One or More Items Are Selected

Preconditions

  • Same as Test Case 1.
  1. Select one watched item using its checkbox.
  2. Observe the state of the Assign label button.
  3. Select multiple watched items using their checkboxes.
  4. Observe the button state again.
  5. AC2: Confirm that the Assign label button becomes enabled when one or more watched items are selected.

Test Case 3: Display Assign Labels Modal with Correct Content

Preconditions

  • One or more watched items are selected.
  1. Click the enabled Assign label button.
  2. Observe the modal that appears.
  3. Review the contents of the modal.
  4. AC3: Confirm that the modal displays a list of all available labels with checkboxes, includes instructional text indicating labels will be assigned to the selected items, shows the first three selected page titles with a count of additional affected pages if applicable, and provides both Assign and Cancel buttons.

Test Case 4: Cancel Assign Labels Modal Without Action

Preconditions

  • The Assign Labels modal is open.
  1. Click the Cancel button in the modal.
  2. Observe the state of the page after the modal closes.
  3. AC4: Confirm that the modal closes without performing any label assignment and that the selection state of watched items remains unchanged.

Test Case 5: Confirm Assign Action Triggers Label Assignment Flow

Preconditions

  • The Assign Labels modal is open.
  • One or more labels are selected in the modal.
  1. Select one or more label checkboxes in the modal.
  2. Click the Assign button.
  3. Observe the immediate system response.
  4. AC5: Confirm that clicking Assign initiates the label assignment confirmation flow and closes the modal, without errors or unintended side effects.

So I already assigned "World of Warcraft" two labels prior to with "hot dogs" and "burgers", hence why the number only changed in 88 fries. How can you see what page titles are selected say as in "hot dogs" since there are 3 that were assigned. When you are in "Manage labels", there are no clickable links to see what pages are under that label. If you go under "View and "Edit, I have no idea what article was assigned to what label and there is no prompt saying it's a repeat label that you are assigning.

AC1: Confirm that the Assign label button is disabled when no checkboxes are selected and that hovering displays the message “please select one or more watched items you want to assign labels to”.
Mobile does not have an option or shows all the pages

MobileFrontend doesn't support assigning labels yet. I've opened T413937: Add watchlist label assigning to MobileFrontend's Special:EditWatchlist.

AC5: Confirm that clicking Assign initiates the label assignment confirmation flow and closes the modal, without errors or unintended side effects.
So I already assigned "World of Warcraft" two labels prior to with "hot dogs" and "burgers", hence why the number only changed in 88 fries. How can you see what page titles are selected say as in "hot dogs" since there are 3 that were assigned. When you are in "Manage labels", there are no clickable links to see what pages are under that label. If you go under "View and "Edit, I have no idea what article was assigned to what label and there is no prompt saying it's a repeat label that you are assigning.

The labels will soon be visible in the Special:EditWatchlist table (once T411599 is done), so that will make it easier to see what's going on. But even so, you're right that the confirmation message doesn't necessarily match what's actually been done. That message is part of T411759, which should probably have gone to QA, but let me raise this in Slack and I'll create a separate task if we think it's needed.

Ok sounds good, I'll move this task along since other tasks cover it. I'll move this to Resolved. Thanks for all your work!

GMikesell-WMF updated Other Assignee, removed: GMikesell-WMF.
GMikesell-WMF updated the task description. (Show Details)