[eric] ui: round the app preview into a card (container + webview/iframe radius), breathing room around it

This commit is contained in:
ciregenz
2026-06-10 22:56:40 -07:00
parent 583c39e65c
commit 998de41da3
2 changed files with 7 additions and 2 deletions
+2 -2
View File
@@ -1237,9 +1237,9 @@ const ViewEditor: React.FC<Props> = ({ output }) => {
</Box>
{/* Tab content */}
<Box sx={{ flex: 1, overflow: 'hidden' }}>
<Box sx={{ flex: 1, overflow: 'hidden', px: 1, pb: 1 }}>
{activeTab === TAB_PREVIEW && (
<Box sx={{ position: 'relative', width: '100%', height: '100%' }}>
<Box sx={{ position: 'relative', width: '100%', height: '100%', borderRadius: '12px', overflow: 'hidden' }}>
{/* Render iframe under the placeholder so its first paint completes before we fade the placeholder out. */}
{/* previewSettled gate: a fast-switched-past app unmounts before this flips, so it never mounts a webview renderer. */}
{previewSettled && (workspaceServeUrl || !showInstallPlaceholder) && (
@@ -340,6 +340,10 @@ const ViewPreview = forwardRef<ViewPreviewHandle, Props>(({
width: '100%',
height: '100%',
border: 'none',
// Best-effort: newer Chromium clips a <webview>'s own radius even though
// it ignores a parent's. Square in older builds, harmless either way.
borderRadius: '12px',
overflow: 'hidden',
background: _hostBg,
...style,
}}
@@ -356,6 +360,7 @@ const ViewPreview = forwardRef<ViewPreviewHandle, Props>(({
width: '100%',
height: '100%',
border: 'none',
borderRadius: '12px',
background: _hostBg,
...style,
}}