Skip to content

Commit f27cb18

Browse files
Vikhyath MondretiVikhyath Mondreti
authored andcommitted
fix lint
1 parent e102b6c commit f27cb18

File tree

6 files changed

+19
-48
lines changed

6 files changed

+19
-48
lines changed

apps/sim/app/workspace/[workspaceId]/logs/components/frozen-canvas/frozen-canvas.tsx

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function ExpandableDataSection({ title, data }: { title: string; data: any }) {
4141
<button
4242
onClick={() => setIsModalOpen(true)}
4343
className='rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground'
44-
title="Expand in modal"
44+
title='Expand in modal'
4545
>
4646
<Maximize2 className='h-3 w-3' />
4747
</button>
@@ -78,7 +78,9 @@ function ExpandableDataSection({ title, data }: { title: string; data: any }) {
7878
</button>
7979
</div>
8080
<div className='h-[calc(80vh-4rem)] overflow-auto p-4'>
81-
<pre className='whitespace-pre-wrap break-words font-mono text-foreground text-sm'>{jsonString}</pre>
81+
<pre className='whitespace-pre-wrap break-words font-mono text-foreground text-sm'>
82+
{jsonString}
83+
</pre>
8284
</div>
8385
</div>
8486
</div>
@@ -241,15 +243,9 @@ function PinnedLogs({ executionData, onClose }: { executionData: any; onClose: (
241243
)}
242244
</div>
243245

244-
<ExpandableDataSection
245-
title="Input"
246-
data={formatted.input}
247-
/>
246+
<ExpandableDataSection title='Input' data={formatted.input} />
248247

249-
<ExpandableDataSection
250-
title="Output"
251-
data={formatted.output}
252-
/>
248+
<ExpandableDataSection title='Output' data={formatted.output} />
253249

254250
{formatted.cost && formatted.cost.total > 0 && (
255251
<div>

apps/sim/app/workspace/[workspaceId]/logs/components/sidebar/sidebar.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,8 +494,6 @@ export function Sidebar({
494494
</div>
495495
)}
496496

497-
498-
499497
{/* Enhanced Cost - only show for enhanced logs with actual cost data */}
500498
{log.metadata?.enhanced && hasCostInfo && (
501499
<div>

apps/sim/app/workspace/[workspaceId]/logs/components/trace-spans/trace-spans-display.tsx

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
'use client'
22

33
import { useState } from 'react'
4-
import {
5-
ChevronDown,
6-
ChevronRight,
7-
Code,
8-
Cpu,
9-
ExternalLink,
10-
} from 'lucide-react'
4+
import { ChevronDown, ChevronRight, Code, Cpu, ExternalLink } from 'lucide-react'
115
import {
126
AgentIcon,
137
ApiIcon,
@@ -201,17 +195,11 @@ export function TraceSpansDisplay({
201195
// Keep track of expanded spans
202196
const [expandedSpans, setExpandedSpans] = useState<Set<string>>(new Set())
203197

204-
205-
206-
207-
208198
// Early return after all hooks
209199
if (!traceSpans || traceSpans.length === 0) {
210200
return <div className='text-muted-foreground text-sm'>No trace data available</div>
211201
}
212202

213-
214-
215203
// Find the earliest start time among all spans to be the workflow start time
216204
const workflowStartTime = traceSpans.reduce((earliest, span) => {
217205
const startTime = new Date(span.startTime).getTime()
@@ -244,8 +232,6 @@ export function TraceSpansDisplay({
244232
}
245233
}
246234

247-
248-
249235
return (
250236
<div className='w-full'>
251237
<div className='mb-2 flex items-center justify-between'>
@@ -329,8 +315,6 @@ function TraceSpanItem({
329315
const safeStartPercent = Math.min(100, Math.max(0, relativeStartPercent))
330316
const safeWidthPercent = Math.max(2, Math.min(100 - safeStartPercent, actualDurationPercent))
331317

332-
333-
334318
// Handle click to expand/collapse this span
335319
const handleSpanClick = () => {
336320
if (hasNestedItems) {
@@ -549,12 +533,12 @@ function TraceSpanItem({
549533
<div>
550534
{/* Block Input/Output Data */}
551535
{(span.input || span.output) && (
552-
<div className='mt-2 ml-8 mr-4 mb-4 space-y-3 overflow-hidden'>
536+
<div className='mt-2 mr-4 mb-4 ml-8 space-y-3 overflow-hidden'>
553537
{/* Input Data */}
554538
{span.input && (
555539
<div>
556540
<h4 className='mb-2 font-medium text-muted-foreground text-xs'>Input</h4>
557-
<div className='overflow-hidden rounded-md bg-secondary/30 p-3 mb-2'>
541+
<div className='mb-2 overflow-hidden rounded-md bg-secondary/30 p-3'>
558542
<BlockDataDisplay data={span.input} blockType={span.type} isInput={true} />
559543
</div>
560544
</div>
@@ -566,7 +550,7 @@ function TraceSpanItem({
566550
<h4 className='mb-2 font-medium text-muted-foreground text-xs'>
567551
{span.status === 'error' ? 'Error Details' : 'Output'}
568552
</h4>
569-
<div className='overflow-hidden rounded-md bg-secondary/30 p-3 mb-2'>
553+
<div className='mb-2 overflow-hidden rounded-md bg-secondary/30 p-3'>
570554
<BlockDataDisplay
571555
data={span.output}
572556
blockType={span.type}

apps/sim/app/workspace/[workspaceId]/logs/logs.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,12 @@ export default function Logs() {
314314
<div className='font-medium text-muted-foreground text-xs'>Time</div>
315315
<div className='font-medium text-muted-foreground text-xs'>Status</div>
316316
<div className='font-medium text-muted-foreground text-xs'>Workflow</div>
317-
<div className='hidden lg:block font-medium text-muted-foreground text-xs'>Trigger</div>
318-
<div className='hidden xl:block font-medium text-muted-foreground text-xs'>Cost</div>
317+
<div className='hidden font-medium text-muted-foreground text-xs lg:block'>
318+
Trigger
319+
</div>
320+
<div className='hidden font-medium text-muted-foreground text-xs xl:block'>
321+
Cost
322+
</div>
319323
<div className='font-medium text-muted-foreground text-xs'>Duration</div>
320324
</div>
321325
</div>
@@ -405,11 +409,9 @@ export default function Logs() {
405409

406410
{/* Cost */}
407411
<div className='hidden xl:block'>
408-
<div className='text-xs text-muted-foreground'>
412+
<div className='text-muted-foreground text-xs'>
409413
{log.metadata?.enhanced && log.metadata?.cost?.total ? (
410-
<span>
411-
${log.metadata.cost.total.toFixed(4)}
412-
</span>
414+
<span>${log.metadata.cost.total.toFixed(4)}</span>
413415
) : (
414416
<span className='pl-0.5'></span>
415417
)}

apps/sim/lib/logs/enhanced-execution-logger.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,14 +214,7 @@ export class EnhancedExecutionLogger implements IExecutionLoggerService {
214214
finalOutput: BlockOutputData
215215
traceSpans?: TraceSpan[]
216216
}): Promise<WorkflowExecutionLog> {
217-
const {
218-
executionId,
219-
endedAt,
220-
totalDurationMs,
221-
costSummary,
222-
finalOutput,
223-
traceSpans,
224-
} = params
217+
const { executionId, endedAt, totalDurationMs, costSummary, finalOutput, traceSpans } = params
225218

226219
logger.debug(`Completing workflow execution ${executionId}`)
227220

apps/sim/lib/logs/enhanced-logging-factory.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ export async function loadWorkflowStateForExecution(workflowId: string): Promise
4646
}
4747
}
4848

49-
50-
5149
export function calculateCostSummary(traceSpans: any[]): {
5250
totalCost: number
5351
totalInputCost: number

0 commit comments

Comments
 (0)