Page MenuHomePhabricator

Show an example of a correct value in regex constraint violation messages
Closed, DeclinedPublicFeature

Description

Feature summary (what you would like to be able to do and where):

Format constraint violation messages should show an example of a correct value.

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):

Regex Format constraints currently show only the regex.

image.png (407×1 px, 78 KB)

Because regexes can be hard to interpret, it would be helpful to users like this one to show an example of the correct value so that they know how they can fix the value the inputted.

Benefits (why should this be implemented?):

Users can more-easily correct their constraint violations

Event Timeline

Regex Format constraints currently show only the regex.

Not true – they also show the syntax clarification, as can be seen in the screenshot (the “UUID format string, see [[Q195284]]” part). I don’t think there’s any technical reason this can’t include an example if there’s community consensus that it’s helpful. (Personally, I certainly don’t think the non-working [[Q195284]] link is very helpful, tbh.)

Arian_Bozorg subscribed.

Hi @Lectrician1

As Lucas outlined, we won't be moving forward with this ticket.

How is this even hard @Arian_Bozorg? You just borrow an example from "Wikidata property example" that matches the format constraint and display it in the constraint message.

The syntax clarification message isn't always helpful and requires people translating it into different languages whereas an example requires no translation at all.