mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
improvement(ui/ux): console
This commit is contained in:
+3
-3
@@ -71,7 +71,7 @@ export function ConsoleEntry({ entry, consoleWidth }: ConsoleEntryProps) {
|
||||
{!entry.error && !entry.warning && (
|
||||
<div className="flex items-start gap-2">
|
||||
<Terminal className="h-4 w-4 text-muted-foreground mt-1" />
|
||||
<div className="text-sm font-mono flex-1">
|
||||
<div className="text-sm font-mono flex-1 break-normal whitespace-normal overflow-wrap-anywhere">
|
||||
<JSONView data={entry.output} initiallyExpanded={isExpanded} />
|
||||
</div>
|
||||
</div>
|
||||
@@ -80,7 +80,7 @@ export function ConsoleEntry({ entry, consoleWidth }: ConsoleEntryProps) {
|
||||
{entry.error && (
|
||||
<div className="flex items-start gap-2 border rounded-md p-3 border-red-500 bg-red-50 text-destructive dark:border-border dark:text-foreground dark:bg-background">
|
||||
<AlertCircle className="h-4 w-4 text-red-500 mt-1" />
|
||||
<div className="flex-1 break-all">
|
||||
<div className="flex-1 break-normal whitespace-normal overflow-wrap-anywhere">
|
||||
<div className="font-medium">Error</div>
|
||||
<pre className="text-sm whitespace-pre-wrap">{entry.error}</pre>
|
||||
</div>
|
||||
@@ -90,7 +90,7 @@ export function ConsoleEntry({ entry, consoleWidth }: ConsoleEntryProps) {
|
||||
{entry.warning && (
|
||||
<div className="flex items-start gap-2 border rounded-md p-3 border-yellow-500 bg-yellow-50 text-yellow-700 dark:border-border dark:text-yellow-500 dark:bg-background">
|
||||
<AlertTriangle className="h-4 w-4 text-yellow-500 mt-1" />
|
||||
<div className="flex-1 break-all">
|
||||
<div className="flex-1 break-normal whitespace-normal overflow-wrap-anywhere">
|
||||
<div className="font-medium">Warning</div>
|
||||
<pre className="text-sm whitespace-pre-wrap">{entry.warning}</pre>
|
||||
</div>
|
||||
|
||||
@@ -7,6 +7,7 @@ import { useExecutionStore } from '@/stores/execution/store'
|
||||
import { useNotificationStore } from '@/stores/notifications/store'
|
||||
import { useEnvironmentStore } from '@/stores/settings/environment/store'
|
||||
import { useGeneralStore } from '@/stores/settings/general/store'
|
||||
import { usePanelStore } from '@/stores/panel/store'
|
||||
import { useWorkflowRegistry } from '@/stores/workflows/registry/store'
|
||||
import { mergeSubblockState } from '@/stores/workflows/utils'
|
||||
import { useWorkflowStore } from '@/stores/workflows/workflow/store'
|
||||
@@ -22,6 +23,7 @@ export function useWorkflowExecution() {
|
||||
const { activeWorkflowId } = useWorkflowRegistry()
|
||||
const { addNotification } = useNotificationStore()
|
||||
const { toggleConsole } = useConsoleStore()
|
||||
const { togglePanel, setActiveTab } = usePanelStore()
|
||||
const { getAllVariables } = useEnvironmentStore()
|
||||
const { isDebugModeEnabled } = useGeneralStore()
|
||||
const { getVariablesByWorkflowId, variables } = useVariablesStore()
|
||||
@@ -79,13 +81,14 @@ export function useWorkflowExecution() {
|
||||
setIsDebugging(true)
|
||||
}
|
||||
|
||||
// Get the current console state directly from the store
|
||||
const currentIsOpen = useConsoleStore.getState().isOpen
|
||||
|
||||
// Open console if it's not already open
|
||||
if (!currentIsOpen) {
|
||||
toggleConsole()
|
||||
// Check if panel is open and open it if not
|
||||
const isPanelOpen = usePanelStore.getState().isOpen
|
||||
if (!isPanelOpen) {
|
||||
togglePanel()
|
||||
}
|
||||
|
||||
// Set active tab to console
|
||||
setActiveTab('console')
|
||||
|
||||
const executionId = uuidv4()
|
||||
|
||||
@@ -257,6 +260,8 @@ export function useWorkflowExecution() {
|
||||
loops,
|
||||
addNotification,
|
||||
toggleConsole,
|
||||
togglePanel,
|
||||
setActiveTab,
|
||||
getAllVariables,
|
||||
getVariablesByWorkflowId,
|
||||
setIsExecuting,
|
||||
|
||||
Reference in New Issue
Block a user