-
Notifications
You must be signed in to change notification settings - Fork 4.6k
DataForm: add new details layout #72355
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
|
Size Change: +238 B (+0.01%) Total Size: 2.45 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in ea3a652. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/19108075127
|
66d5367 to
432bbd3
Compare
|
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. |
| ); | ||
| } else { | ||
| // Fall back to the label | ||
| summaryContent = field.label || 'Add more details'; |
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.
If the summaryField is optional, perhaps just "More details" would be a better fallback given that fields can be read-only (nothing to "add").
|
Direction looks good, thanks for working on this @jorgefilipecosta This PR needs a rebase. The main change is that the |
432bbd3 to
ea3a652
Compare
Adds a new
detailslayout type for DataForm that creates collapsible sections using native HTML<details>and<summary>elements.Usage
When a
summaryfield is specified, its rendered value is displayed in the clickable summary (e.g., "Allow comments, Pings enabled"). If not specified, the field's label is used as fallback, if there is no field label we render "Add more details"Changes
DetailsLayoutandNormalizedDetailsLayouttypesFormDetailsFieldcomponent with minimal stylingLayoutDetailsstory to demonstrate usageTesting
View the
LayoutDetailsstory in Storybook under DataViews/DataForm to see the new layout in action with multiple collapsible sections http://localhost:50243/?path=/story/dataviews-dataform--layout-details.