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: Always use full screen mode #29489

Merged
merged 4 commits into from
Mar 12, 2021
Merged

Site Editor: Always use full screen mode #29489

merged 4 commits into from
Mar 12, 2021

Conversation

creativecoder
Copy link
Contributor

@creativecoder creativecoder commented Mar 2, 2021

Description

This change addresses #26125 and #29339 by always using full screen mode in the site editor.

  • Removes the option to turn off full screen mode
  • Displays the navigation toggle ("W" menu) for all screen sizes (rather than hiding it on smaller screens)

How has this been tested?

  • Manually tested the site editor with different screen sizes to verify the desired behavior

Screenshots

Screen Shot 2021-03-02 at 16 36 03

Menu closed Menu open
Screen Shot 2021-03-02 at 16 37 45 Screen Shot 2021-03-02 at 16 38 05

Types of changes

Removes a UI setting in the site editor.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate. (n/a)
  • I've updated all React Native files affected by any refactorings/renamings in this PR. (n/a)

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Mar 2, 2021
@github-actions
Copy link

github-actions bot commented Mar 2, 2021

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @creativecoder! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@creativecoder creativecoder added the [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") label Mar 2, 2021
@creativecoder creativecoder self-assigned this Mar 2, 2021
Copy link
Contributor

@Addison-Stavlo Addison-Stavlo left a comment

Choose a reason for hiding this comment

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

These changes look pretty reasonable to me. I wonder if anyone else involved with the Nav Panel might notice something we might have overlooked, but it seems to work well!

Another thought (although potentially as a follow up), is maybe we should be hiding the top-bar that is shown in these smaller screen widths in the site editor:

Screen Shot 2021-03-03 at 1 55 37 PM

With the Nav Panel available, this top bar really doesn't bring much to the user. 🤔

packages/edit-site/src/components/editor/index.js Outdated Show resolved Hide resolved
@creativecoder
Copy link
Contributor Author

Note that I ran into a keyboard focus issue while testing this (not caused by these changes). Opened #29536 for tracking.

@david-szabo97
Copy link
Member

Blocker:
Just noticed in the Menu Closed screenshot that the inserter button is missing. Spun up your PR and found out the inserter button goes behind the W button. I think we need to remove the media query from here:

@include break-medium() {
body.is-fullscreen-mode & {
padding-left: 60px;
transition: padding-left 20ms linear;
transition-delay: 80ms;
@include reduce-motion("transition");
}
}

Non-blocker: (follow-up?)
I wonder if we could somehow force a min-width on the editor to avoid this ugly header and editor content:
image

Or how about making the sidebar full width below 400-500px? 🤔

@jameskoster
Copy link
Contributor

Closing the sidebar upon selection of a menu item feels loads better to me 🎉

maybe we should be hiding the top-bar that is shown in these smaller screen widths in the site editor

I'd agree with that. We hide the admin bar on desktop view, probably makes sense to hide it on mobile as well. +1 to doing that in a follow-up though, in case there is some context missing as to why it is not currently hidden.

@creativecoder
Copy link
Contributor Author

Blocker:
Just noticed in the Menu Closed screenshot that the inserter button is missing.

@david-szabo97 Thanks for catching this! Addressed in 7338f1a by removing the media query, as suggested.

I wonder if we could somehow force a min-width on the editor to avoid this ugly header and editor content
Or how about making the sidebar full width below 400-500px? 🤔

I think that's a good idea. I'd like to push this to a follow-up PR, as it also brings into question some additional concerns... for example if the navigation panel is full screen, the lack of an obvious close button becomes more of an problem.

@david-szabo97
Copy link
Member

Something is going on with the E2E tests... Can you try a rebase? 🙏 Thanks!

I just noticed that the block toolbar overlaps the browsing sidebar on medium screen sizes. Let's fix that in a follow-up.
#29615

@creativecoder
Copy link
Contributor Author

Something is going on with the E2E tests... Can you try a rebase? 🙏 Thanks!

Thanks for pointing that out, @david-szabo97 ! I tried rebasing twice so far today, but some tests are still failing.

All failures are related to the block inserter not being open to insert a block. So far I'm unable to replicate the failure locally, so I'm not sure what's preventing the inserter from opening.

@david-szabo97
Copy link
Member

Ran the E2E tests locally and they are failing. Checked the screenshots as well. What I don't understand is why the browsing sidebar is open? 🤔 After navigateToHeader() it should close.

Closes the navigation panel after selecting content or a template (this is needed for small screens, since the panel takes up most of the screen, but seems like a good change for larger screens, as well)

I think this causes the E2E tests to fail. Can you try reverting this locally and test it? We could also revert it in the PR and do it as a follow-up.

@david-szabo97
Copy link
Member

The inserter button goes behind the W button for a few milliseconds. Puppeteer tries to click on it but it's not visible in the viewport. Instead of clicking the inserter button it clicks on the W button. That's why in the screenshot the browsing sidebar is still open.

Opened a PR that will fix the problem above.
#29762

@david-szabo97
Copy link
Member

I think we can remove all instances of await navigationPanel.close(); after await navigationPanel.clickItemByText calls. Since we are now closing the browsing sidebar automatically.



@creativecoder
Copy link
Contributor Author

@david-szabo97 Thanks so much for helping me figure out what's going on with the e2e tests, and for your fix in #29762!

There's enough complexity going on with the e2e tests here that I'm going with your idea of using a separate PR: I've removed the change that closes the navigation panel after selecting a template and updated this PR description. I'll open a separate PR with that feature + the associated e2e test changes.

Copy link
Member

@vindl vindl left a comment

Choose a reason for hiding this comment

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

This is working nicely for me!

Should we be displaying the default wpadminbar at the top on smaller screens (<782px)? I'm mostly using Customizer here for comparison, which is another editor that forces fullscreen. In that case it's not shown and I'm thinking we should hide it in the case of Site Editor too.

I also noticed that exactly at 782px width we end up in this weird state where admin bar takes up the space but it's not shown:

Screenshot 2021-03-11 at 21 51 18

@creativecoder
Copy link
Contributor Author

Should we be displaying the default wpadminbar at the top on smaller screens (<782px)?

@vindl I think the answer is no, to be consistent with how full screen mode works. (@Addison-Stavlo made the same suggestion in an earlier comment).

I'm tracking that in #29805

@creativecoder
Copy link
Contributor Author

This is now passing CI and should be ready for a formal review.

I've moved the feature to auto-close the sidebar after selection to #29806

Copy link
Contributor

@jameskoster jameskoster left a comment

Choose a reason for hiding this comment

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

Approving from the design side :)

@vindl
Copy link
Member

vindl commented Mar 12, 2021

@vindl I think the answer is no, to be consistent with how full screen mode works. (@Addison-Stavlo made the same suggestion in an earlier comment).
I'm tracking that in #29805

Great, I think it makes sense to address this in a follow-up since it's a separate decision. This is looking good to me now! :shipit:

@vindl vindl merged commit e8613cf into WordPress:trunk Mar 12, 2021
@github-actions github-actions bot added this to the Gutenberg 10.3 milestone Mar 12, 2021
vindl pushed a commit that referenced this pull request Mar 22, 2021
Automatically closes the navigation panel within the site editor
after selecting a template or content item.

Follow-up to #29489: it's particularly helpful on smaller screens,
where you would otherwise be left with the navigation panel taking up
most of the screen after making a selection.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants