feat: add workflow selection preservation logic and related tests

This commit is contained in:
mlogclub
2026-06-30 12:31:08 +08:00
parent d72079a580
commit 79f0c06790
6 changed files with 40 additions and 2 deletions
@@ -131,6 +131,14 @@ export function isBranchRowActionTarget(target: EventTarget | null): boolean {
return typeof maybeElement?.closest === "function" && maybeElement.closest("button") !== null
}
export function shouldClearWorkflowSelectionOnPointerDown(target: EventTarget | null): boolean {
const maybeElement = target as { closest?: (selector: string) => Element | null } | null
if (typeof maybeElement?.closest !== "function") {
return false
}
return maybeElement.closest("[data-workflow-preserve-selection]") === null
}
export function getNodeTitle(
node: AIWorkflowDefinition["nodes"][number] | undefined,
specs: AIWorkflowNodeSpec[] = []