Page MenuHomePhabricator

Add delete actions to worklist table
Closed, ResolvedPublic

Description

Background: The article list table (T423655) needs a delete action for authorised users. This task adds an Actions column to the table with a Remove button. Clicking Remove shows a confirmation dialog; on confirmation, the DELETE /worklist/{article_id} API (T423656) is called. The row is removed from the DOM on success.

Type of story
  • Front end
Acceptance criteria
  • An Actions column is added to the worklist article table (T423655).
  • Any logged in user (not temp account) can see a Remove button on every row
  • Clicking the Remove button opens a confirmation dialog before any API call is made.
  • Clicking Cancel in the confirmation dialog closes the dialog without deleting the article.
  • Clicking Remove in the confirmation dialog calls the PATCH API endpoint (T423656).
  • On successful deletion: the row is removed.
Design
  • Design from T422733 is required before implementation.

https://www.figma.com/design/QB7pHRngsu2x1PgZuSxi23/Collaborative-tracking-against-a-worklist?node-id=270-15625&t=M28k7Ro41Q9aGzBs-0

Messages and copy included
  • For happy path:
    • Message key: campaignevents-worklist-remove-button-label
      • Message text: "Remove"
      • Context: label for the Remove button in the Actions column of the worklist article table
    • Message key: campaignevents-worklist-remove-confirm-title
      • Message text: "Remove page from worklist?"
      • Context: title of the confirmation dialog shown before deleting an article from the worklist
    • Message key: campaignevents-worklist-remove-confirm-body
      • Message text: "This page will be removed from the worklist."
      • Context: body text of the confirmation dialog shown before deleting an article from the worklist
    • Message key: campaignevents-worklist-remove-confirm-action
      • Message text: "Remove"
      • Context: label of the destructive primary button that confirms removal in the confirmation dialog
    • Message key: campaignevents-worklist-remove-confirm-cancel
      • Message text: "Cancel"
      • Context: label of the button that dismisses the confirmation dialog without removing the article
    • Message key: campaignevents-worklist-remove-success
      • Message text: "The page was removed from the worklist."
      • Context: success notification shown after an article is successfully removed from the worklist
  • For unhappy path:
    • Message key: campaignevents-worklist-remove-error
      • Message suggestion: "The page could not be removed from the worklist. $1 ($1 = API error message)"
      • Context: error notification shown when the API call fails (mirrors the contributions delete-actions pattern)
Are there dependencies (on someone else or learning something new)?
  • Design from T422733 must be available before implementation.
Depends on
  • T423655 (article list table must exist for the Actions column to be added to it)
  • T423656 (DELETE /worklist/{article_id} REST API must exist before the delete flow can call it)
Testing required?
  • Yes
  • Minimum testing to pass QA:
    • With feature flag ON: all Gherkin scenarios pass; confirm/cancel behavior is correct; row is removed on success.
    • With feature flag OFF: covered by T423612/T423606 (Worklist tab is not shown).
  • Tested end-to-end in: task-11 (this task)
Split patches suggestion
  • Branch 1: Actions column
  • Branch 2: Confirmation dialog + DELETE API call + row removal (fadeOut) + i18n

Screenshot 2026-07-13 at 06.43.56.png (410×457 px, 55 KB)

Event Timeline

Change #1298235 had a related patch set uploaded (by Cmelo; author: Cmelo):

[mediawiki/extensions/CampaignEvents@master] Add delete actions to worklist table

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

Change #1298347 had a related patch set uploaded (by Cmelo; author: Cmelo):

[mediawiki/extensions/CampaignEvents@master] Implement delete action

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

Hi @JFernandez-WMF the current implementation of the delete action has an "Action" column the desingns I found on figma has an empty column would like to confirm if this is the final version, thanks in advance:
https://www.figma.com/design/QB7pHRngsu2x1PgZuSxi23/Collaborative-tracking-against-a-worklist?node-id=270-15625&t=M28k7Ro41Q9aGzBs-0

Screenshot 2026-07-13 at 06.47.11.png (980×289 px, 31 KB)

cc: @Daimona

hi @cmelo, i think we should be using an empty header here as specified in figma - i don't think 'actions' provides meaningful information and can be redundant. let's just make sure the trash button has a proper label for screen readers. if we ever expand the column to have multiple actions then let's revise this argument, but for now i think it should be empty. let me know what you think!

Change #1298235 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] Add delete buttons to worklist table

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

Change #1298347 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] Implement delete action

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

  • An Actions column is added to the worklist article table (T423655).

✅ The column is there.

  • Any logged in user (not temp account) can see a Remove button on every row

✅ Named users can see the column and the buttons on every row; unnamed users (logged-out or temp) can't see the column at all.

  • Clicking the Remove button opens a confirmation dialog before any API call is made.

✅ It does.

  • Clicking Cancel in the confirmation dialog closes the dialog without deleting the article.

✅ Verified, and same with the close button.

  • Clicking Remove in the confirmation dialog calls the PATCH API endpoint (T423656).

✅ Verified.

  • On successful deletion: the row is removed.

✅ This is working, but as previously noted: because the secondary storage is updated asynchronously, the row will re-appear if the page is refreshed before the job has run.

Messages and copy included
  • For happy path:
    • Message key: campaignevents-worklist-remove-button-label
      • Message text: "Remove"
      • Context: label for the Remove button in the Actions column of the worklist article table

✅ Verified.

  • Message key: campaignevents-worklist-remove-confirm-title
    • Message text: "Remove page from worklist?"
    • Context: title of the confirmation dialog shown before deleting an article from the worklist

✅ Verified.

  • Message key: campaignevents-worklist-remove-confirm-body
    • Message text: "This page will be removed from the worklist."
    • Context: body text of the confirmation dialog shown before deleting an article from the worklist

✅ Verified.

  • Message key: campaignevents-worklist-remove-confirm-action
    • Message text: "Remove"
    • Context: label of the destructive primary button that confirms removal in the confirmation dialog

✅ Verified.

  • Message key: campaignevents-worklist-remove-confirm-cancel
    • Message text: "Cancel"
    • Context: label of the button that dismisses the confirmation dialog without removing the article

✅ Verified.

  • Message key: campaignevents-worklist-remove-success
    • Message text: "The page was removed from the worklist."
    • Context: success notification shown after an article is successfully removed from the worklist

✅ Verified.

  • For unhappy path:
    • Message key: campaignevents-worklist-remove-error
      • Message suggestion: "The page could not be removed from the worklist. $1 ($1 = API error message)"
      • Context: error notification shown when the API call fails (mirrors the contributions delete-actions pattern)

✅ Verified. For example, when the worklist page is protected: The page could not be removed from the worklist. This page has been protected to prevent editing or other actions..


Moving this task to epic sign-off for the final testing and design verifications.