Page MenuHomePhabricator

Add edit to this event dialog should show error if edit has already been added
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

In the Collaborative Contributions tab, add an edit to the event using the "Add an edit to this event" button
Once the edit has been successfully added, add the same edit again

What happens?:
The edit will not be added a second time to the collaborative contributions list, but the dialog will give the appearance that it will be added again.

What should have happened instead?:
It should say "This edit has already been added to this event."

Other information (browser name/version, screenshots, etc.):
This displays after the edit has already been successfully added, and then is attempted to be added again:

behavior that needs changed to show it has already been added
Screen Recording 2025-12-22 at 2.16.29 PM.gif (1×1 px, 1 MB)

Event Timeline

The API endpoint currently makes no distinction between the two scenarios because a successful response is still valid. Maybe we could change the status code or add a boolean to the response body for clients that need to make this distinction.

Change #1251555 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/extensions/CampaignEvents@master] EventContributionsHandler: respond with whether the association is new

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

It should say "This edit has already been added to this event."

To clarify, should it be a success message or what category? The point being that if the edit is already associated with the event, the action was in a sense successful; or in other words, the end state matches what the user requested.

Change #1251557 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/extensions/CampaignEvents@master] [WIP] EventDetails: clarify if an edit is already associated with the event

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

@Daimona, yes, the action is in a sense successful, but it's not an accurate portrayal of what happened, since there will be no change after the edit was "added." This could be confusing to the user, so I think it's useful to accurately portray the impact of their action. So, I think an error message could work. Is there perhaps another message category you recommend (not sure if I know all of the categories, so perhaps one is more fitting).

@Daimona, yes, the action is in a sense successful, but it's not an accurate portrayal of what happened, since there will be no change after the edit was "added." This could be confusing to the user, so I think it's useful to accurately portray the impact of their action. So, I think an error message could work. Is there perhaps another message category you recommend (not sure if I know all of the categories, so perhaps one is more fitting).

Sorry I should have mentioned that the available categories are those for Codex's Message component. Error seems a bit excessive to me, because the user doesn't need to do anything else, everything is in the state they wanted it to be. Perhaps warning? I don't know if notice would be appropriate here. There are probably more design guidelines that I'm unaware of.

Yeah, error seems excessive. Warning (or maybe notice?) is probably better. But we can wait until @JFernandez-WMF is back next week to ask her, in case there are other general design guidelines or best practices that we're unaware of.

Change #1251555 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] EventContributionsHandler: respond with whether the association is new

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

Yeah, error seems excessive. Warning (or maybe notice?) is probably better. But we can wait until @JFernandez-WMF is back next week to ask her, in case there are other general design guidelines or best practices that we're unaware of.

Moving back to needs design for this question on what the appropriate message category would be. The patch is otherwise ready except for this.

thank you for tagging me on this and apologies for the delay - i actually think we should use notice here. the action does not create a failure (so no error), it is also not a success since nothing was added, and it also doesn't involve a risk/caution - there is no consequence or risk or something the user should avoid doing. what do you all think?

Thanks, makes sense! This is now ready for review then.