-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Fix DataViews primary actions horizontal layout consistency #71274
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
Conversation
|
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. |
mcsf
left a comment
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.
Tests well, makes sense. Thanks for this.
I believe this was on purpose, otherwise it looks like there's nothing to interact with when there's only primary actions (see "after" screenshot). Before shipping, I'd welcome @jameskoster thoughts on this. Do we make the primary actions always visible when there are no secondary ones? or do we only display them on hover/select? |
That's a good point; note that the primary reason for this PR is preventing the vertical stacking, so it would make sense to show them without the need to hover. |
Feel free to 🚢 when you're ready if the actions visibility works as in trunk. That change is a separate concern. I just wanted to double-check with design about that to avoid going back/forth every few months on this topic. |
|
Flaky tests detected in 5b7b9ff. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/17102335240
|
|
I missed the coauthoring, I owe you one 🤦 🙇 |
…s#71274) * Fix DataViews actions horizontal layout consistency * Update changelog with this fix
|
@oandregal good question. I think it's okay for now, and loosely similar to wp-admin (where actions only appear on hover/focus). But as DataViews are consumed more broadly across the new admin design we may need to revisit actions appearance and behaviors. |
What?
Always add the
HStackwrapper to dataviews actions.Why?
Right now, the horizontal wrapper is not added when there are only primary actions, which results in actions:
How?
Adding the
HStackunconditionally, and conditionally adding the dropdown menu.Testing Instructions
/packages/edit-site/src/components/post-list/index.jsto only show primary actions withconst actions = useMemo(() => [ editAction, ...postTypeActions ].filter( action => action.isPrimary )...);Screenshots or screencast