Page MenuHomePhabricator

Improve error handling UX of structured data UI
Closed, ResolvedPublic

Description

User story: As a Commons user, when I enter or submit structured data for a file, I want informative help text and error messages to aid me in the process.

We have this: Wikidata items don't really need error handling at the moment since they're entered via autocomplete field, but other data types have text, number, and select inputs that need to be validated.

For example, there are restrictions on latitude and longitude values, and currently the fields are outlined in red if that validation fails, but when a user is editing an existing coordinate location, they're able to click Publish even if validation fails. When this happens, the qualifier is simply removed with no message to the user informing them what happened.

We are also using placeholder text to tell the user of the limits on these fields, which is a bit clunky and has the unfortunate consequence of removing the helpful placeholder text once the user types in a value.

We want this: Help text should always included when needed. When a user inputs an invalid value, they should get immediate and clear feedback, and the Publish button should be disabled. We also need to show the user a message if the API call to Wikibase fails.

Acceptance Criteria:

  • Help text is shown to the user for form fields if necessary
  • When an invalid value is input, the user receives immediate and clear feedback
  • When an invalid value is input, the Publish button becomes disabled. Once the input becomes valid, the Publish button is enabled.
  • When the API call to Wikibase fails on publish, the user is informed about what happened and what they should do (come back later, contact someone, fix an error, etc.)

During development, please test the following:

  • Test this feature while logged in AND logged out
  • Test this feature on at least one mobile browser
  • Test that this feature works on the file page AND the Add Data step on UploadWizard (if applicable, some features only exist on one or the other)

Event Timeline

Eric and I have discussed handling this as part of UI consolidation/improvements, and it'll need some input from @PDrouin-WMF!

Change 537452 had a related patch set uploaded (by Anne Tomasevich; owner: Anne Tomasevich):
[mediawiki/extensions/MachineVision@master] Refactor pager to follow cardstack design

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