Skip to content

Commit 16c60e7

Browse files
committed
fix(logs): use formatDuration utility and align file cards styling
1 parent 4ca0081 commit 16c60e7

File tree

2 files changed

+17
-20
lines changed

2 files changed

+17
-20
lines changed

apps/sim/app/workspace/[workspaceId]/logs/components/log-details/components/file-download/file-download.tsx

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,12 @@ function FileCard({ file, isExecutionFile = false, workspaceId }: FileCardProps)
104104
}
105105

106106
return (
107-
<div className='flex flex-col gap-[8px] rounded-[6px] bg-[var(--surface-1)] px-[10px] py-[8px]'>
108-
<div className='flex items-center justify-between'>
109-
<div className='flex items-center gap-[8px]'>
110-
<span className='truncate font-medium text-[12px] text-[var(--text-secondary)]'>
111-
{file.name}
112-
</span>
113-
</div>
114-
<span className='font-medium text-[12px] text-[var(--text-tertiary)]'>
107+
<div className='flex flex-col gap-[4px] rounded-[6px] bg-[var(--surface-1)] px-[8px] py-[6px]'>
108+
<div className='flex min-w-0 items-center justify-between gap-[8px]'>
109+
<span className='min-w-0 flex-1 truncate font-medium text-[12px] text-[var(--text-secondary)]'>
110+
{file.name}
111+
</span>
112+
<span className='flex-shrink-0 font-medium text-[12px] text-[var(--text-tertiary)]'>
115113
{formatFileSize(file.size)}
116114
</span>
117115
</div>
@@ -142,20 +140,18 @@ export function FileCards({ files, isExecutionFile = false, workspaceId }: FileC
142140
}
143141

144142
return (
145-
<div className='flex w-full flex-col gap-[6px] rounded-[6px] bg-[var(--surface-2)] px-[10px] py-[8px]'>
143+
<div className='mt-[4px] flex flex-col gap-[6px] rounded-[6px] border border-[var(--border)] bg-[var(--surface-2)] px-[10px] py-[8px] dark:bg-transparent'>
146144
<span className='font-medium text-[12px] text-[var(--text-tertiary)]'>
147145
Files ({files.length})
148146
</span>
149-
<div className='flex flex-col gap-[8px]'>
150-
{files.map((file, index) => (
151-
<FileCard
152-
key={file.id || `file-${index}`}
153-
file={file}
154-
isExecutionFile={isExecutionFile}
155-
workspaceId={workspaceId}
156-
/>
157-
))}
158-
</div>
147+
{files.map((file, index) => (
148+
<FileCard
149+
key={file.id || `file-${index}`}
150+
file={file}
151+
isExecutionFile={isExecutionFile}
152+
workspaceId={workspaceId}
153+
/>
154+
))}
159155
</div>
160156
)
161157
}

apps/sim/app/workspace/[workspaceId]/logs/components/log-details/log-details.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
import { ScrollArea } from '@/components/ui/scroll-area'
1919
import { BASE_EXECUTION_CHARGE } from '@/lib/billing/constants'
2020
import { cn } from '@/lib/core/utils/cn'
21+
import { formatDuration } from '@/lib/core/utils/formatting'
2122
import { filterHiddenOutputKeys } from '@/lib/logs/execution/trace-spans/trace-spans'
2223
import {
2324
ExecutionSnapshot,
@@ -453,7 +454,7 @@ export const LogDetails = memo(function LogDetails({
453454
Duration
454455
</span>
455456
<span className='font-medium text-[13px] text-[var(--text-secondary)]'>
456-
{log.duration || '—'}
457+
{formatDuration(log.duration, { precision: 2 }) || '—'}
457458
</span>
458459
</div>
459460

0 commit comments

Comments
 (0)