-
Notifications
You must be signed in to change notification settings - Fork 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
New Onboarding: show design previews in landscape #49170
Conversation
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Webpack Runtime (~41 bytes added 📈 [gzipped])
Webpack runtime for loading modules. It is included in the HTML page as an inline script. Is downloaded and parsed every time the app is loaded. App Entrypoints (~165 bytes added 📈 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Sections (~3827 bytes removed 📉 [gzipped])
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Async-loaded Components (~44 bytes removed 📉 [gzipped])
React components that are loaded lazily, when a certain part of UI is displayed for the first time. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
@lsl I love the hover effect. ❤️ On https://hash-445ac0a51ce6c5de81139649cfdfb324bc29023a.calypso.live/new/design?flags=gutenboarding/landscape-preview,gutenboarding/mshot-preview the thumbnails are loading fairly quickly. Emulating slow 3g is what you'd expect for any image-based page IMHO. It also takes care of the vertical weirdness (the giant hand) we always saw in Rockfield. What do you reckon @ollierozdarz @simison ? Would this be acceptable to flick on for the experiment? |
Tidied this commit up a bit:
Landscape previews work with both image types but the speed will be slightly different because of the change in image size between mshot/non-mshot. @ollierozdarz reduced transition time to 1s, feels a lot snappier now, I couldn't get it any faster than that without it stuttering on my machine. vs no mshots: https://hash-445ac0a51ce6c5de81139649cfdfb324bc29023a.calypso.live/new/design?flags=gutenboarding/landscape-preview |
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.
Looks great, nice work here @lsl and @ollierozdarz !
Feel free to enable mshots in production if you feel it works well. We'll then get a bit of stress-test before it goes to more traffic with wider testing, and get a bit of internal testing before we roll non-English test out again.
(Didn't code review, leaving that to others)
One follow-up ask after the merge — let's please ensure screenshots stay fairly big on all screen-sizes. Now you can see how small they become between number of columns: Screen.Recording.2021-01-26.at.13.05.57.480p.movHere are two 3 column versions just before it jumps to 2 columns and previews become bigger again: This is similar to how it's in production so not a blocker for merge. Feels more prominent on landscape versions though? |
Agree 100%, @simison! I think bigger cards, less internal margin, would be the ideal. Even breaking down to the 2-col view earlier as opposed to the 3-col view shrinking tiny then snapping to 2-col. |
- includes tweak for backing off mshots refreshes the longer it takes - includes wip hover preview for landscape (for demo only, needs work)
445ac0a
to
3e72e5f
Compare
Added image sizing to #49097, had a go at this today but couldn't get it to where I was happy with it. Will circle back with more time. |
// Test mshots h value matches the desired image | ||
// The default image (https://s0.wp.com/mshots/v1/default) is around 400x300 px h | ||
// but sometimes slightly off (e.g. h: 299.99) | ||
if ( e.currentTarget.naturalHeight !== options.h ) { |
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 didn't catch this in the last PR, but clever way of detecting the loading image!
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 tests nicely for me across Safari, Edge, Chrome and FF on Mac Desktop, and tested on Safari and Chrome on an iPhone 8. Code change looks good to me — tiniest of tiny nits, I think we're sometimes using mshot singular vs mshots plural, which could trip someone up eventually while trying to change something, but not at all a priority to change in this PR.
Thanks for seeing this through! It's looking really nice.
// Only refresh 10 times | ||
if ( count < MAXTRIES ) { | ||
// Triggers a target.src change and image refresh @ 500ms, 1000ms, 1500ms... | ||
setTimeout( () => setCount( count + 1 ), count * 500 ); |
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 like that this gradually spaces out the polling gap, a nice easing off.
Turns off mshot design previews enabled in #49170, this reverts previews back to calypso hosted screenshots.
Changes proposed in this Pull Request
Testing instructions
Landscape views:

Hover effect:

Relates #49097