Skip to content

Wait for artifact layouts before rendering previews - #755

Draft
an1va wants to merge 1 commit into
mainfrom
agent/fix-artifact-access-render-proof
Draft

an1va wants to merge 1 commit into
mainfrom
agent/fix-artifact-access-render-proof

Conversation

@an1va

@an1va an1va commented Aug 17, 2026 •

Copy link
Copy Markdown
Collaborator

What changed

  • Sample visible DOM geometry after network idle in both preview renderers.
  • Require three identical, ready layout samples before storing a screenshot.
  • Keep waiting while eager images are incomplete.
  • Fail the render when the layout never settles instead of saving a convincing blank shell.

Why

Client-rendered artifacts can add their primary gallery after network idle. The preview worker previously captured that transition and stored a shell with an empty central canvas. This makes render readiness depend on stable visible layout rather than network timing alone.

Verification

  • pnpm verify
  • 250 API test files passed; 2 skipped
  • 2,380 API tests passed; 3 skipped
  • Node and Cloudflare Worker typechecks passed
  • Added focused coverage for late gallery population, pending images, and never-settling layouts

Reproduction artifact

https://derive.to/artifacts/sift-for-accenture-recommended-single-and-packet-2ks00lnp


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@github-actions

Copy link
Copy Markdown

Preview

https://derive-pr-755.derive-to.workers.dev

Deployed from af0734c as derive-pr-755.

It shares production's database — sign in with your real account, and treat anything you change here as changed for real. It has no routes, no cron, no queue consumer and no OG renderer, so it cannot serve derive.to, run scheduled work, or write images onto real artifacts.

Unlike production it serves artifact HTML on its own origin (that is what makes frame-side changes visible here). Storage is still sandboxed away, but untrusted HTML and the sign-in form share a hostname — treat this URL as you would any link: don't type a password into it because a page asked you to.

This branch has not been deployed

No deployments
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.

1 participant