-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Update field display in grid layout #60083
Conversation
Size Change: +1.48 kB (0%) Total Size: 1.72 MB
ℹ️ View Unchanged
|
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. |
packages/edit-site/src/components/page-templates-template-parts/index.js
Outdated
Show resolved
Hide resolved
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.
This LGTM, thanks!
Co-authored-by: jameskoster <jameskoster@git.wordpress.org> Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org> Co-authored-by: jasmussen <joen@git.wordpress.org>
Co-authored-by: jameskoster <jameskoster@git.wordpress.org> Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org> Co-authored-by: jasmussen <joen@git.wordpress.org>
What?
This PR attempts to update the display of fields in data views Grid layout, including an option for consumers to specify the orientation of appearance; column or row.
Why?
Currently only the field values are visible. A tooltip reveals the field name on hover, but this isn't the most accessible approach. Additionally, this pattern means you cannot always tell which field a value refers to at a glance. For instance a timestamp could be interpreted several ways.
By arranging the field name and value in a row we can display the necessary information without consuming additional space. An option to arrange in a column means fields with much longer values (e.g. template description) can be displayed in a readable manner.
This change also moves us closer to the arrangement of data we find in the 'Details panel' and latest Inspector designs.
In the graphic below see before/after examples for templates, pages, and patterns.
How?
In
packages/dataviews/src/view-grid.js
the theFlex
component that displays the field will switch betweenrow
(default) andcolumn
arrangements based on whether the the consumer configures agridDisplayDirection
property on the field.To ensure rows take up minimal space the value will truncate accordingly. Consumers can use the
column
orientation when more space is required.Testing Instructions
Notes
As a follow-up it might be nice to allow consumers to say that certain field name are omitted from display. This can be useful when the name can be inferred from the value, e.g. the template description.