From 34f5fc05f32d3ba4470252abd394c82993550a41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel?= Date: Thu, 14 May 2026 03:13:45 +0200 Subject: [PATCH] feat(studio): add pasteboard background to preview viewport (#819) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(studio): add pasteboard background to preview viewport Adds bg-neutral-800 to the preview viewport so the area outside the canvas is visually distinct from the composition content — consistent with professional video editors (Premiere, DaVinci, Figma). * feat(studio): pasteboard background and canvas outline around preview - NLEPreview: viewport gets bg-neutral-700 (#404040) as the pasteboard color surrounding the canvas — distinct from the app chrome (#0a0a0a) - Player wrapper: drop bg-black so the pasteboard shows around the canvas (loading overlays still cover the area with bg-black during load) - Player: set host background to transparent via inline style (overrides :host { background: #000 } in shadow DOM), and inject a style rule into the open shadow root so .hfp-container has overflow:visible and the canvas iframe gets a thin white ring + soft drop-shadow — making the canvas boundary legible against the pasteboard --- .../studio/src/components/nle/NLEPreview.tsx | 2 +- packages/studio/src/player/components/Player.tsx | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/packages/studio/src/components/nle/NLEPreview.tsx b/packages/studio/src/components/nle/NLEPreview.tsx index 46a2640fa..8be285035 100644 --- a/packages/studio/src/components/nle/NLEPreview.tsx +++ b/packages/studio/src/components/nle/NLEPreview.tsx @@ -264,7 +264,7 @@ export const NLEPreview = memo(function NLEPreview({
( player.style.width = "100%"; player.style.height = "100%"; player.style.display = "block"; + player.style.background = "transparent"; container.appendChild(player); + + // Inject pasteboard shadow: let the shadow around the canvas bleed + // into the surrounding pasteboard area (overflow: visible on the container) + // and add a subtle outline + drop-shadow so the canvas boundary reads + // against the gray pasteboard, consistent with professional editors. + if (player.shadowRoot) { + const pasteboardStyle = document.createElement("style"); + pasteboardStyle.textContent = + ".hfp-container{overflow:visible}" + + ".hfp-iframe{box-shadow:0 0 0 1px rgba(255,255,255,0.08),0 4px 32px rgba(0,0,0,.7)}"; + player.shadowRoot.appendChild(pasteboardStyle); + } + enableInteractiveIframe(player); // Bridge the inner iframe to the forwarded ref for useTimelinePlayer. @@ -309,7 +323,7 @@ export const Player = forwardRef( return (