improvement(triggers): uuid, autolayout, copilot context (#1503)

* make trigger select uuid consistent with sidebar selection

* add trigger allowed flag for core triggers

* fix autolayout with new triggers
This commit is contained in:
Vikhyath Mondreti
2025-09-30 11:31:54 -07:00
committed by GitHub
parent 79461840c3
commit 17edf0405b
7 changed files with 12 additions and 2 deletions

View File

@@ -781,7 +781,7 @@ const WorkflowContent = React.memo(() => {
// Create the trigger block at the center of the viewport
const centerPosition = project({ x: window.innerWidth / 2, y: window.innerHeight / 2 })
const id = `${triggerId}_${Date.now()}`
const id = crypto.randomUUID()
// Add the trigger block with trigger mode if specified
addBlock(

View File

@@ -3,6 +3,7 @@ import type { BlockConfig } from '@/blocks/types'
export const ApiTriggerBlock: BlockConfig = {
type: 'api_trigger',
triggerAllowed: true,
name: 'API',
description: 'Expose as HTTP API endpoint',
longDescription:

View File

@@ -7,6 +7,7 @@ const ChatTriggerIcon = (props: SVGProps<SVGSVGElement>) => createElement(Messag
export const ChatTriggerBlock: BlockConfig = {
type: 'chat_trigger',
triggerAllowed: true,
name: 'Chat',
description: 'Start workflow from a chat deployment',
longDescription: 'Chat trigger to run the workflow via deployed chat interfaces.',

View File

@@ -7,6 +7,7 @@ const InputTriggerIcon = (props: SVGProps<SVGSVGElement>) => createElement(FormI
export const InputTriggerBlock: BlockConfig = {
type: 'input_trigger',
triggerAllowed: true,
name: 'Input Form',
description: 'Start workflow manually with a defined input schema',
longDescription:

View File

@@ -7,6 +7,7 @@ const ManualTriggerIcon = (props: SVGProps<SVGSVGElement>) => createElement(Play
export const ManualTriggerBlock: BlockConfig = {
type: 'manual_trigger',
triggerAllowed: true,
name: 'Manual',
description: 'Start workflow manually from the editor',
longDescription:

View File

@@ -7,6 +7,7 @@ const ScheduleIcon = (props: SVGProps<SVGSVGElement>) => createElement(Clock, pr
export const ScheduleBlock: BlockConfig = {
type: 'schedule',
triggerAllowed: true,
name: 'Schedule',
description: 'Trigger workflow execution on a schedule',
longDescription:

View File

@@ -1,3 +1,4 @@
import { TriggerUtils } from '@/lib/workflows/triggers'
import type { BlockState } from '@/stores/workflows/workflow/types'
import type { BlockDimensions, BoundingBox } from './types'
@@ -70,5 +71,9 @@ export function getBlocksByParent(blocks: Record<string, BlockState>): {
}
export function isStarterBlock(block: BlockState): boolean {
return block.type === 'starter' || block.type === 'webhook' || block.type === 'schedule'
if (TriggerUtils.isTriggerBlock({ type: block.type, triggerMode: block.triggerMode })) {
return true
}
return block.triggerMode === true
}