Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/lazy-surface-iframes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"sideshow": patch
---

Lazy-load sandboxed surface iframes to reduce initial viewer work on long sessions.
1 change: 1 addition & 0 deletions e2e/viewer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ test("resize bridge grows the iframe beyond its 120px default", async ({ page, s
await page.goto(server.url);
const iframe = page.locator(".card iframe");
await expect(iframe).toBeVisible();
await expect(iframe).toHaveAttribute("loading", "lazy");
// the sandboxed bridge must report content height via postMessage; this is
// the WebKit-quirk regression test (see CLAUDE.md)
await expect
Expand Down
1 change: 1 addition & 0 deletions viewer/src/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ export function Card(props: { post: Post; standalone?: boolean }) {
});
}}
sandbox="allow-scripts"
loading="lazy"
class={SURFACE_FRAME_CLASSES[surface.kind]}
title={
props.post.surfaces.length > 1
Expand Down
Loading