feat(studio): add pasteboard background to preview viewport (#819)

* 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
This commit is contained in:
Miguel Ángel
2026-05-14 03:13:45 +02:00
committed by GitHub
parent 7585f79dc1
commit 34f5fc05f3
2 changed files with 16 additions and 2 deletions
@@ -163,7 +163,21 @@ export const Player = forwardRef<HTMLIFrameElement, PlayerProps>(
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<HTMLIFrameElement, PlayerProps>(
return (
<div
className="relative w-full h-full max-w-full max-h-full overflow-hidden bg-black flex items-center justify-center"
className="relative w-full h-full max-w-full max-h-full overflow-hidden flex items-center justify-center"
style={style}
>
<div ref={containerRef} className="w-full h-full" />