-
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
Style Revisions: Remove style revisions dropdown menu #56454
Conversation
Size Change: +1.56 kB (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
…o that toggle status works correctly when viewing any other sections of global styles.
Looks like I need to update the e2e tests, will sort that out. |
Nice one!
With whatever label replaced this one looks like 🤔 |
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.
I think the UI changes work nicely! Reset works as expected, and the revisions icon is selected when the panel is open only.
I left some comments about displaying the revisions count...
packages/edit-site/src/components/global-styles/screen-revisions/index.js
Outdated
Show resolved
Hide resolved
packages/edit-site/src/components/global-styles/screen-revisions/index.js
Outdated
Show resolved
Hide resolved
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.
Nice PR! I ran into an issue with the style book closing unexpectedly when navigating up between blocks within global styles (left a comment). If that's a little separate from the style revisions dropdown changes, we could always open a separate PR to look at changes to that behaviour?
I much prefer the revisions button as a toggle, rather than the dropdown, it feels nice to use to me 👍
In terms of folks still being able to find where to reset styles, now that it's a toggle, I wonder if we need a more prominent button within the revisions panel to reset styles? Since folks can click and choose between individual revisions from this panel, along with using an Apply button to make changes, I think it might make sense for resetting styles to be a bit more prominent in this particular UI, rather than having to go to the ellipsis menu, where it's harder to find.
Not necessarily a blocker, though, we could always look at where a reset button might fit in this UI in follow-ups, too 🙂
I was following what @richtabor had mentioned in the issue for this. I do think it would be good to have a clearer option on the action screen. We can follow up with that in a new PR. 👍 |
I've made all the fixes here, thanks for the reviews! Ready for another look. |
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.
Nice follow-ups, this is testing well for me now @apeatling!
✅ Navigating up and down the hierarchy with the Style Book open works as before
✅ Closing and toggling the revisions panel is working as expected
✅ Resetting styles works as expected
Just left a couple of further nits, but nothing major. Just wondering if it'd be good to name the onClick
prop in ScreenHeader
onBack
instead so that it's clear it's a click handler for the back button, and if we should change the order of when isRevisionsOpened
. But other than that, LGTM! ✨
_revisionsCount++; | ||
// one for any dirty changes (unsaved). | ||
if ( isDirty ) { | ||
_revisionsCount++; |
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.
Works well for me.
Now I've looked at this again with fresh eyes, the revisionsCount
logic might have a better home in the useGlobalStylesRevisions
hook since there are a few selectors already in there.
Probably for a follow up - not blocking this PR though.
* Remove dropdown menu * Make sure setEditorCanvasContainerView() calls are made when needed so that toggle status works correctly when viewing any other sections of global styles. * Pre select the revisions count to prevent flashes of incorrect revision counts. Hat tip @ramonjd. * Remove CSS no longer needed. * Modify e2e test to reflect removal of menu item. * Fix issue with style book closing when browsing blocks. * Replace onClick with onBack to reduce confusion with screen header click action. * Change ordering of `isRevisionsOpened` const.
…ns list so we don't need to click it.
What?
Fixes #55779
This PR does three things:
As part of the changes I've also cleaned up the setting and unsetting of
setEditorCanvasContainerView
so that it's consistent throughout all of the screens in global styles. Previously values were not getting set correctly with the header back chevron button, or when looking at the additional css view.Why?
The dropdown is unusual and not needed. By switching to the toggle we can match other buttons in the editor, and the way the style book button next to it works.
How?
Remove
DropdownMenu
usage and replace withButton
. Also adjustsetEditorCanvasContainerView
usage as mentioned above.Testing Instructions
Screenshots or screencast
Before
Screen.Recording.2023-11-23.at.12.13.03.PM.mov
After
Screen.Recording.2023-11-23.at.12.11.09.PM.mov