Skip to content

Conversation

@andrewserong
Copy link
Contributor

@andrewserong andrewserong commented Sep 11, 2025

What?

Follows #71574

This PR proposes to remove the wrapping divs on the DataForm regular layout for readonly fields, and use a BaseControl.VisualLabel for wrapping just the label field.

Why?

All other DataForms controls in the top position regular layout now defer to the Edit component to handle the display of the label. In most cases this will be (or will be consistent with) the base control visual label.

In short: this PR provides better default visual consistency between fields. It's a little clearer when we look at the storybook examples / screenshots below.

How?

  • Remove the wrapping divs that used classnames that were more applicable to the side labelPosition
  • Add a visual label for the read only fields

Testing Instructions

Before (look at the file size and dimensions fields)

image

After (look at the file size and dimensions fields)

image

Side label position (should be unaffected by this PR)

image

@andrewserong andrewserong self-assigned this Sep 11, 2025
@andrewserong andrewserong added [Type] Bug An existing feature does not function as intended [Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond labels Sep 11, 2025
@andrewserong andrewserong marked this pull request as ready for review September 11, 2025 05:11
@github-actions
Copy link

github-actions bot commented Sep 11, 2025

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: andrewserong <andrewserong@git.wordpress.org>
Co-authored-by: oandregal <oandregal@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions
Copy link

Flaky tests detected in ae9d80d.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/17634659783
📝 Reported issues:

@oandregal
Copy link
Member

As for the side label's style (both in regular and panel layouts), I'll leave @jameskoster comment: continue as it is (no style applied, render the field.label as the consumer wrote it) vs using the label component (will render as uppercase).

@oandregal oandregal merged commit bc8fd77 into trunk Sep 11, 2025
74 checks passed
@oandregal oandregal deleted the update/dataviews-regular-layout-readonly-fields-remove-wrappers-on-top-position-and-use-label branch September 11, 2025 07:49
@github-actions github-actions bot added this to the Gutenberg 21.7 milestone Sep 11, 2025
adamsilverstein pushed a commit to adamsilverstein/gutenberg that referenced this pull request Sep 11, 2025
…ields when in top labelPosition (WordPress#71597)

Co-authored-by: andrewserong <andrewserong@git.wordpress.org>
Co-authored-by: oandregal <oandregal@git.wordpress.org>
@andrewserong
Copy link
Contributor Author

continue as it is (no style applied, render the field.label as the consumer wrote it) vs using the label component (will render as uppercase).

Thanks for confirming! 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants