Skip to content

Commit cda1222

Browse files
committed
checkpoint
1 parent d34499a commit cda1222

File tree

15 files changed

+1068
-459
lines changed

15 files changed

+1068
-459
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/chat/chat.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ import { useChatStore } from '@/stores/chat/store'
5656
import { getChatPosition } from '@/stores/chat/utils'
5757
import { useCurrentWorkflowExecution } from '@/stores/execution'
5858
import { useOperationQueue } from '@/stores/operation-queue/store'
59-
import { useTerminalConsoleStore } from '@/stores/terminal'
59+
import { useTerminalConsoleStore, useWorkflowConsoleEntries } from '@/stores/terminal'
6060
import { useWorkflowRegistry } from '@/stores/workflows/registry/store'
6161
import { useSubBlockStore } from '@/stores/workflows/subblock/store'
6262
import { useWorkflowStore } from '@/stores/workflows/workflow/store'
@@ -265,8 +265,7 @@ export function Chat() {
265265
)
266266

267267
const hasConsoleHydrated = useTerminalConsoleStore((state) => state._hasHydrated)
268-
const entriesFromStore = useTerminalConsoleStore((state) => state.entries)
269-
const entries = hasConsoleHydrated ? entriesFromStore : []
268+
const entries = useWorkflowConsoleEntries(hasConsoleHydrated ? activeWorkflowId : undefined)
270269
const { isExecuting } = useCurrentWorkflowExecution()
271270
const { handleRunWorkflow, handleCancelExecution } = useWorkflowExecution()
272271
const { data: session } = useSession()
@@ -427,9 +426,8 @@ export function Chat() {
427426
})
428427

429428
const outputEntries = useMemo(() => {
430-
if (!activeWorkflowId) return []
431-
return entries.filter((entry) => entry.workflowId === activeWorkflowId && entry.output)
432-
}, [entries, activeWorkflowId])
429+
return entries.filter((entry) => entry.output)
430+
}, [entries])
433431

434432
const workflowMessages = useMemo(() => {
435433
if (!activeWorkflowId) return []

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/terminal/components/output-panel/output-panel.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export interface OutputPanelProps {
9393
handleTrainingClick: (e: React.MouseEvent) => void
9494
showCopySuccess: boolean
9595
handleCopy: () => void
96-
filteredEntries: ConsoleEntry[]
96+
hasEntries: boolean
9797
handleExportConsole: (e: React.MouseEvent) => void
9898
handleClearConsole: (e: React.MouseEvent) => void
9999
shouldShowCodeDisplay: boolean
@@ -120,7 +120,7 @@ export const OutputPanel = React.memo(function OutputPanel({
120120
handleTrainingClick,
121121
showCopySuccess,
122122
handleCopy,
123-
filteredEntries,
123+
hasEntries,
124124
handleExportConsole,
125125
handleClearConsole,
126126
shouldShowCodeDisplay,
@@ -431,7 +431,7 @@ export const OutputPanel = React.memo(function OutputPanel({
431431
<span>{showCopySuccess ? 'Copied' : 'Copy output'}</span>
432432
</Tooltip.Content>
433433
</Tooltip.Root>
434-
{filteredEntries.length > 0 && (
434+
{hasEntries && (
435435
<>
436436
<Tooltip.Root>
437437
<Tooltip.Trigger asChild>

0 commit comments

Comments
 (0)