Skip to content

Commit 2614071

Browse files
committed
feat(studio): show main composition behind component sub-composition previews
When previewing a component (compositions/components/*), render the main composition player as a backdrop behind the transparent component overlay. This lets users see captions, vignettes, and other overlays in context instead of against a black void.
1 parent 5c79cd0 commit 2614071

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

packages/studio/src/components/nle/NLEPreview.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,16 @@ export const NLEPreview = memo(function NLEPreview({
391391
}}
392392
data-testid="preview-zoom-stage"
393393
>
394+
{directUrl?.includes("/components/") && (
395+
<Player
396+
key={`backdrop-${projectId}`}
397+
projectId={projectId}
398+
onLoad={() => {}}
399+
portrait={portrait}
400+
suppressLoadingOverlay
401+
style={{ position: "absolute", inset: 0, zIndex: 0 }}
402+
/>
403+
)}
394404
<Player
395405
key={activeKey}
396406
ref={iframeRef}
@@ -403,6 +413,11 @@ export const NLEPreview = memo(function NLEPreview({
403413
onCompositionLoadingChange={onCompositionLoadingChange}
404414
portrait={portrait}
405415
suppressLoadingOverlay={suppressLoadingOverlay}
416+
style={
417+
directUrl?.includes("/components/")
418+
? { position: "absolute", inset: 0, zIndex: 1 }
419+
: undefined
420+
}
406421
/>
407422
</div>
408423
</div>

0 commit comments

Comments
 (0)