Page MenuHomePhabricator

Improve validation errors wording and behavior
Closed, ResolvedPublic3 Estimated Story Points

Description

Given I am an administrator I would like to have meaningful errors that point to the form field that caused a validation error.

Current status
Currently the validation error message content is: "communityconfiguration-schema-validation-error": "DRAFT: $2. Key: $1". A made up example of this is: DRAFT: String value found, but a number is required. Key: section_image_recommendation.maxTasksPerDay. We cannot do much about the english string returned by the validation library justinrainbow (argument $2) until we tackle T351879. But we can improve the Key: <JsonPointer> part (argument $1).

Screenshot 2024-05-15 at 17.16.25.png (336×2 px, 81 KB)

Proposed design
Follow Codex form guidelines for validation.

Screenshot 2024-05-15 at 17.23.12.png (1×664 px, 71 KB)

  • Instead of below the form, on the top. When we tackle T364500 we can move it to the fixed footer.
  • Instead of "Name is required" we can display DRAFT: String value found, but a number is required. in English and as a draft.

Acceptance criteria

  • For validation errors, change the headline of the error which currently displays Something went wrong while saving your changes. Please try again later. to There are $1 errors in this form where $1 is the number of errors
  • Display validation error field names in the body of the error message
  • Highlight the relevant field to the error (If it is a nested field it would be ok to higlight its parent as an initial version)
  • Nice to have: Display validation error field names in the body of the error message as anchors to the relevant field

Open question

  • Should we remove the If the problem persists, consider filling an issue in the bug reporting tool. footer line if the error is a validation error?

Related Objects

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Sgs triaged this task as Medium priority.Apr 30 2024, 5:39 PM
Sgs raised the priority of this task from Medium to Needs Triage.
Sgs updated the task description. (Show Details)

@JFernandez-WMF could you help improving the description of the proposed design. Ty!

KStoller-WMF moved this task from Inbox to Estimated tasks backlog on the Growth-Team board.
Sgs raised the priority of this task from Medium to High.May 9 2024, 4:33 PM
Sgs set the point value for this task to 3.May 17 2024, 4:26 PM
KStoller-WMF lowered the priority of this task from High to Medium.May 28 2024, 4:42 PM

Change #1037594 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/extensions/CommunityConfiguration@master] Explicitly add validation data

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

Change #1037595 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/extensions/CommunityConfiguration@master] Rework Editor messages system and improve validation error message

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

Change #1037594 merged by jenkins-bot:

[mediawiki/extensions/CommunityConfiguration@master] Explicitly add validation data

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

Change #1037818 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/extensions/CommunityConfiguration@master] Show inline validation messages

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

Change #1037598 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/extensions/CommunityConfiguration@master] Move message to above submit button

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

Change #1037595 merged by jenkins-bot:

[mediawiki/extensions/CommunityConfiguration@master] Rework Editor messages system and improve validation error message

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

The current error message doesn't have the following AC implemented.

  • Highlight the relevant field to the error (If it is a nested field it would be ok to higlight its parent as an initial version)

The error message is displayed above the "Save changes" button without highlighting the field(s) that trigger the error.

Screen Shot 2024-06-13 at 4.56.18 PM.png (614×2 px, 80 KB)

Additional questions:

  • could the name of the field be displayed in a more user-friendly manner?
  • GEHelpPanelExcludedNamespaces.0 is displayed as a link but it's not clickable.

Thank you for the review!

The current error message doesn't have the following AC implemented.

  • Highlight the relevant field to the error (If it is a nested field it would be ok to higlight its parent as an initial version)

The error message is displayed above the "Save changes" button without highlighting the field(s) that trigger the error.

Screen Shot 2024-06-13 at 4.56.18 PM.png (614×2 px, 80 KB)

Additional questions:

  • GEHelpPanelExcludedNamespaces.0 is displayed as a link but it's not clickable.

This AC is implemented in general, but that particular field needs special handling indeed. I'll move it back to Doing for that.

  • could the name of the field be displayed in a more user-friendly manner?

I think in principle this still waits on T367502: Compute editor labels on the server but the work on that has sufficiently progressed by now, that another look there might also be a good idea.

Michael removed a project: Patch-For-Review.

The remaining work has been split out into the subtasks:

This task can move forward to QA again once those tasks have been resolved.

The technical subtasks for the remaining QA notes and missing features have been implemented, so this is ready to be checked again.

Checked in testwiki wmf.14. An additional task to improve the error message wording filed as a follow-up task: T370239: [wmf.14] CommunityConfiguration/HelpPanel validation error incorrectly asks to enter integer value