Skip to content

Starter Page Templates: Update the selector look and feel - #38065

Merged
Copons merged 7 commits into
masterfrom
update/spt-selector-look-and-feel
Dec 16, 2019
Merged

Copons merged 7 commits into
masterfrom
update/spt-selector-look-and-feel

Conversation

@Copons

@Copons Copons commented Nov 29, 2019 •

Copy link
Copy Markdown
Contributor

Changes proposed in this Pull Request

This is a replacement of #37744.

  • Restructure the SPT selector modal.
  • The modal is now less dependant from the WP sidebar state (expanded, collapsed, hidden).
  • The modal z-index is now below the wp-admin admin bar and sidebar.
  • The template selector and preview are fully now responsive (roughly filling a 30/70 of the screen).
  • The template preview doesn't scale more than if it was rendered in a 960px viewport. This means that: it shrinks down when the preview is <960px wide, and simply remains at the same size (filling the available space responsively) when >960px.
  • The template preview title uses the same scale value of the content.
  • The preview re-renders on window resize and, if in wp-admin, also on sidebar toggle.

Video

https://cloudup.com/cjjFwMPrG2o

Known issues

  • When changing layout (edit page -> click on Change Layout) in Fullscreen Mode, resizing down to a mobile breakpoint hides the modal. This doesn't happen when creating a new page, even in Fullscreen Mode.

Testing instructions

  • Create a new page on an FSE site.
  • Smoke test the SPT selector modal, resize the browser, click around, select different layouts. Expand and collapse the wp-admin sidebar at multiple browser sizes.
  • Back in the page editor, enable the Fullscreen Mode (from the More menu in the top right corner).
  • Create a new page or click on Change Layout in the document sidebar.
  • Smoke test the SPT selector modal again.

@matticbot

Copy link
Copy Markdown
Contributor

@Copons Copons added the Enhancement Changes to an existing feature — removing, adding, or changing parts of it label Nov 29, 2019
@matticbot

Copy link
Copy Markdown
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.

@apeatling

Copy link
Copy Markdown
Contributor

Is this ready for review @Copons ?

@Copons

Copons commented Dec 4, 2019

Copy link
Copy Markdown
Contributor Author

@apeatling almost!
I still need to sort out how the layout title scales. Right now it has a matrix transform, which I think is handled by the Guten preview component, and then it's manipulated by SPT.
It works very unpredictably with the new dynamic width of the preview.

@Copons
Copons requested a review from a team December 11, 2019 16:53
@Copons Copons added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] In Progress labels Dec 11, 2019

@noahtallen noahtallen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  1. There are some tests on the SPT modal (wow, there are some tests!) that need fixed: https://circleci.com/gh/Automattic/wp-calypso/540276?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

  2. Additionally, I was previously able to select a layout on mobile, but this screen does not appear now:

Screen Shot 2019-12-11 at 10 02 46 AM

  1. I'm also struggling to npm i and switch between this branch and master (which seems to be giving me a php fatal error because some file it expects is missing). Maybe could use a rebase?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

😭

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, TIL jQuery events are not compatible with vanilla (the opposite is true though: of course jQuery can listen to vanilla-defined events).
And indeed wp-admin triggers the sidebar event through jQuery, so there's no way around it. ☹️

I think this is a neat enough solution though.
We aren't importing jQuery so we don't bloat the build, and just rely on wp-admin that puts jQuery into global.

@noahtallen

Copy link
Copy Markdown
Contributor

On a more positive note, other than the above, this is testing very nicely to me! It definitely feels better

@Copons
Copons force-pushed the update/spt-selector-look-and-feel branch from 187caba to 698b351 Compare December 11, 2019 18:29
@Copons

Copons commented Dec 11, 2019

Copy link
Copy Markdown
Contributor Author
  1. There are some tests on the SPT modal (wow, there are some tests!) that need fixed: https://circleci.com/gh/Automattic/wp-calypso/540276?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

@noahtallen good catch, I really had no idea! 🤣

  1. Additionally, I was previously able to select a layout on mobile, but this screen does not appear now:

Can't repro this, it works fine here...

  1. I'm also struggling to npm i and switch between this branch and master (which seems to be giving me a php fatal error because some file it expects is missing). Maybe could use a rebase?

Once rebased, indeed I wasn't able to npm i anymore, but npm ci worked, and running npm i after it worked as well (all of this in both master and update/spt-selector-look-and-feel).

@noahtallen

Copy link
Copy Markdown
Contributor

Hmm tried again after the rebase and nuking node_modules

2019-12-11 11 34 58

@Copons

Copons commented Dec 11, 2019

Copy link
Copy Markdown
Contributor Author

@noahtallen 🤔

Admittedly, I don't think I've tried the Change Layout flow straight on mobile.
The selector works fine when loaded mobile in the New Page flow, though.

I wonder if it's related to what I outlined in the known issues in the PR description:

When changing layout (edit page -> click on Change Layout) in Fullscreen Mode, resizing down to a mobile breakpoint hides the modal. This doesn't happen when creating a new page, even in Fullscreen Mode.

I kinda disregarded it as a minor itch (in my tests, the modal disappears on resize to mobile, but then it can be reopened just fine, even in mobile size), but it seems there's something more going on here.

@noahtallen

Copy link
Copy Markdown
Contributor

resizing down to a mobile breakpoint hides the modal

Ahh yeah, I did notice that as well and I think it happened previously too. But I am able to at least open it back up on mobile without this change

@Copons

Copons commented Dec 12, 2019

Copy link
Copy Markdown
Contributor Author

@noahtallen Still can't repro ☹️

Dec-12-2019 12-58-05

This above is the Change Layout flow, loaded from scratch on mobile breakpoint.

@noahtallen

Copy link
Copy Markdown
Contributor

I'm testing on wpcom and didn't test locally -- maybe that's the difference? (Which makes no sense to me)

@Copons

Copons commented Dec 12, 2019

Copy link
Copy Markdown
Contributor Author

I still can't repro in WPCOM (Gutenframe) as well. 😢
Could anybody else double check this, just in case?

Also I'm kinda inclined to ship this anyway, and possibly tackle the mobile issue before the next plugin sync.

@noahtallen

Copy link
Copy Markdown
Contributor

Also I'm kinda inclined to ship this anyway, and possibly tackle the mobile issue before the next plugin sync.

As long as you're comfortable with the change being production-ready, sounds good!

@vindl

vindl commented Dec 13, 2019

Copy link
Copy Markdown
Member

Could anybody else double check this, just in case?

I've tested this both locally and on Dotcom sandbox and it worked fine for me. 🤔

@Copons
Copons merged commit 4a6c335 into master Dec 16, 2019
@Copons
Copons deleted the update/spt-selector-look-and-feel branch December 16, 2019 11:30
@matticbot matticbot 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, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Goal] Full Site Editing [Team] Cylon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants