-
Notifications
You must be signed in to change notification settings - Fork 813
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
Gutenberg: Use Fullscreen mode in Calypsoify #10368
Conversation
#adminmenumain, | ||
#wp-admin-bar-menu-toggle { | ||
/* Hides the menu items for switching the view mode */ | ||
.edit-post-more-menu__content .components-menu-group:first-child { |
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 PR is more oriented at making Calypsoified Gutenberg
and Gutenberg in Calypso
as identical as possible, but in this particular case, I'd say let's keep the group visible even if it's not there in Calypso, and only hide the "Fullscreen Mode" item.
Also, notice that now it's the last child, but that could change.
Off the top of my head there is no simple selector there, but I might be very wrong. 🙂
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 that! I've just committed a change handling this 🙂
I thought this view mode selector was like a radio button (you can only select one of them), but I realize that you can activate all of them at the same time, so it makes sense to only hide the "Fullscreen Mode" option.
Regarding the CSS selector using :last-child
. I don't like it either, but the HTML rendered by Gutenberg doesn't provide any other class we can use for identifying this element:
Let me add a bit of history behind this PR. When I wrote the code for Calypsoify Gutenberg, there was no fullscreen mode yet (or maybe there was but I didn't notice it), and the whole idea was to make Gutenberg look as much as possible as Calypso. Meanwhile, Calypso-side, it had been decided that Gutenberg would have kept its style for now. When we learned that Gutenberg had a new fullscreen mode with a nice "Back" icon, we went to replace the Calypsoified Gutenberg's "Close" button with that icon. All the overrides needed to hide the masterbar, the sidebar, etc. were there, a mere Redux action away. So this PR simply dispatches that action, and removes (most) of the overrides as they are not needed anymore. cc @Automattic/lannister this also means that by dispatching that action in Calypso, we might be able to drop a lot of CSS there as well. |
Thank you for the great PR description! When this PR is ready for review, please apply the Scheduled Jetpack release: November 6, 2018. Generated by 🚫 dangerJS |
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 LGTM!
We should be well in time for the 6.7 release! ✨
c'ing @georgestephanis for a review on this since he's currently working on other Calypsoify improvements in #10371 |
Oh very cool! |
…issing components. Also, Jetpack renamed to Jetpack_Gutenberg when checking if Gutenberg is enabled.
Removed menu options for switching the view mode.
Fixing some linting issues
6ebbc47
to
1887082
Compare
Sorry folks, this accidentally breaks the Revisions view. I'll push a hotfix in a bit, but meanwhile do not merge please! 🙇 |
Again, sorry about this. 7360cde restore the CSS overrides of the Revisions page, and guard against undefined Testing instructions:
|
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 catch! 👍
I feel so bad, but I've had to sneak in one last change. 😭 ae88b29 adds back the CSS needed to hide the "Manage Reusable Blocks" links from the editor. Testing instructions:
|
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 seems to work for me. Merging.
Changes proposed in this Pull Request:
Calypsoify uses now the Gutenberg Fullscreen Mode instead of injecting the close button and including custom CSS.
We realized that the Gutenberg Fullscreen Mode is providing a UI very similar to Calypso, so by using it we can simplify the code and make it more maintainable.
This PR also includes a small fix for an 500 error raised when Jetpack is checking if Gutenberg is enabled.Fixed on #10389.Fixes Automattic/wp-calypso#27937
Testing instructions:
&calypsoify=1
to the URL and reload the post editor.Screenshots:
Before

After

Proposed changelog entry for your changes:
I don't think this is needed given Calypsoify is mainly used internally. Anyway, if needed, this is my proposed changelog: