mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-09-13 13:17:40 +02:00
[eric] ui: round the app preview into a card (container + webview/iframe radius), breathing room around it
This commit is contained in:
@@ -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,
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user