Background: For a registered participant in an ongoing campaign event with contributions enabled, the extension shows a post-edit modal after they edit a page, asking whether they want to associate that edit with the event (count it as a contribution). That modal is redundant when the page they edited is already on that same event’s worklist — the intent is clear. This task changes that path: do not show the modal and count the edit as a contribution automatically (same outcome as if they had confirmed in the modal). Other cases (article not on the worklist, user not in scope for the modal, etc.) stay unchanged.
Type of story
- Backend
Acceptance criteria
- When a registered participant edits a page during an ongoing event that has contributions enabled, and that page is on that same event’s worklist, the post-publication association modal must not be shown and the edit must count as a contribution automatically (equivalent to confirming association in the modal), without further user interaction on that step.
- When the same user/event context applies but the edited page is not on that event’s worklist, behaviour is unchanged: the association modal is shown as today and the user chooses whether to associate the edit.
- The frontend still receives a signal to show lightweight feedback (e.g. confirmation) instead of the modal, where that pattern already exists for this flow.
Depends on
- T423332 (worklist store — provides isArticleInWorklist())
Testing required?
- Yes
- Minimum testing: unit tests covering each branch of the hook logic:
- registered participant + ongoing event + contributions enabled + edited page on worklist → association modal not shown; edit counted as contribution automatically; confirmation signal as specified
- same context + edited page not on worklist → association modal still shown; no automatic contribution without user choice
Split patches suggestion
- Branch 1: hook extension + registered-participant auto-contribution (worklist) branch + unit tests
Gherkin scenarios
Feature: Post-save hook — auto-count contribution when edited page is on the event worklist
- Scenario: Registered participant edits a worklist article — association modal suppressed, contribution automatic
- Given an ongoing campaign event with contributions enabled
- And the event worklist contains article "Main Page"
- And user "Alice" is a registered participant of that event
- When Alice edits and saves "Main Page"
- Then the post-publication association modal is not shown
- And the edit counts as a contribution to that event automatically
- And the frontend receives a signal to show lightweight confirmation (instead of the modal)
- Scenario: Registered participant edits a page not on the worklist — association modal unchanged
- Given an ongoing campaign event with contributions enabled
- And the event worklist does not contain article "Talk:Foo"
- And user "Alice" is a registered participant of that event
- When Alice edits and saves "Talk:Foo"
- Then the post-publication association modal is shown as today
- And Alice can choose whether to associate the edit (no automatic contribution without that choice)