Page MenuHomePhabricator

Allow organizer or editor to add an edit
Closed, ResolvedPublic3 Estimated Story Points

Description

Note: we will need to check the organizer's permissions. And to do this, we will likely need to ask them to make the change on the wiki where the event was created, like for most other write actions. Note that they would still be able to add edits made on other wikis.

User stories:

As an organizer of an event, I want to be able to add edits done by participants that I think are valid event edits, so that the contribution data for the event can be reliable and accurate.

As an event participant who made an edit, I want to be able to add edits done by me that I think are valid event edits, so that I can be properly recognized for the contributions that I made and have a clear understanding of my impact.

Notes:

* Whoever takes on this ticket will determine the best way to identify an edit to add.

Acceptance Criteria:
  • Given that a user is on the Contributions tab,
    • And they are an organizer of the event,
    • Or they are a registered participant
  • They should see a button in the top corner, with the label: "Add edit to this event"
    • And if they click on the button, they should see the following text:
      • Header: "Add an edit to [event name]"
      • Line 1: "Add an edit"
      • Line 2: Text box to add in edit
      • Line 3: "You can enter a revision ID (oldid)"
        • Note: Instructional text may change, depending on the solution that is implemented.
    • And the dialog should have the following options as buttons:
      • Cancel
      • Add edit (in blue)
    • And if they select Cancel,
      • The dialog disappears and no further action needs to be done
      • And if they select "Add edit,"
        • The edit is added if valid,
        • And they receive a confirmation message: "Edit added. It will appear here soon."
      • And if the edit is not valid, add an error message, which includes:
        • Edit not done by the editor or organizer
          • If editor: "Add an edit that you did only."
          • If organizer: "Add an edit by an event participant only."
        • Edit not on a target wiki of event
          • "Add an edit on a target wiki of the event."
        • Edit not during event period (i.e., between start & end date of event)
          • "This event is not currently active, so you cannot associate this edit with it."
    • And if they try to add the same edit twice (e.g., before the first job was processed)
      • The edit should still only be added once, and the second submission should be ignored (ignoreDuplicates on the job could suffice)

Design proposal:

  1. Participant/organizer clicks on 'Add edit to this event

