-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Try toggle instead of dropdown to show stylebook. #67810
Conversation
Size Change: -20 B (0%) Total Size: 1.83 MB
ℹ️ View Unchanged
|
Flaky tests detected in 13cd621. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12269301402
|
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.
LGTM and works well in my testing.
Makes sense to minimize the code and effort for the user (1 vs 2 clicks).
I'll lean on @jameskoster a bit for final review, as he was involved in the initial effort
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. |
The toggle control makes it feel like a setting, which doesn't quite capture the nature of this feature. I agree that reusing the existing toggle is probably the best approach, given it's familiarity. We can revisit the icon separately if needs be. |
I was going off Joen's comment above:
I think that icon looks weird and I never understood why it stands for the style book, but I have a bad relationship with icons in general 😅 Perhaps we can make it an icon by default and make sure it becomes a a text label if button text labels are enabled. |
Ok I've updated the PR with this! |
Oh sorry, perhaps there's a crossed wire here :D I agree the icon isn't the best, and could be revisited. But I also think there's value in maintaining consistency between this styles panel and the one found in the editor. In other words; if we want a text button here, why not in the editor too? That said if y'all prefer a text button I'm happy to defer, and apologies for the detour. |
I think it's worth reaching consistency here first, supporting Jay's point, and then revisit the icon and behavior. |
We can further discuss the button in #67980. |
I don't know what the stakes are here, but is it worth pausing this PR until we've reached a point of consistency in #67980? Just my opinion: Pros of what's presently in trunk:
Cons:
On the general topic of alignment with the editor, there are efforts to bring revisions to the top-level:
The second PR, I think, proposes to relocate the revisions icon and make a text button in the styles panel in the editor. That will change the available realestate in the header as well. |
the latest update in this PR makes the button consistent with the editor one. They are icons by default, and switch to text when the text labels preference is enabled. Given this provides a UX improvement as it is, I believe we should merge it and then discuss iterating on the icon as a follow-up. |
* Try toggle instead of dropdown to show stylebook. * Use button instead of actual toggle * Make button icon except if text labels are enabled
* Try toggle instead of dropdown to show stylebook. * Use button instead of actual toggle * Make button icon except if text labels are enabled
What?
Tiny PR to test replacing the dropdown that allows switching to the stylebook in the styles screen with a simple toggle, because a dropdown feels like overkill when there are only two options 😅
To test, activate a block theme and go to the Styles section in the site editor.
Screenshots or screencast