Page MenuHomePhabricator

Editor: display success and error messages when submitting the form
Closed, ResolvedPublic2 Estimated Story Points

Description

In T356622 we created an MVP editor which data submission capabilities. However we're missing to notify to the user when the form submission was successfully stored and when there's an error in that request.

This task needs design clarification and guidance but we could use Codex's Message component.

Design specification

Error stateSuccess stateMessage example in-situ
Message (1).png (76×640 px, 9 KB)
Message (2).png (54×640 px, 3 KB)
Success message (2) 1.png (651×1 px, 110 KB)

Success state messages will disappear after 4 seconds.
Error state messages should not disappear and should be dismissable.

Figma designs

NOTE: for API submission errors.

Event Timeline

Sgs triaged this task as High priority.Mar 14 2024, 6:29 PM
KStoller-WMF set the point value for this task to 2.
JFernandez-WMF subscribed.

FYI changing the auto-dismiss seconds count to 4 as per Codex guidelines.

Change #1016294 had a related patch set uploaded (by Cyndywikime; author: Cyndywikime):

[mediawiki/extensions/CommunityConfiguration@master] Editor: Show EditorMessages

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

@Sgs , is there a way in Codex, to put a backdrop/overlay on the success message that I can use as shown in the figma design?

@Sgs , is there a way in Codex, to put a backdrop/overlay on the success message that I can use as shown in the figma design?

I don't think we need to add the overlay based on the design discussion in slack thread. There are some issues outstanding that I'm not sure how to resolve.

    1. We are not displaying any useful information to the user about where the error is coming from and what to do to fix it. For instance we would show the same message for an offline user and for a user that does not have permissions to write in the configuration. Should we display this information? cc @Martin, and if so, how should we display it? cc @JFernandez-WMF.
    2. Aside from displaying some error details for some errors, I think we should configure the error handling in the editor application to take in account the "debug" flag and display more information about the error when present.
  1. How should we deal with long forms? In slack thread, Derek suggests to place the error at the end of the form rather than the beginning. While that helps a bit I find it a bit counterintuitive as a pattern, most MW forms seem to use the "top" for displaying this kind of information
  2. If the error is a validation error, the nice UX would include higlighting and maybe scrolling to the appropriate failing field. What do you think? @JFernandez-WMF

Except for (1.A) I think the rest of issues can be handled as follow-ups.

Change #1016294 merged by jenkins-bot:

[mediawiki/extensions/CommunityConfiguration@master] Editor: display success and error messages when submitting the form

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

Etonkovidova subscribed.

Checked in eswiki beta - the following notes are for @JFernandez-WMF review :

(1) The success message in Figma designs: "Your changes were successfully saved."
In eswiki beta

  • The success message doesn't have a word successfully and the dot is not present at the end of the message. I didn't find references on whether the message has been changed from the original design.
  • The success message is not an overlay
Figma - success messageeswiki beta
Message (2).png (54×640 px, 3 KB)
Screen Shot 2024-04-16 at 3.57.30 PM.png (842×2 px, 152 KB)

(2) The error message in Figma designs: "Something went wrong while saving your changes. Please try again later. If the problem persists consider filing an issue in the Phabricator."
In eswiki beta

  • "filing an issue in the Phabricator." is changed to "filing an issue in the bug reporting tool."
  • Only filing an issue is a link; in the Figma mockup, the link is applied to the whole phrase: filing an issue in the Phabricator.
  • Should there be a comma after persists ? as in "If the problem persists, consider filing an issue in the bug reporting tool."
  • The error message is not an overlay
Figma - error messageeswiki beta
Screen Shot 2024-04-16 at 5.00.17 PM.png (298×1 px, 41 KB)
Screen Shot 2024-04-16 at 4.28.39 PM.png (974×2 px, 180 KB)

(3) The specific error handling is present (as it was mentioned in @sgs comment) but only as DRAFT. Do we have mockups accommodating the error messages?
Btw, being offline is not handled - no error messages are displayed to offline users.

