feat: implement isBranchRowActionTarget function and add tests for branch row interaction

This commit is contained in:
mlogclub
2026-06-30 11:39:01 +08:00
parent fb612eb32e
commit d72079a580
3 changed files with 26 additions and 0 deletions
@@ -126,6 +126,11 @@ export function buildVariableSpecDisplay(variable: WorkflowVariableSpec): Workfl
}
}
export function isBranchRowActionTarget(target: EventTarget | null): boolean {
const maybeElement = target as { closest?: (selector: string) => Element | null } | null
return typeof maybeElement?.closest === "function" && maybeElement.closest("button") !== null
}
export function getNodeTitle(
node: AIWorkflowDefinition["nodes"][number] | undefined,
specs: AIWorkflowNodeSpec[] = []