Repository navigation
DataForm: Remove the minimum row height from the regular layout, so rows size to their content. - #82052
DataForm: Remove the minimum row height from the regular layout, so rows size to their content.#82052ntsekouras wants to merge 3 commits into
regular layout, so rows size to their content.#82052Conversation
|
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. |
|
Nice fix. I'm curious why the rule was there in the first place 🤔 |
|
Size Change: -27 B (0%) Total Size: 7.92 MB 📦 View Changed
|
|
I took a look at git history and this seems to come from this PR #66531 (~2 years ago). We didn't have read-only fields then, and perhaps we also didn't have all the controls we have today. It's possible that this rule is no longer useful. There's been multiple iterations that changed the original value to tokens as well. However, there's also a chance that it is useful but in the wrong place. We have now layouts to compose how fields are positioned (e.g., row layout). That stands out as a case that may be potentially affected? Worth checking:
With this kind of change, as long as design is happy, I'm happy :) |
|
Looks good to me. Presumably we can add it back if there's a case we didn't account for! |
… rows size to their content.
2944b91 to
f1aee1f
Compare
|
@jasmussen for the record, @oandregal's comment about dataform-row-alignments-side-by-side.mp4Noting that only controls shorter than the old 32px min-height (checkbox/toggle) move at all, everything else in the video is pixel-identical Before the It can be a bit misleading in the video about what is the default, but intentionally in the story we set different defaults in the rows, in order to see the different alignments directly without changing through the storybook control. Picking any explicit value then forces every row to that value. So, if we're fine with this, I'd appreciate a ✅ . 😄 |
|
Indeed, the main change here is how the "has discount" checkbox dangles. Which is a head-scratcher. It seems like we can either:
Is that fair/exhaustive? One consideration: the checkbox does have a 32px footprint, through its 24px default height and then 4px margin above and below—so it's the margin collapse that makes it become 24px in the latter case. This is important for the checkbox when it's used as one of several in a list. Also worth noting, those inputcontrols may be 40px tall right? Should the checkbox in the example story be wrapped in a BaseControl, and would that fix the issue, and option 2? |

What?
Noticed while reviewing: #81987 (review)
The
regularlayout applies a 32pxmin-heightto every field row. For readonly fields without a visible label and some controls likecheckbox and togglethis results in an extra vertical gap.This PR removes the min-height, so rows size to their content. I couldn't find a reason for this being intentionally set and I think it's safe to remove. Alternatively we could target only the readonly fields.
Side label rows are not affected, since the label and control columns have their own min-heights.
Screenshots
Check the readonly fields (File size, Dimensions) and toggle/checkbox fields (Allow people to leave a comment, Sticky).
Testing Instructions
LayoutRegularstory in Storybook (npm run storybook:dev) -?path=/story/dataviews-dataform--layout-regular.labelPositioncontrol tononeand check that the readonly fields (File size, Dimensions) and toggle/checkbox fields (Allow people to leave a comment, Sticky) don't reserve extra vertical space.