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

Dashboard: Replace Template Stories with Images #8373

Closed
BrittanyIRL opened this issue Jul 19, 2021 · 13 comments
Closed

Dashboard: Replace Template Stories with Images #8373

BrittanyIRL opened this issue Jul 19, 2021 · 13 comments
Labels
Group: Dashboard Group: Templates P2 Should do soon Status: Needs More Info Follow-up required in order to be actionable. Type: Performance Performance related issues and enhancements.

Comments

@BrittanyIRL
Copy link
Contributor

TBD on how we do this.

Based on the conversation here: https://github.com/google/web-stories-wp/pull/8274/files#r670841347

Templates in the dashboard are actual stories that are loading. we recently updated the my stories view to use the poster image of a story (#8274). Templates currently don't have poster image to use for this.

This ticket is to work through how we want to create image assets for templates and then implement that for existing templates and update the template creation process so that future templates have this built in.

Other questions:

  • are we ok leaving template details views as is so that animations can play?
@BrittanyIRL BrittanyIRL added Group: Dashboard P2 Should do soon Pod: Pea Status: Needs More Info Follow-up required in order to be actionable. Type: Performance Performance related issues and enhancements. labels Jul 19, 2021
@swissspidy
Copy link
Collaborator

The discussion at https://github.com/google/web-stories-wp/pull/8274/files#r670841347 mentioned that the template preview images should be like poster images, without author, title, etc. in it.

But is that correct? IMO the preview should be === the cover page, ≠ the poster image. So it should include all those elements. (cc @choumx)

That would make creation of these preview images much easier as it basically just means taking a screenshot.

I am not sure we can just grab the images from Figma though as the aspect ratio might be different.

But perhaps there's another easy way to generate these?

I'll talk to the templates team to hear their thoughts.

are we ok leaving template details views as is so that animations can play?

I think it would be OK to keep this part as-is for now

One disadvantage of the animated previews is that they are not super accurate. Text is usually displayed way bigger. (Can we fix that?)

If the animated previews don't provide much value, we could consider getting rid of them and only displaying static images.

Alternative 1:

We could look into showing preview images and loading the animated previews with a small delay. So that when I am only quickly browsing through templates it's much faster.

Alternative 2:

Use small videos for the previews instead.


Note: Also worth thinking about doing the same for page templates in the editor. #7985 is related.

@BrittanyIRL
Copy link
Contributor Author

Thanks, Pascal. I didn't mean to spread confusion by using the word poster image here 😅 - just that we would need some sort of likeminded substitute for templates since they do not have a poster image nor shall they. The aspect ratio in figma isn't 3:4 so we can't just pull a screenshot.

I know Marcin did some exploration to generate PNGs (re text sets that could also be used here probably) (#8117) but I'm wondering if we need a substitute in the meantime or just let it be.

If we do want to just let it be for now, perhaps we just load the first page of the story and remove the hover/focus so it never "plays".

Aesthetically, it's a little weird to me to have the my stories grid and templates be different ratios and I'd like to bring consistency sooner rather than later.

Re detail view, I would be curious if anyone would miss the animations not playing. I'll wait for Will to chime in here but my 2 cents are that since the display is inaccurate we should either cut it or fix it. That page has been super neglected for a while, so it'd be nice to give it some polish either way.

@swissspidy
Copy link
Collaborator

Yeah #8117 is basically what led to #7985.

Having some automation/generation would be nice eventually, but since the templates don't really change ever we could definitely create those 3:4 images (semi-)manually for now.

@BrittanyIRL
Copy link
Contributor Author

Having some automation/generation would be nice eventually, but since the templates don't really change ever we could definitely create those 3:4 images (semi-)manually for now.

I think this would be good to knock out. I'm drawing a blank trying to figure out the best way to get the proper aspect ratio on these images.

@swissspidy
Copy link
Collaborator

Chatted with @divyarajmasani and we were wondering whether we could open the templates as proper stories in the browser and then take screenshots with Puppeteer.

Something like this:

  1. Open WordPress in browser
  2. Create a new story from a template
  3. View story on the frontend
  4. Resize window to 640x853
  5. Somehow hide story UI
  6. Take screenshot

Or even better, but not sure if possible:

  1. Create a script that takes a template and runs it through getStoryMarkup to get full AMP HTML
  2. Open blank page in Puppeteer and use page.setContent() to load the story in the browser

But I assume AMP complains if not run on localhost or a proper host.

Having some automation/generation would be nice eventually, but since the templates don't really change ever we could definitely create those 3:4 images (semi-)manually for now.

I think this would be good to knock out. I'm drawing a blank trying to figure out the best way to get the proper aspect ratio on these images.

Since these are also used in the carousel in the editor, could you create a new ticket for it and perhaps sync with Morten on it? He might have some ideas there.

@BrittanyIRL
Copy link
Contributor Author

Chatted with @divyarajmasani and we were wondering whether we could open the templates as proper stories in the browser and then take screenshots with Puppeteer.

this feels alot like what @merapi was trying out with text sets: #7985 (comment)

@merapi
Copy link
Contributor

merapi commented Jul 27, 2021

2. Open blank page in Puppeteer and use page.setContent() to load the story in the browser

But I assume AMP complains if not run on localhost or a proper host.

No complaints there 👌🏻

But if we just want a screenshot of the first page and preserve the animated view on hover, we can use the same technique as in the text sets.

@swissspidy
Copy link
Collaborator

  1. Open blank page in Puppeteer and use page.setContent() to load the story in the browser
    But I assume AMP complains if not run on localhost or a proper host.

No complaints there 👌🏻

Amazing! That makes it pretty straightforward

But if we just want a screenshot of the first page and preserve the animated view on hover, we can use the same technique as in the text sets.

I'd really love it if we could do without animations, because it means we could avoid using PreviewPage from the editor. Otherwise we really need to untangle that dependency mess there, as the dashboard shouldn't rely on the editor code directly.

@BrittanyIRL
Copy link
Contributor Author

I'd really love it if we could do without animations, because it means we could avoid using PreviewPage from the editor. Otherwise we really need to untangle that dependency mess there, as the dashboard shouldn't rely on the editor code directly.

The 'my stories' view is now void of animations, i say we gut them from templates!

@BrittanyIRL BrittanyIRL self-assigned this Aug 10, 2021
@BrittanyIRL
Copy link
Contributor Author

Small update here, I'm going to go ahead and write this script to grab a screenshot of every template page so that we can use the same screenshots to update the page layouts.

Heads up: @barklund and @merapi incase this was on your radar.

@BrittanyIRL
Copy link
Contributor Author

This should have been an epic 😞 Sorry @bmattb .

For transparency since it's a little too late to correct the issue structure.

  1. Script to get screenshots of each template page
  2. Add slug to template metadata
  3. Add screenshots of each template page as png and WebP files to static site
  4. Use screenshots in explore template view
  5. Use screenshots in detail template view (if we don't want animation to play there, it's kinda wrong if memory serves anyways)

At this point, we can also start discussion of swapping out page templates in the editor for images. This won't help custom page templates at all but it'd cut down on the load.

@BrittanyIRL
Copy link
Contributor Author

@csossi - you already QA'd almost this whole thing! The only bit that needs approval still is this PR: #8801

There's testing directions in the PR. Let me know if you have any questions!

@BrittanyIRL BrittanyIRL assigned csossi and unassigned BrittanyIRL Aug 27, 2021
@csossi
Copy link

csossi commented Aug 29, 2021

Verified in QA

@csossi csossi removed their assignment Aug 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Group: Dashboard Group: Templates P2 Should do soon Status: Needs More Info Follow-up required in order to be actionable. Type: Performance Performance related issues and enhancements.
Projects
None yet
Development

No branches or pull requests

4 participants