Conversation
| id: string; | ||
| label?: string; | ||
| description?: string; | ||
| description?: string | ReactElement; |
There was a problem hiding this comment.
@oandregal thoughts about this? Do you think we should restrict to string type?
I did that to get the textarea control for free, but we have the alternative of using a custom edit function.
There was a problem hiding this comment.
I'm not sure I follow the connection with the Edit function. Isn't this change required to just display links in the description (see)?
There was a problem hiding this comment.
Yes. We might want to be strict about providing only string type in description.
There was a problem hiding this comment.
There's two things here:
- The Field API description. It's okay for this to accept ReactElements, and I saw some custom controls that were created to support that.
- The Form API description. We need to keep this serializable, so it can only contain strings.
For the excerpt field, do we need to update the form api as well?
There was a problem hiding this comment.
You're right. I'll remove from Form API. I have to say though that I thought the description would pass down to FormField description through normalization, but it seems that description has a different purpose and is probably used only here?
Do you think we need to update the docs to bring more clarity?
There was a problem hiding this comment.
Probably the confusion here stems from the difference from a field and a form field (which is essentially a way to combine fields and/or provide layout options). From DataForm POV, a field renders the control (and its description), and a form field renders the children and can have a description for "the group". Does that help?
|
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. |
|
Size Change: +190 B (0%) Total Size: 7.69 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 64af3a6. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/23637637210
|
| // There are special cases where we want to label the excerpt as a description. | ||
| // So for now skip registering the excerpt field for some post types. | ||
| ! DESIGN_POST_TYPES.includes( postTypeConfig.slug ) && | ||
| postTypeConfig.supports?.excerpt && | ||
| excerptField, |
There was a problem hiding this comment.
Can you clarify this comment (or remove it altogether)? With the logic here we won't display the excerpt field unless:
- the post type supports it
- any post type that is not template, parts, patterns, or navigation
The comment is confusing and mentions something about exceprt as description that is unrelated I believe?
There was a problem hiding this comment.
I removed it for now since the experiment is contained to post/page. There are nuances with the excerpt field because for example in patterns we want a different label (Description) even though we use the excerpt field.
In general we need to look into this again when opening the experiment to all post types and check if we'd need different fields for the sub-cases or update this one.
996b343 to
a63af95
Compare
a63af95 to
64af3a6
Compare
|
I merged this as is but will follow up with and design updates needed. |

What?
Resolves: #76238
Which is part of: #76076
Notes
panellayout overrides the color on hover of the field's view component. In this caseTexthas its own styles and the DataForm style is not applied onhover. This seems like an issue we should discuss for DataForm in generalpanellayout forexcerptwithout a label and updating the value of the field to a placeholder like text (likeAdd an excerpt) is closer to what we have in trunk without the experiment but the problem is there is no clear indication that this field is an excerpt. In trunk we show anedit excerptbutton below which is clear. This needs input from @WordPress/gutenberg-designTesting Instructions
excerptScreenshots or screencast