feat: update workflow run button to Test Run with keyboard shortcut (#24071)

This commit is contained in:
lyzno1
2025-08-18 10:44:17 +08:00
committed by GitHub
parent 74ad21b145
commit e9c7dc7464
22 changed files with 28 additions and 21 deletions

View File

@ -22,6 +22,7 @@ import {
import { useEventEmitterContextContext } from '@/context/event-emitter'
import { EVENT_WORKFLOW_STOP } from '@/app/components/workflow/variable-inspect/types'
import useTheme from '@/hooks/use-theme'
import ShortcutsName from '../shortcuts-name'
const RunMode = memo(() => {
const { t } = useTranslation()
@ -64,6 +65,7 @@ const RunMode = memo(() => {
<>
<RiPlayLargeLine className='mr-1 h-4 w-4' />
{t('workflow.common.run')}
<ShortcutsName keys={['alt', 'r']} className="ml-1" textColor="secondary" />
</>
)
}

View File

@ -5,10 +5,12 @@ import cn from '@/utils/classnames'
type ShortcutsNameProps = {
keys: string[]
className?: string
textColor?: 'default' | 'secondary'
}
const ShortcutsName = ({
keys,
className,
textColor = 'default',
}: ShortcutsNameProps) => {
return (
<div className={cn(
@ -19,7 +21,10 @@ const ShortcutsName = ({
keys.map(key => (
<div
key={key}
className='system-kbd flex h-4 min-w-4 items-center justify-center rounded-[4px] bg-components-kbd-bg-gray capitalize'
className={cn(
'system-kbd flex h-4 min-w-4 items-center justify-center rounded-[4px] bg-components-kbd-bg-gray capitalize',
textColor === 'secondary' && 'text-text-secondary',
)}
>
{getKeyboardKeyNameBySystem(key)}
</div>