@@ -44,6 +44,7 @@ import { useGeneralStore } from '@/stores/settings/general/store'
4444import { useWorkflowRegistry } from '@/stores/workflows/registry/store'
4545import { useSubBlockStore } from '@/stores/workflows/subblock/store'
4646import { useWorkflowStore } from '@/stores/workflows/workflow/store'
47+ import { getKeyboardShortcutText , useKeyboardShortcuts } from '../../hooks/use-keyboard-shortcuts'
4748import { useWorkflowExecution } from '../../hooks/use-workflow-execution'
4849import { DeploymentControls } from './components/deployment-controls/deployment-controls'
4950import { HistoryDropdownItem } from './components/history-dropdown-item/history-dropdown-item'
@@ -108,6 +109,20 @@ export function ControlBar() {
108109 const [ isCancelling , setIsCancelling ] = useState ( false )
109110 const cancelFlagRef = useRef ( false )
110111
112+ // Register keyboard shortcut for running workflow
113+ useKeyboardShortcuts (
114+ ( ) => {
115+ if ( ! isExecuting && ! isMultiRunning && ! isCancelling ) {
116+ if ( isDebugModeEnabled ) {
117+ handleRunWorkflow ( )
118+ } else {
119+ handleMultipleRuns ( )
120+ }
121+ }
122+ } ,
123+ isExecuting || isMultiRunning || isCancelling
124+ )
125+
111126 // Get notifications for current workflow
112127 const workflowNotifications = activeWorkflowId
113128 ? getWorkflowNotifications ( activeWorkflowId )
@@ -820,44 +835,58 @@ export function ControlBar() {
820835
821836 < div className = "flex ml-1" >
822837 { /* Main Run/Debug Button */ }
823- < Button
824- className = { cn (
825- 'gap-2 font-medium' ,
826- 'bg-[#802FFF] hover:bg-[#7028E6]' ,
827- 'shadow-[0_0_0_0_#802FFF] hover:shadow-[0_0_0_4px_rgba(127,47,255,0.15)]' ,
828- 'text-white transition-all duration-200' ,
829- ( isExecuting || isMultiRunning ) &&
830- ! isCancelling &&
831- 'relative after:absolute after:inset-0 after:animate-pulse after:bg-white/20' ,
832- 'disabled:opacity-50 disabled:hover:bg-[#802FFF] disabled:hover:shadow-none' ,
833- isDebugModeEnabled || isMultiRunning
834- ? 'rounded py-2 px-4 h-10'
835- : 'rounded-r-none border-r border-r-[#6420cc] py-2 px-4 h-10'
836- ) }
837- onClick = { isDebugModeEnabled ? handleRunWorkflow : handleMultipleRuns }
838- disabled = { isExecuting || isMultiRunning || isCancelling }
839- >
840- { isCancelling ? (
841- < Loader2 className = "h-3.5 w-3.5 animate-spin mr-1.5" />
842- ) : isDebugModeEnabled ? (
843- < Bug className = { cn ( 'h-3.5 w-3.5 mr-1.5' , 'fill-current stroke-current' ) } />
844- ) : (
845- < Play className = { cn ( 'h-3.5 w-3.5' , 'fill-current stroke-current' ) } />
846- ) }
847- { isCancelling
848- ? 'Cancelling...'
849- : isMultiRunning
850- ? `Running (${ completedRuns } /${ runCount } )`
851- : isExecuting
852- ? isDebugging
853- ? 'Debugging'
854- : 'Running'
855- : isDebugModeEnabled
856- ? 'Debug'
857- : runCount === 1
858- ? 'Run'
859- : `Run (${ runCount } )` }
860- </ Button >
838+ < Tooltip >
839+ < TooltipTrigger asChild >
840+ < Button
841+ className = { cn (
842+ 'gap-2 font-medium' ,
843+ 'bg-[#802FFF] hover:bg-[#7028E6]' ,
844+ 'shadow-[0_0_0_0_#802FFF] hover:shadow-[0_0_0_4px_rgba(127,47,255,0.15)]' ,
845+ 'text-white transition-all duration-200' ,
846+ ( isExecuting || isMultiRunning ) &&
847+ ! isCancelling &&
848+ 'relative after:absolute after:inset-0 after:animate-pulse after:bg-white/20' ,
849+ 'disabled:opacity-50 disabled:hover:bg-[#802FFF] disabled:hover:shadow-none' ,
850+ isDebugModeEnabled || isMultiRunning
851+ ? 'rounded py-2 px-4 h-10'
852+ : 'rounded-r-none border-r border-r-[#6420cc] py-2 px-4 h-10'
853+ ) }
854+ onClick = { isDebugModeEnabled ? handleRunWorkflow : handleMultipleRuns }
855+ disabled = { isExecuting || isMultiRunning || isCancelling }
856+ >
857+ { isCancelling ? (
858+ < Loader2 className = "h-3.5 w-3.5 animate-spin mr-1.5" />
859+ ) : isDebugModeEnabled ? (
860+ < Bug className = { cn ( 'h-3.5 w-3.5 mr-1.5' , 'fill-current stroke-current' ) } />
861+ ) : (
862+ < Play className = { cn ( 'h-3.5 w-3.5' , 'fill-current stroke-current' ) } />
863+ ) }
864+ { isCancelling
865+ ? 'Cancelling...'
866+ : isMultiRunning
867+ ? `Running (${ completedRuns } /${ runCount } )`
868+ : isExecuting
869+ ? isDebugging
870+ ? 'Debugging'
871+ : 'Running'
872+ : isDebugModeEnabled
873+ ? 'Debug'
874+ : runCount === 1
875+ ? 'Run'
876+ : `Run (${ runCount } )` }
877+ </ Button >
878+ </ TooltipTrigger >
879+ < TooltipContent >
880+ { isDebugModeEnabled
881+ ? 'Debug Workflow'
882+ : runCount === 1
883+ ? 'Run Workflow'
884+ : `Run Workflow ${ runCount } times` }
885+ < span className = "text-xs text-muted-foreground ml-1" >
886+ { getKeyboardShortcutText ( 'Enter' , true ) }
887+ </ span >
888+ </ TooltipContent >
889+ </ Tooltip >
861890
862891 { /* Dropdown Trigger - Only show when not in debug mode and not multi-running */ }
863892 { ! isDebugModeEnabled && ! isMultiRunning && (
0 commit comments