Skip to content
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

PaletteEdit: Add appropriate size props to Buttons #66590

Merged
merged 4 commits into from
Oct 30, 2024
Merged

Conversation

mirka
Copy link
Member

@mirka mirka commented Oct 30, 2024

In preparation for #65751

What?

Adds appropriate size props to the remaining Buttons in PaletteEdit.

Testing Instructions

See the PaletteEdit story in Storybook.

@mirka mirka added [Type] Enhancement A suggestion for improvement. [Package] Components /packages/components labels Oct 30, 2024
@mirka mirka self-assigned this Oct 30, 2024
@@ -215,6 +215,7 @@ function Option< T extends PaletteElement >( {
<Item ref={ setPopoverAnchor } size="small">
<HStack justify="flex-start">
<Button
size="small"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't tell if there's any intentionality to the height of these rows. @WordPress/gutenberg-design Is the natural height resulting from this fix acceptable, or do we want to maintain a certain row height?

Before After
PaletteEdit in edit mode, before PaletteEdit in edit mode, after

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This predates my involvement so I can't comment with confidence on the intentionality. Aiming for 40px rows seems acceptable to me though.

This whole UI likely needs to be revisited and standardised at some point.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, let's leave it like this for now until we have time to revisit.

Comment on lines +541 to +542
__next40pxDefaultSize
className="components-palette-edit__menu-button"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last menu item is visible when the canReset prop is enabled. It was also missing a CSS class that set the width to 100%.

Before After
PaletteEdit dropdown, before PaletteEdit dropdown, after

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Classname addition makes sense to resolve this.

I just wonder if these buttons make sense to be menu items instead of buttons?

Not something to block the PR of course.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, it looks like this could be a DropdownMenu.

@ciampo Should we add any new dropdown instances using DropdownMenuV2, or should we still use v1 until it's a bit more stable?

@mirka mirka marked this pull request as ready for review October 30, 2024 11:27
@mirka mirka requested a review from ajitbohra as a code owner October 30, 2024 11:27
@mirka mirka requested review from a team October 30, 2024 11:27
Copy link

github-actions bot commented Oct 30, 2024

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: mirka <[email protected]>
Co-authored-by: jameskoster <[email protected]>
Co-authored-by: tyxla <[email protected]>

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

Copy link
Member

@tyxla tyxla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, given that we agree on the palette edit item size 👍

Comment on lines +541 to +542
__next40pxDefaultSize
className="components-palette-edit__menu-button"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Classname addition makes sense to resolve this.

I just wonder if these buttons make sense to be menu items instead of buttons?

Not something to block the PR of course.

@mirka mirka enabled auto-merge (squash) October 30, 2024 15:16
Copy link

github-actions bot commented Oct 30, 2024

Flaky tests detected in 0661a62.
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/11596713065
📝 Reported issues:

@mirka mirka merged commit 422987b into trunk Oct 30, 2024
63 checks passed
@mirka mirka deleted the palette-edit-button branch October 30, 2024 16:17
@github-actions github-actions bot added this to the Gutenberg 19.7 milestone Oct 30, 2024
karthick-murugan pushed a commit to karthick-murugan/gutenberg that referenced this pull request Nov 13, 2024
* PaletteEdit: Add appropriate size props to Buttons

* Add changelog

Co-authored-by: mirka <[email protected]>
Co-authored-by: jameskoster <[email protected]>
Co-authored-by: tyxla <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants