-
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
Global styles: split styles menus in revisions and everything else #51318
Conversation
@@ -179,3 +179,14 @@ | |||
.edit-site-global-styles-sidebar__panel .block-editor-block-icon svg { | |||
fill: currentColor; | |||
} | |||
|
|||
[class][class].edit-site-global-styles-sidebar__revisions-count-badge { |
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.
Size Change: +151 B (0%) Total Size: 1.4 MB
ℹ️ View Unchanged
|
259b5da
to
dd65058
Compare
64864ec
to
01118a2
Compare
</span> | ||
); | ||
} | ||
function GlobalStylesRevisionsMenu() { |
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.
Maybe we could extract these dropdowns into a new file or files.
Flaky tests detected in 01118a2ff7b51e04a3c0659f8ee100d7cceba20d. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5216973427
|
066c649
to
b5d8ecb
Compare
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.
This looks cool! It's generally working well for me, but I noticed that if I switch my editor settings to show button text labels, then the labels break out of the header area:
Could one solution be to simplify some of the label text? I.e. possibly something like Revisions
and More
(or just Actions
) instead of Styles revisions actions
and Styles actions
? That might need some design feedback on the wording, potentially.
Thanks for testing this out @andrewserong 🙇 I agree we could simplify the labels. I'm just wondering if we'd have to make the context clearer, e.g., adding a role/aria label to the surrounding header container like Here's what it looks like in English with simplified copy: It's better, but it doesn't really solve the stacking 🤔 Another consideration is that other languages might use more characters to translate these strings. I think a decent alternative could be to group menu items:
cc @WordPress/gutenberg-design |
Generally we're leaning towards placing revisions access at the bottom of these panels. For more context see the 'Footer' section in #50379, plus #49597. I wonder if we should try that here too, as suggested in #51203: It would solve the text label issue, and the over-crowded icon buttons in that top-right corner of the browser. Side note, I'm not sure the icons added to the Custom CSS and Welcome Guide menu items are all that helpful. |
I've updated the label copy. Doesn't quite make it...
No worries! Agree.
👍 Removed the icons.
Looks good. Maybe we could iterate? I think @matias's intention was to also group in the reset functionality. The fastest thing I could achieve in the following (because we have an existing slot). 2023-06-15.11.14.36.mp4Otherwise we'd need tool around with the entire sidebar flex settings (?) |
FWIW resetting is still grouped in – you enter Revisions and select the original one then apply. Probably fine to keep the dedicated shortcut in the ellipsis menu too, alongside other actions (add css).
I wasn't aware there was a prescribed design direction for this. If that is the case then you can probably ignore my feedback :) |
Thanks for the feedback again! We could build a reset to theme default in eventually (it doesn't exist yet). I had an earlier commit in the original PR that I kept which does that, so it's in the vault for when we decide to come back 😄 |
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.
Good points in this discussion about the wider issues surrounding the "show button text labels" mode. For now, I think it might be possible to get all the buttons lined up on the one row without too much hacking (in English, at least), if we remove the FlexItem
that's wrapping <GlobalStylesMenuSlot />
in global-styles-sidebar.js
(around line 83). Here's how it looks if the slot is a sibling to the other FlexItem
s:
d1ea5c6
to
dddfe82
Compare
Interesting. Thanks @andrewserong I've updated this branch with those changes. Checked in FF, Chrome and Safari. LGTM |
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.
Thanks for updating! Looks like there's a merge conflict with the changelog file, but otherwise this is testing nicely for me 👍
Each of the buttons are working correctly, if folks are happy with the design direction for this, then this LGTM! ✨
…els" preferences mode
d82512b
to
9426264
Compare
…ordPress#51318) * Switching items in the dropdown in GlobalStylesMenu to MenuItems * Icons and stuff * Simplify aria labels on style actions menus and add role to surrounding header. * Grouping menuitems * Removing icons and shortening the copy for text view * Need to close the menu after some actions * Remove flex item so that the text labels sit more neatly in "text labels" preferences mode * changelog * Update e2e selectors
What?
This PR:
n
” action buttons into separate dropdownsbackup
) to the styles header buttons rowTesting Instructions
Screenshots or screencast
2023-06-15.10.59.06.mp4