From 997e3948e4a36469002f55529ba0e207c65f6ac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel?= Date: Thu, 21 May 2026 18:04:54 -0400 Subject: [PATCH] fix(studio): use host composition dimensions for all added blocks Blocks were using their own native dimensions (e.g. 1920x1080) instead of the host composition dimensions (e.g. 1280x720), causing them to overflow the viewport and break the layout. The block's iframe scales its content to fit the container, so using host dimensions is correct. --- packages/studio/src/utils/blockInstaller.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/studio/src/utils/blockInstaller.ts b/packages/studio/src/utils/blockInstaller.ts index 816c9faaf..660285c79 100644 --- a/packages/studio/src/utils/blockInstaller.ts +++ b/packages/studio/src/utils/blockInstaller.ts @@ -144,12 +144,8 @@ export async function addBlockToProject( const zIndex = getMaxZIndexFromIframe(opts.previewIframe ?? null) + 1; - const width = isBlock - ? (block as { dimensions: { width: number } }).dimensions.width - : hostDims.width; - const height = isBlock - ? (block as { dimensions: { height: number } }).dimensions.height - : hostDims.height; + const width = hostDims.width; + const height = hostDims.height; const left = visualPosition ? Math.round(visualPosition.left) : 0; const top = visualPosition ? Math.round(visualPosition.top) : 0;