88 Layers ,
99 Play ,
1010 RefreshCw ,
11+ SkipForward ,
12+ StepForward ,
1113 Store ,
1214 Trash2 ,
1315 WifiOff ,
@@ -42,7 +44,6 @@ import {
4244 getKeyboardShortcutText ,
4345 useKeyboardShortcuts ,
4446} from '@/app/workspace/[workspaceId]/w/hooks/use-keyboard-shortcuts'
45- import { useExecutionStore } from '@/stores/execution/store'
4647import { useFolderStore } from '@/stores/folders/store'
4748import { usePanelStore } from '@/stores/panel/store'
4849import { useGeneralStore } from '@/stores/settings/general/store'
@@ -110,9 +111,6 @@ export function ControlBar({ hasValidationErrors = false }: ControlBarProps) {
110111 const [ isExpanded , setIsExpanded ] = useState ( false )
111112 const [ isTemplateModalOpen , setIsTemplateModalOpen ] = useState ( false )
112113 const [ isAutoLayouting , setIsAutoLayouting ] = useState ( false )
113- // Remove chat modal state
114- // const [isChatPromptOpen, setIsChatPromptOpen] = useState(false)
115- // const [chatPrompt, setChatPrompt] = useState('')
116114
117115 // Delete workflow state - grouped for better organization
118116 const [ deleteState , setDeleteState ] = useState ( {
@@ -148,13 +146,6 @@ export function ControlBar({ hasValidationErrors = false }: ControlBarProps) {
148146 }
149147 } , [ setActiveTab , isOpen , togglePanel ] )
150148
151- const openDebugPanel = useCallback ( ( ) => {
152- setActiveTab ( 'debug' )
153- if ( ! isOpen ) {
154- togglePanel ( )
155- }
156- } , [ setActiveTab , isOpen , togglePanel ] )
157-
158149 // Shared condition for keyboard shortcut and button disabled state
159150 const isWorkflowBlocked = isExecuting || hasValidationErrors
160151
@@ -828,29 +819,15 @@ export function ControlBar({ hasValidationErrors = false }: ControlBarProps) {
828819 return // Do nothing if no executable blocks
829820 }
830821
831- // Determine starter id for focus
832- const starter = Object . values ( blocks ) . find ( ( b ) => b . type === 'starter' ) as any
833- const starterId = starter ?. id as string | undefined
834-
835- // Enable debug UI but do NOT start execution
822+ // Start debugging
836823 if ( ! isDebugModeEnabled ) {
837824 toggleDebugMode ( )
838825 }
839826 if ( usageExceeded ) {
840827 openSubscriptionSettings ( )
841828 } else {
842- // Activate debug session state so the panel is active
843- const execStore = useExecutionStore . getState ( )
844- execStore . setIsExecuting ( false )
845- execStore . setIsDebugging ( true )
846- // Set the Start block as pending - it will execute on first Step
847- execStore . setPendingBlocks ( starterId ? [ starterId ] : [ ] )
848-
849- // Show Debug tab and mark starter as the current block to execute
850- openDebugPanel ( )
851- if ( starterId ) {
852- execStore . setActiveBlocks ( new Set ( [ starterId ] ) )
853- }
829+ openConsolePanel ( )
830+ handleRunWorkflow ( undefined , true ) // Start in debug mode
854831 }
855832 }
856833 } , [
@@ -861,7 +838,8 @@ export function ControlBar({ hasValidationErrors = false }: ControlBarProps) {
861838 blocks ,
862839 handleCancelDebug ,
863840 toggleDebugMode ,
864- openDebugPanel ,
841+ handleRunWorkflow ,
842+ openConsolePanel ,
865843 ] )
866844
867845 /**
@@ -881,7 +859,40 @@ export function ControlBar({ hasValidationErrors = false }: ControlBarProps) {
881859
882860 return (
883861 < div className = 'flex items-center gap-1' >
884- { /* Keep only cancel (X) here; step/resume moved to panel */ }
862+ < Tooltip >
863+ < TooltipTrigger asChild >
864+ < Button
865+ onClick = { ( ) => {
866+ openConsolePanel ( )
867+ handleStepDebug ( )
868+ } }
869+ className = { debugButtonClass }
870+ disabled = { isControlDisabled }
871+ >
872+ < StepForward className = 'h-5 w-5' />
873+ < span className = 'sr-only' > Step Forward</ span >
874+ </ Button >
875+ </ TooltipTrigger >
876+ < TooltipContent > Step Forward</ TooltipContent >
877+ </ Tooltip >
878+
879+ < Tooltip >
880+ < TooltipTrigger asChild >
881+ < Button
882+ onClick = { ( ) => {
883+ openConsolePanel ( )
884+ handleResumeDebug ( )
885+ } }
886+ className = { debugButtonClass }
887+ disabled = { isControlDisabled }
888+ >
889+ < SkipForward className = 'h-5 w-5' />
890+ < span className = 'sr-only' > Resume Until End</ span >
891+ </ Button >
892+ </ TooltipTrigger >
893+ < TooltipContent > Resume Until End</ TooltipContent >
894+ </ Tooltip >
895+
885896 < Tooltip >
886897 < TooltipTrigger asChild >
887898 < Button
@@ -1203,7 +1214,7 @@ export function ControlBar({ hasValidationErrors = false }: ControlBarProps) {
12031214 { isExpanded && renderPublishButton ( ) }
12041215 { renderDeleteButton ( ) }
12051216 { renderDuplicateButton ( ) }
1206- { renderDebugModeToggle ( ) }
1217+ { ! isDebugging && renderDebugModeToggle ( ) }
12071218 { renderDeployButton ( ) }
12081219 { isDebugging ? renderDebugControlsBar ( ) : renderRunButton ( ) }
12091220
@@ -1215,8 +1226,6 @@ export function ControlBar({ hasValidationErrors = false }: ControlBarProps) {
12151226 workflowId = { activeWorkflowId }
12161227 />
12171228 ) }
1218-
1219- { /* Removed chat prompt dialog; chat input now lives in DebugPanel */ }
12201229 </ div >
12211230 )
12221231}
0 commit comments