I added test cases for checking error handling to T360971: [QA task] Community configuration test cases .

Thank you for testing, Elena!

(1) and (2) are fine with me. We have decided per conversations with DST to keep the message inline and not on top of an overlay. The error message also looks good to me since we have discussed Phabricator not being the only bug-reporting tool possible. I agree we should add a coma after 'persists'. @Sgs can this be added, please? (not urgent)

Regarding (3), and also responding to SG's comments above:

We are not displaying any useful information to the user about where the error is coming from and what to do to fix it. For instance we would show the same message for an offline user and for a user that does not have permissions to write in the configuration. Should we display this information? cc @Martin, and if so, how should we display it? cc @JFernandez-WMF.

If there is some extra info about what the error is/where it is coming from and its (potential) solution I think we should be adding that to the copy of the error message. @Sgs Do we have an enumeration or a possible list of the errors that could come up?

  1. How should we deal with long forms? In slack thread, Derek suggests to place the error at the end of the form rather than the beginning. While that helps a bit I find it a bit counterintuitive as a pattern, most MW forms seem to use the "top" for displaying this kind of information
  2. If the error is a validation error, the nice UX would include higlighting and maybe scrolling to the appropriate failing field. What do you think? @JFernandez-WMF

Agree with displaying the message at the top since this is what is mostly used within our interfaces, and +1 to highlighting+scrolling to the field from where the error is coming from. Is this possible? Can we add it as a post-MVP task?

(1) and (2) are fine with me. We have decided per conversations with DST to keep the message inline and not on top of an overlay. The error message also looks good to me since we have discussed Phabricator not being the only bug-reporting tool possible. I agree we should add a coma after 'persists'. @Sgs can this be added, please? (not urgent)

Done!

Regarding (3), and also responding to SG's comments above:

We are not displaying any useful information to the user about where the error is coming from and what to do to fix it. For instance we would show the same message for an offline user and for a user that does not have permissions to write in the configuration. Should we display this information? cc @Martin, and if so, how should we display it? cc @JFernandez-WMF.

If there is some extra info about what the error is/where it is coming from and its (potential) solution I think we should be adding that to the copy of the error message. @Sgs Do we have an enumeration or a possible list of the errors that could come up?

A complete list of errors is hard to foresee but we can do some high level bucketing:

So far, I think we can start simple by classifying errors between validation and the rest. Later we can improve and fine grain "the rest".

  1. How should we deal with long forms? In slack thread, Derek suggests to place the error at the end of the form rather than the beginning. While that helps a bit I find it a bit counterintuitive as a pattern, most MW forms seem to use the "top" for displaying this kind of information
  2. If the error is a validation error, the nice UX would include higlighting and maybe scrolling to the appropriate failing field. What do you think? @JFernandez-WMF

Agree with displaying the message at the top since this is what is mostly used within our interfaces, and +1 to highlighting+scrolling to the field from where the error is coming from. Is this possible? Can we add it as a post-MVP task?

Could you add design (including copy texts) and acceptance criteria for the "highlighting + scrolling" in T363855: Improve validation errors wording and behavior? Thank you!

Thank you @JFernandez-WMF and @Sgs for clarification!

To summarize

  • Other errors, i.e. Network errors (eg: user is offline), API errors (eg: user is not authenticated) - should be there another task for that? I checked how VE and Special:EditGrowthConfig handle such errors:
VESpecial:EditGrowthConfig
Network errors (eg: user is offline)
Screen Shot 2024-04-30 at 11.33.43 AM.png (834×1 px, 172 KB)
Screen Shot 2024-04-30 at 11.36.40 AM.png (842×2 px, 80 KB)
API errors (eg: user is not authenticated)
Screen Shot 2024-04-30 at 11.35.08 AM.png (916×1 px, 251 KB)
Special:EditGrowthConfig page will silently fail to save edits without any message to user.