Page MenuHomePhabricator

Handle submission of "assign label" modal
Closed, ResolvedPublic

Description

When the "assign" button is clicked on the "assign labels" modal

  • the form should submit
  • on submission the selected labels should be assigned to the selected watchlist items
  • then reload Special:EditWatchlist in the same place in the pagination
  • show a message saying something like "X labels assigned to Y pages" (but check with design/product for exact wording)

The new form submission parameters are watchlistlabels[] (an array of IDs) and watchlistlabels=assign|unassign (the action to take), as well as the existing wpTitles[] array. For example:

{
	"wpEditToken": "…",
	"limit": "50",
	"watchlistlabels[]": ["21","33"],
	"watchlistlabels-action": "assign",
	"wpTitles[]": ["Lorem", "Ipsum"]
}

Event Timeline

Cparle changed the task status from Open to In Progress.Dec 18 2025, 3:38 PM
Cparle claimed this task.
Cparle moved this task from Ready for Dev to In Development on the Community-Tech (Fox Squad) board.

then reload Special:EditWatchlist in the same place in the pagination

This is how it should be done, but it's not how the current form works. After submitting, it stays with the response of the POST request. Not that it matters too much because reloading/resubmitting wouldn't do anything (although it does have an in accurate message if you re-submit, because it says the same number of titles were removed).

Should we just stay with the status quo for now? To keep it simpler. Either that, or update it to do a GET request back to the same place, with a session-stored flash message, for both the label assigning and the watchlist removing?

Change #1219925 had a related patch set uploaded (by Cparle; author: Cparle):

[mediawiki/core@master] Handle watchlist label assignment on Special:EditWatchlist

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

then reload Special:EditWatchlist in the same place in the pagination

This is how it should be done, but it's not how the current form works. After submitting, it stays with the response of the POST request. Not that it matters too much because reloading/resubmitting wouldn't do anything (although it does have an in accurate message if you re-submit, because it says the same number of titles were removed).

Should we just stay with the status quo for now? To keep it simpler. Either that, or update it to do a GET request back to the same place, with a session-stored flash message, for both the label assigning and the watchlist removing?

Hmm it would have been simpler, but I've done it now :)

Change #1219925 merged by jenkins-bot:

[mediawiki/core@master] Handle watchlist label assignment on Special:EditWatchlist

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