improvement(ui/ux): console

This commit is contained in:
Emir Karabeg
2025-03-26 00:14:40 -07:00
parent 3e3d370c6d
commit 9987df2b84
2 changed files with 14 additions and 9 deletions
@@ -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>
+11 -6
View File
@@ -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,