Skip to content
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: don't hide nav after Gutenberg 12.2 #58830

Merged
merged 3 commits into from
Dec 16, 2021

Conversation

mattwiebe
Copy link
Contributor

@mattwiebe mattwiebe commented Dec 3, 2021

Changes proposed in this Pull Request

  • Unhide the Navigation menu (under the top left W)

Gutenberg 12.2 (ahead of and for WP 5.9) has a new, drastically scaled-back Navigation Sidebar. The < Dashboard link is no longer nested-away-by-default, so we can stop hijacking the (W) menu to go back to the Dashboard directly.

This also prevents the weird state in which you could open the nav sidebar by picking "browse templates" from the top middle template dropdown without being able to close it again. There was probably an issue about that.

Testing instructions

  1. Ensure your test sandboxed site has the gutenberg-edge sticker.
  2. Wait until Add client side routing for Site Editor WordPress/gutenberg#36488 is merged and released (in a RC2?), or build it yourself and extract the built artifact from npm run build:plugin-zip in the gutenberg-core/v12.1.0-rc.1 directory on your sandbox to overwrite it. (If you sync a working repo without building, you won't have the required GUTENBERG_VERSION PHP constant.)
  3. This ETK build is running on your sandbox
  4. Once that patched Gutenberg is running, and the ETK is patched, et voila. The Navigation Sidebar is now working just like Core and the < Dashboard link takes you back to Calypso home.

@mattwiebe mattwiebe added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Goal] Full Site Editing labels Dec 3, 2021
@mattwiebe mattwiebe requested a review from a team December 3, 2021 22:36
@mattwiebe mattwiebe self-assigned this Dec 3, 2021
@github-actions
Copy link

github-actions bot commented Dec 3, 2021

@matticbot
Copy link
Contributor

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

Generated by performance advisor bot at iscalypsofastyet.com.

@mattwiebe mattwiebe force-pushed the update/unhide-site-editor-nav branch 2 times, most recently from 5f26445 to 7bf5ff8 Compare December 3, 2021 22:38
@matticbot
Copy link
Contributor

This PR modifies the release build for editing-toolkit

To test your changes on WordPress.com, run install-plugin.sh editing-toolkit update/unhide-site-editor-nav on your sandbox.

To deploy your changes after merging, see the documentation: PCYsg-mMA-p2

@@ -338,6 +338,10 @@ function load_tags_education() {
* (Core Full Site Editing)
*/
function load_wpcom_site_editor() {
// This is no longer needed after Gutenberg 12.1 due to the Navigation menu no longer being inscrutable.
Copy link
Contributor

@zaguiini zaguiini Dec 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this comment necessary? I feel that people can always refer to the git blame, check the PR and the explanation on why it is not needed anymore. Comments are often misleading, get outdated pretty quickly, and pollute the source code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The point of this code comment is to encourage future maintainers to investigate if this can be removed, should I not get to it. But your point is a fair one, given the number of years-later @todo and @fixme comments strewn about.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about an issue instead of a comment? You could even link it as a comment inside the code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its a handy companion to the version check below. As long as we are conditionally enabling functionality based off a magic gutenberg version number, it seems good to note why for easy reference.

Hopefully it wont get outdated or misleading, as it is accurate to the code beneath it. When that code is updated, then the comment should be as well. Ideally, once we don't support any pre-12.2 Gutenberg version on dotcom anymore we can just remove this entire site editor section of this plugin.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about an issue instead of a comment?

An issue sounds good to me in addition, so we can just get rid of all of this in the near future - #59295

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for creating that issue @Addison-Stavlo ! I intended to do the same but this has been the week of inability to maintain an attention span.

Copy link
Contributor

@zaguiini zaguiini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works perfectly on my end 👍

@@ -338,6 +338,10 @@ function load_tags_education() {
* (Core Full Site Editing)
*/
function load_wpcom_site_editor() {
// This is no longer needed after Gutenberg 12.1 due to the Navigation menu no longer being inscrutable.
if ( defined( 'GUTENBERG_VERSION' ) && version_compare( GUTENBERG_VERSION, '12.1.0', '>=' ) ) {
Copy link
Member

@vindl vindl Dec 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be updated to 12.2.0. I also think that instead of conditional loading we can delete this code and folder after it lands 12.2 lands in production.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup this should all be removed after 12.2.0 hits production. This is simply a mechanism to deploy for edge and production simultaneously.

@mattwiebe mattwiebe changed the title Site Editor: don't hide nav after Gutenberg 12.1 Site Editor: don't hide nav after Gutenberg 12.2 Dec 16, 2021
@mattwiebe mattwiebe merged commit 5a65da2 into trunk Dec 16, 2021
@mattwiebe mattwiebe deleted the update/unhide-site-editor-nav branch December 16, 2021 22:18
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Dec 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants