-
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
Site Editor > Styles: open styles inspector when clicking preview canvas #66996
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. |
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.
Something I noticed is that when I go into the preview, close the sidebar and go out of the preview and in again, the styles sidebar is closed. Is this the behavior that we want?
Also maybe we should consider this separately, but it seems like ideally, we should be focused on "styles" on this view which means:
Curious what you all think @jasmussen |
Yes, I think we should not immediately add template editing in this view. Note that if you double click the editor in preview mode, it will still give you an option to go to template editing. But I do think a more focussed editor would be beneficial here. |
Size Change: +67 B (0%) Total Size: 1.82 MB
ℹ️ View Unchanged
|
I think that's fine? The point is that initially you're pointed into the right direction |
Something seems wrong for me. The first time I load the page, going from wp-admin -> styles -> preview, it's the "template" sidebar that is open by default |
Motivation seems reasonable. Noting that there's a great deal of questions around removing the global styles button from the edit view, although I'm of the opinion that's eventually where we should be, the consensus so far seems to be keeping it there and slowly iterating on a higher level. |
@youknowriad Ah ok, it does not remount. I'll have to change the approach. |
Yes, for the moment, we're trying to tailor the "styles" view since its a new one to "styles editing", we're not touching the one in the regular editor. |
@youknowriad Fixed all the issues I think. |
if ( path === '/wp_global_styles' && canvas === 'edit' ) { | ||
enableComplementaryArea( 'core', 'edit-site/global-styles' ); | ||
} | ||
}, [ path, enableComplementaryArea, canvas ] ); |
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.
Do you think this effect should move to the "GlobalStylesSidebar" component instead?
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.
We could. This component already seemed away of the path. Btw, maybe we should change it back to the document panel when moving away from '/wp_global_styles'
? I'm not sure.
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.
(not entirely sure)
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.
Right now it will stay open if you go to another editor, such as a page under "Pages".
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.
oh good catch :)
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 we should just reset it to the previous state. I'll do that.
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 moved the effect as you suggested and also restore the previous state now.
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 works for me.
A small thing I like is that the Style Book is now one click away. |
What?
When clicking the preview at this point:
I expect the globals styles panel to open:
Why?
I expect to be pointed in the right direction to continue to edit global styles. This also surfaces the Styles inspector bettor so the users learns where it is located.
How?
Just make it active by default if the route is global styles.
Testing Instructions
See above, Site Editor > Styles > click preview. Observe the inspector.
Testing Instructions for Keyboard
Screenshots or screencast