Group 5400.png (811×1 px, 112 KB)

  1. Once that button is clicked, a dialog comes up prompting the user to insert an edit identifier: revision ID, or full diff link ( e.g. https://en.wikipedia.org/w/index.php?title=User_talk:PralineCoffee&oldid=1308319125)

Group 5399.png (811×1 px, 106 KB)

  1. After the user adds their edit, they receive a confirmation message.

{F66081226}

Out of scope:
  • Bulk add
  • Separate column/view to show added associations
  • Support for who has final "vote" in an "association war"
  • Logging: This will be handled separately in T406633. In the future, we will want to have some way to show added associations (i.e., who & when added), such as a new column or new tab with the data. This way, organizers or participants can stay up-to-date on changes that they may want to monitor. But we do not need to show this data in the UI for this ticket.

Event Timeline

ifried renamed this task from [placeholder] Allow organizer or editor to add an edit to Allow organizer or editor to add an edit.Sep 5 2025, 5:16 PM

@JFernandez-WMF, can you update the screenshot for "After the user adds their edit, they receive a confirmation message."?

Daimona updated the task description. (Show Details)
ifried updated the task description. (Show Details)

Change #1199503 had a related patch set uploaded (by Mhorsey; author: Mhorsey):

[mediawiki/extensions/CampaignEvents@master] Implement Dialog to add contributions to event

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

Change #1195227 had a related patch set uploaded (by Mhorsey; author: Mhorsey):

[mediawiki/core@master] Add header to codex table pager

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

Change #1195227 merged by jenkins-bot:

[mediawiki/core@master] Add header to codex table pager

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

Test wiki created on Patch demo by MHorsey-WMF using patch(es) linked to this task:
https://82f35f84e6.catalyst.wmcloud.org/w/

This changed how the display of the Special:SuggestedInvestigations page. Specifically before we had no caption and now we have a caption that was not in our designs.

Can this please be reverted or made specific to your special page? I would like to avoid these changes being deployed to our Special:SuggestedInvestigations special page during this week's train.

cc @MHorsey-WMF @Catrope

Specifically we have the following difference, which for us is not intended. We currently have issues with the table pager being too big on mobile devices, so having this caption at quite a large size is making this problem worse.

Currently deployed version on English WikipediaWhat it looks like on my dev wiki
image.png (387×1 px, 49 KB)
image.png (479×1 px, 59 KB)

^ I just updated the AC for the "edit not during event period" case, since a different message was recently agreed upon in T408960.


This changed how the display of the Special:SuggestedInvestigations page. Specifically before we had no caption and now we have a caption that was not in our designs.

Can this please be reverted or made specific to your special page? I would like to avoid these changes being deployed to our Special:SuggestedInvestigations special page during this week's train.

Apologies, this was an unintended change and I didn't realize it would happen. Still happy you quickly figured it out and fixed it well before I noticed the messages above.

One thing I just thought about: in the current implementation, when someone adds a contribution it is not added to the table in real time. Firstly, this would be tricky because some of the information we need to build the table row cannot quickly be built client-side (like figuring out the localised name of the wiki, or proper linking, etc.). But most importantly, even if that weren't an issue, new contributions are enqueued for delayed processing and not added immediately. It could be a matter of seconds, but under high load it could take minutes (and in extreme cases hours, or fail altogether). So, I don't think it can be "fixed", but maybe we can update the success message to clarify this point? E.g. "Edit added, it will appear here soon" (I know this sucks, it's just to give an idea of the general concept).

Perhaps make this edit later on?

Perhaps make this edit later on?

Makes sense to me, but one thing to keep in mind is that once the success message is translated, the old translation will remain until someone updates it.

Also, I forgot to do it in my previous comment, but pinging @ifried and @JFernandez-WMF for awareness.

Notes from Dec 1 meeting:

  • AC updated to have new success message
  • @MHorsey-WMF will create a separate task for error when trying to add an edit for a non-target wiki

Test wiki created on Patch demo by MHorsey-WMF using patch(es) linked to this task:
https://ad14911813.catalyst.wmcloud.org/w/

Change #1199503 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] Implement Dialog to add contributions to event

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

vaughnwalters subscribed.
Acceptance Criteria:
  • Given that a user is on the Contributions tab,
    • And they are an organizer of the event,
    • Or they are a registered participant
  • ✅ They should see a button in the top corner, with the label: "Add edit to this event"
    • And if they click on the button, they should see the following text:
      • ✅ Header: "Add an edit to [event name]"
      • ✅ Line 1: "Add an edit"
      • ✅ Line 2: Text box to add in edit
      • ✅ Line 3: "You can enter a revision ID (oldid)"
        • Note: Instructional text may change, depending on the solution that is implemented.
    • And the dialog should have the following options as buttons:
      • ✅ Cancel
      • ✅ Add edit (in blue)
    • And if they select Cancel,
      • ✅ The dialog disappears and no further action needs to be done
      • And if they select "Add edit,"
        • The edit is added if valid,
        • ✅ And they receive a confirmation message: "Edit added. It will appear here soon."
          Screenshot 2025-12-22 at 1.41.55 PM.png (640×1 px, 76 KB)
      • And if the edit is not valid, add an error message, which includes:
        • Edit not done by the editor or organizer
          • ✅ If editor: "Add an edit that you did only."
            Screenshot 2025-12-22 at 1.40.31 PM.png (632×1 px, 70 KB)
          • ✅ If organizer: "Add an edit by an event participant only."
            Screenshot 2025-12-22 at 2.21.57 PM.png (648×1 px, 70 KB)
        • Edit not on a target wiki of event
          • ✅ "Add an edit on a target wiki of the event."
            Screenshot 2025-12-22 at 2.55.31 PM.png (648×1 px, 79 KB)
        • Edit not during event period (i.e., between start & end date of event)
          • ✅ "This event is not currently active, so you cannot associate this edit with it."
            Screenshot 2025-12-19 at 4.49.06 PM.png (686×1 px, 88 KB)
            QA Note, AC met but created follow up task T413391
    • And if they try to add the same edit twice (e.g., before the first job was processed)
      • ❓ The edit should still only be added once, and the second submission should be ignored (ignoreDuplicates on the job could suffice)
        Screen Recording 2025-12-22 at 1.43.22 PM.gif (1×1 px, 1 MB)
        QA note - I am not sure if this is behaving in the expected way - I add the revision and then can get a success message when adding again and it doesn't give any notice that it has already been added. Though the edit does correctly add only once. I created a follow up task T413396

QA created follow up tasks:

Add edit to this event dialog should show error if edit has already been added : T413396
Do not display the "Add edit to this event" button unless the event is live: T413391
Error or success message from "Add an edit to this event" dialog should not persist: T413411


AC is met and I have created a few follow up tasks. I am sending this to design sign off and have a question about the difference between what was created in the comp and what was implemented in the build for the styling of the "Add an edit" line. Is this discrepancy as it is built acceptable @JFernandez-WMF ?

compbuild
Screenshot 2025-12-19 at 4.47.06 PM.png (362×736 px, 86 KB)
Screenshot 2025-12-19 at 4.45.49 PM.png (542×1 px, 58 KB)

thanks @vaughnwalters! i have a few questions so moving to dev input..

on the design, the 'edit reference' section is using the Codex field component, with a label ('Edit reference') and a helper text ('You can enter a revision ID (oldid)'). on the build, there's an extra 'Add an edit' in the description of the dialog which i don't think we need since the action is already explained in the title.

i think having a clear label is more intuitive, and the helper text can aid with a supporting explanation. can we match the build with what is on the design?

also, looking at the copy, is there a possibility that some users don't know what a revision ID/oldid is? should we explain a little more about where to find that ID, for example? cc @ifried

on the design, the 'edit reference' section is using the Codex field component, with a label ('Edit reference') and a helper text ('You can enter a revision ID (oldid)'). on the build, there's an extra 'Add an edit' in the description of the dialog which i don't think we need since the action is already explained in the title.

i think having a clear label is more intuitive, and the helper text can aid with a supporting explanation. can we match the build with what is on the design?

The build is based on the AC (which supersede the designs). That said, I agree that the current version is quite repetitive. Implementing the change will be easy once it is agreed upon.

also, looking at the copy, is there a possibility that some users don't know what a revision ID/oldid is? should we explain a little more about where to find that ID, for example? cc @ifried

Makes sense to me.

+1 to what Daimona said, and:

also, looking at the copy, is there a possibility that some users don't know what a revision ID/oldid is? should we explain a little more about where to find that ID, for example? cc @ifried

also make sense to me.

Test wiki on Patch demo by MHorsey-WMF using patch(es) linked to this task was deleted:

https://ad14911813.catalyst.wmcloud.org/w/

This has been released, so I am marking it as done.