Open maxime-rainville opened 6 months ago
Some very relevant question from @GuySartorelli
There are some UX considerations we need to consider before implementing this, such as:
- Do invalid blocks get expanded automatically?
- Do invalid blocks get highlighted e.g. with a red border?
- How do we display validation errors that apply for a block but aren't for a given field?
- How do we deal with validation errors in a separate tab on of the block (e.g. settings tab on the block)?
- What about validation errors for the ElementalArea field itself? Is that in scope?
- Should those be displayed above (non-standard but means those messages are easier to see and relate to the elemental area) or below (more standard but content authors won't notice them until they scroll past the elemental area)?
- Should we display a summary of all validation errors in some central place? IIRC that's what you're meant to do for accessibility - though that should probably be for the form (or at least the current tab of the form) as a whole, not just for the elemental area?)
- Presumably when saving a block from the ... menu on the block itself, its validation error status will change independently from all other blocks (i.e. other blocks which already had visible validation errors will still have those visible validation errors)
If a block already on the page is in an invalid state, how do we warn you?
This should be treated the same as an invalid value in any field on any form. We shouldn't be treating this differently for elemental than for anything else. i.e. we should only show validation errors after validating, which only happens on form submission.
I had a catch up with Cassie to discuss the UI questions. This are some of the questions that came out.
We have some pre built Toast notification which could be use validation. They have multiple styles. for different context and degree of badness.
As a content author, I want clear indication when one of my content block contains invalid data so I remedy the problem.
Context
Elemental has never had proper inline validation before. We are looking at remediating this: https://github.com/silverstripe/silverstripe-elemental/issues/329
This does open a bunch of related questions:
Acceptance criteria
The status quo
Related