Skip to content

Conversation

@wpalani
Copy link
Member

@wpalani wpalani commented Jan 28, 2026

Proposed changes

At the moment, in the previews step, we do the following to generate the snapshots:

  1. Get the generated content for all 3 previews.
  2. Publish them as temporary pages.
  3. Use our screenshot service to crawl each page and take screenshot of the page.
  4. Return the screenshots alongside the temporary pages back to Onboarding to use them in the previews
  5. The screenshots are the primary snapshot source, but if that failed for whatever reason we fallback to render the iframes.

The reason we're doing the above rather than just rendering the iframes to begin with... we had very problematic patterns that used dvh values to set the height of certain elements, in the iframe, these elements were huge no matter what we did to scale down the design, because their height was being set according the window screen size rather than the iframe container.

With the migration to sitekits, i've reviewed all of our sitekits and none of them seem to be using patterns that use this kind of styling. So it's safe to say now we can just use iframes immediately to render the preview snapshots.

Additionally, we need set some sort of a standard or requirement to never do this when designing patters for the AI service. I'll defer to @zlateska for that.

This PR does 2 things:

  1. Use iframes to render snapshots by commenting out the screenshot generation code and we'll remove that code once we feel confident with using iframes only.
  2. Migrate the PreviewService class responsible for handling publishing, generating and deleting the previews from the Onboarding-Data module to Onboarding.

Another side benefit of doing this is the generation times will go down 4s-8s which the avg time it takes to crawl and take screenshots of the generated sites.

Also fixing this bug: https://newfold.atlassian.net/browse/PRESS0-3811

Type of Change

Production

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update
  • Refactoring / housekeeping (changes to files not directly related to functionality)

Development

  • Tests
  • Dependency update
  • Environment update / refactoring
  • Documentation Update

Visual

Checklist

  • I have read the CONTRIBUTING doc
  • I have viewed my change in a web-browser
  • Linting and tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

@wpalani wpalani merged commit e08c6b0 into trunk Feb 2, 2026
13 of 15 checks passed
@wpalani wpalani deleted the update/preview-snapshots branch February 2, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants