Skip to content

Commit e98e80a

Browse files
waleedlatif1claude
andcommitted
chore(logs): trim verbose comments added during PR
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 70fc328 commit e98e80a

3 files changed

Lines changed: 2 additions & 40 deletions

File tree

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

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ import { formatCost } from '@/providers/utils'
4848
import { useLogDetailsUIStore } from '@/stores/logs/store'
4949
import { MAX_LOG_DETAILS_WIDTH_RATIO, MIN_LOG_DETAILS_WIDTH } from '@/stores/logs/utils'
5050

51-
/**
52-
* Workflow Output section with code viewer, copy, search, and context menu functionality
53-
*/
5451
export const WorkflowOutputSection = memo(
5552
function WorkflowOutputSection({ output }: { output: Record<string, unknown> }) {
5653
const contentRef = useRef<HTMLDivElement>(null)
@@ -258,18 +255,10 @@ export const WorkflowOutputSection = memo(
258255
export type LogDetailsTab = 'overview' | 'trace'
259256

260257
interface LogDetailsContentProps {
261-
/** The log to display */
262258
log: WorkflowLogRow
263-
/** Fires when the active tab changes, so embedders can gate their own keyboard handlers */
264259
onActiveTabChange?: (tab: LogDetailsTab) => void
265260
}
266261

267-
/**
268-
* Tabbed body for a single log: overview details and trace spans, plus the
269-
* execution snapshot modal. Used as the body of the `LogDetails` sidebar and
270-
* embedded directly inside the Mothership resource panel — keep the two in
271-
* sync by editing this component, not by re-implementing it elsewhere.
272-
*/
273262
export function LogDetailsContent({ log, onActiveTabChange }: LogDetailsContentProps) {
274263
const [isExecutionSnapshotOpen, setIsExecutionSnapshotOpen] = useState(false)
275264
const [activeTab, setActiveTab] = useState<LogDetailsTab>('overview')
@@ -310,7 +299,7 @@ export function LogDetailsContent({ log, onActiveTabChange }: LogDetailsContentP
310299
!permissionConfig.hideTraceSpans
311300

312301
const showTraceTab = !permissionConfig.hideTraceSpans && isLikelyExecution
313-
// double-cast-allowed: contract trace span schema is intentionally permissive (optional duration/startTime/endTime to tolerate legacy persisted JSON); the canonical TraceSpan used by TraceView/ExecutionSnapshot requires them, and runtime data from the executor always supplies them.
302+
// double-cast-allowed: contract schema makes duration/startTime optional for legacy persisted JSON; runtime data always supplies them.
314303
const traceSpans = log.executionData?.traceSpans as unknown as TraceSpan[] | undefined
315304

316305
const resolvedTab: LogDetailsTab = activeTab === 'trace' && !showTraceTab ? 'overview' : activeTab
@@ -634,33 +623,18 @@ export function LogDetailsContent({ log, onActiveTabChange }: LogDetailsContentP
634623
}
635624

636625
interface LogDetailsProps {
637-
/** The log to display details for */
638626
log: WorkflowLogRow | null
639-
/** Whether the sidebar is open */
640627
isOpen: boolean
641-
/** Callback when closing the sidebar */
642628
onClose: () => void
643-
/** Callback to navigate to next log */
644629
onNavigateNext?: () => void
645-
/** Callback to navigate to previous log */
646630
onNavigatePrev?: () => void
647-
/** Whether there is a next log available */
648631
hasNext?: boolean
649-
/** Whether there is a previous log available */
650632
hasPrev?: boolean
651-
/** Callback to retry a failed execution */
652633
onRetryExecution?: () => void
653-
/** Whether a retry is currently in progress */
654634
isRetryPending?: boolean
655-
/** Fires when the active tab changes, so the parent can gate its own keyboard handlers */
656635
onActiveTabChange?: (tab: LogDetailsTab) => void
657636
}
658637

659-
/**
660-
* Sidebar panel displaying detailed information about a selected log.
661-
* Wraps `LogDetailsContent` with sidebar chrome — resize handle, header, and
662-
* keyboard navigation between logs.
663-
*/
664638
export const LogDetails = memo(function LogDetails({
665639
log,
666640
isOpen,
@@ -687,9 +661,6 @@ export const LogDetails = memo(function LogDetails({
687661
const { handleMouseDown } = useLogDetailsResize()
688662

689663
const maxVw = `${MAX_LOG_DETAILS_WIDTH_RATIO * 100}vw`
690-
// CSS-side clamp matching `clampPanelWidth` in stores/logs/utils.ts: the
691-
// floor is itself capped at the max-vw ratio so a narrow viewport doesn't
692-
// let the min outpace the cap and cover the table behind the panel.
693664
const effectiveWidth = `clamp(min(${MIN_LOG_DETAILS_WIDTH}px, ${maxVw}), ${panelWidth}px, ${maxVw})`
694665

695666
useEffect(() => {
@@ -700,8 +671,7 @@ export const LogDetails = memo(function LogDetails({
700671

701672
if (!isOpen) return
702673

703-
// When the Trace tab is active, arrow keys belong to TraceView's own
704-
// span-navigation handler. Log-to-log navigation should not hijack them.
674+
// Trace tab owns arrow keys for span navigation.
705675
if (activeTabRef.current === 'trace') return
706676

707677
if (e.key === 'ArrowUp' && hasPrev && onNavigatePrev) {

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,6 @@ export default function Logs() {
221221
const params = useParams()
222222
const workspaceId = params.workspaceId as string
223223

224-
// Hydrate filters from the URL synchronously on first render so
225-
// useLogsList / useDashboardStats fire once with the correct filters
226-
// instead of refetching after a post-mount effect.
227224
useState(() => {
228225
useFilterStore.getState().initializeFromURL()
229226
return null

apps/sim/hooks/queries/logs.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,6 @@ export function useLogDetail(
200200
})
201201
}
202202

203-
/**
204-
* Looks up a workflow log by its `executionId`. Writes the resulting detail
205-
* through to the canonical `detail(id)` cache so subsequent `useLogDetail`
206-
* reads hit instantly.
207-
*/
208203
export function useLogByExecutionId(
209204
workspaceId: string | undefined,
210205
executionId: string | null | undefined

0 commit comments

Comments
 (0)