-
Notifications
You must be signed in to change notification settings - Fork 4.7k
DataViews: Add card form layout validation #74547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Flaky tests detected in 4c2556c. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/21350774613
|
|
Looks good. What do you think @poligilad-auto? Do we need the badge on non-collapsible cards too? I can go either way on that. Separately I'm curious what it would it take for us to be able to use the new |
DataViews already embeds the base design token variables (some concern about this approach, but not a blocker for consideration here). There's still likely a need to incorporate I too would be very interested in using |
|
I will try to use @wordpress/ui here, here and share if there is any issue |
1916f4f to
ea656f5
Compare
|
The change to use @wordpress/ui is done, it was straightforward: Can be tested at http://localhost:50240/?path=/story/dataviews-dataform--validation&args=layout:card. |
If the relevant error is already visible in the field, I don't think the badge is required on non-collapsible cards. |
faf5143 to
5c59f1e
Compare
Hi @poligilad-auto, @jameskoster thank you for reviewing this PR. I removed. the badge from the non colapsible panel. |
packages/dataviews/src/components/dataform-layouts/card/index.tsx
Outdated
Show resolved
Hide resolved
packages/dataviews/src/components/dataform-layouts/card/index.tsx
Outdated
Show resolved
Hide resolved
packages/dataviews/src/components/dataform-layouts/card/index.tsx
Outdated
Show resolved
Hide resolved
|
Note this interaction:
Can we perhaps leverage this technique to trigger the error in those scenarios? Screen.Recording.2026-01-16.at.14.18.23.mov |
|
Note this interaction: the bagde is visible immediately after having collapsed the card first. It results on sometimes the badge appearing immediately (if you had collapsed the card before) and sometimes appearing after collapsing. I suppose it's not a big deal, but I wonder: in collapsible cards, can we just display the badge every time there's an error? cc @jameskoster @poligilad-auto We could get rid of the touch-related code. Screen.Recording.2026-01-16.at.14.22.44.mov |
9aa6561 to
91f808f
Compare
We already display the badge when the card is open, but only if the card has been collapsed before. For example, this doesn't display the badge immediately: Screen.Recording.2026-01-19.at.12.55.52.movBut this does: Screen.Recording.2026-01-19.at.12.56.11.movI was thinking that we should display the badge always, regardless of whether the card had been collapsed before or not. |
eefdbea to
35b24db
Compare
Co-authored-by: André <[email protected]>
758bd8e to
e392a73
Compare
ntsekouras
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is good to land, thanks! Not sure if you want to wait for @oandregal to have another pass about the interactions, but I tested all the previous ones mentioned and seem to work nicely.
Thank you for the review @ntsekouras, and @oandregal, I will go for the merge, but I'm happy to iterate if we find anything needing improvements. I will also look at some issues in the input controls programmatic validation triggering separately. |
|
Great work here, Jorge. The idea of reporting validity in the controls upon opening the card can be implemented in the panel as well. I've updated the tasks at #72321 |


Summary
Part of: #72321
Adds validation support to the card form layout, similar to #73700 (panel layout validation).
Screenshot
Test plan
layout: "card"