Update field display in grid layout#60083
Merged
jameskoster merged 3 commits intotrunkfrom Mar 27, 2024
Merged
Conversation
|
Size Change: +1.48 kB (0%) Total Size: 1.72 MB
ℹ️ View Unchanged
|
Contributor
Contributor
Author
|
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. |
jasmussen
approved these changes
Mar 22, 2024
ntsekouras
reviewed
Mar 25, 2024
packages/edit-site/src/components/page-templates-template-parts/index.js
Outdated
Show resolved
Hide resolved
carstingaxion
pushed a commit
to carstingaxion/gutenberg
that referenced
this pull request
Mar 27, 2024
Co-authored-by: jameskoster <jameskoster@git.wordpress.org> Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org> Co-authored-by: jasmussen <joen@git.wordpress.org>
cbravobernal
pushed a commit
to garridinsi/gutenberg
that referenced
this pull request
Apr 9, 2024
Co-authored-by: jameskoster <jameskoster@git.wordpress.org> Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org> Co-authored-by: jasmussen <joen@git.wordpress.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.





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.jsthe theFlexcomponent that displays the field will switch betweenrow(default) andcolumnarrangements based on whether the the consumer configures agridDisplayDirectionproperty on the field.To ensure rows take up minimal space the value will truncate accordingly. Consumers can use the
columnorientation 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.