Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/sim/app/f/[token]/public-file-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ export function PublicFileView({
)

return (
<div className='light desktop-title-bar-page flex flex-col bg-[var(--bg)]'>
<div className='light desktop-title-bar-page flex h-screen flex-col overflow-hidden bg-[var(--bg)]'>
<DesktopTitleBarLane />
<header className='sticky top-[var(--desktop-title-bar-height)] z-10 flex items-center justify-between gap-4 border-[var(--border)] border-b bg-[var(--bg)] px-4 py-3'>
<header className='z-10 flex shrink-0 items-center justify-between gap-4 border-[var(--border)] border-b bg-[var(--bg)] px-4 py-3'>
<div className='flex min-w-0 items-center gap-3'>
{!brand.logoUrl && (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,12 @@ const ReadOnlyTextPreview = memo(function ReadOnlyTextPreview({

const resolvedError = resolvePreviewError((error as Error | null) ?? null, null)
if (resolvedError) return <PreviewError label='file' error={resolvedError} />
if (isLoading || content == null) return <PreviewLoadingFrame className='h-full' tone='surface' />
if (isLoading || content == null)
return <PreviewLoadingFrame className='min-h-0 flex-1' tone='surface' />

if (resolvePreviewType(file.type, file.name)) {
return (
<div className='h-full min-h-0 w-full overflow-auto'>
<div className='flex min-h-0 w-full flex-1 flex-col overflow-auto'>
<PreviewPanel
content={content}
mimeType={file.type}
Expand All @@ -302,7 +303,7 @@ const ReadOnlyTextPreview = memo(function ReadOnlyTextPreview({
}

return (
<div className='h-full min-h-0 w-full overflow-auto bg-[var(--surface-1)] p-4'>
<div className='min-h-0 w-full flex-1 overflow-auto bg-[var(--surface-1)] p-4'>
<pre className='whitespace-pre-wrap break-words font-mono text-[13px] text-[var(--text-body)]'>
{content}
</pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ const HtmlPreview = memo(function HtmlPreview({ content }: { content: string })
}, [])

return (
<div ref={containerRef} className='h-full overflow-hidden'>
<div ref={containerRef} className='flex min-h-0 flex-1 overflow-hidden'>
{isRenderable && (
<iframe
key={resumeNonce}
Expand All @@ -225,7 +225,7 @@ function SvgPreview({ content }: { content: string }) {
}, [content])

return (
<ZoomablePreview className='h-full' contentClassName='h-full w-full'>
<ZoomablePreview className='min-h-0 flex-1' contentClassName='h-full w-full'>
{blobUrl && (
<img
src={blobUrl}
Expand All @@ -240,7 +240,7 @@ function SvgPreview({ content }: { content: string }) {

function MermaidFilePreview({ content, isStreaming }: { content: string; isStreaming?: boolean }) {
return (
<div className='h-full overflow-auto p-6'>
<div className='min-h-0 flex-1 overflow-auto p-6'>
<MermaidDiagram
definition={content}
isStreaming={isStreaming}
Expand All @@ -267,14 +267,14 @@ const CsvPreview = memo(function CsvPreview({

if (headers.length === 0) {
return (
<div className='flex h-full items-center justify-center p-6'>
<div className='flex min-h-0 flex-1 items-center justify-center p-6'>
<p className='text-[13px] text-[var(--text-muted)]'>No data to display</p>
</div>
)
}

return (
<div className='h-full overflow-auto p-6'>
<div className='min-h-0 flex-1 overflow-auto p-6'>
<DataTable headers={headers} rows={rows} />
</div>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,10 @@ export const TextEditor = memo(function TextEditor({
</div>
)}
<div
className={cn('min-w-0 flex-1 overflow-hidden', isResizing && 'pointer-events-none')}
className={cn(
'flex min-w-0 flex-1 flex-col overflow-hidden',
isResizing && 'pointer-events-none'
)}
>
<PreviewPanel
key={previewContextKey ? `${file.id}:${previewContextKey}` : file.id}
Expand Down
Loading