Skip to content

[BUG] The macro builder and the conditional branch editor share a drop zone type, with no cross-zone guard #1613

Description

@chhoumann

Noticed while fixing #1593. Code shape confirmed; I have not driven the drag live, so treat the exploitability as unproven.

MacroBuilder.configureConditionalBranch (MacroBuilder.ts:186-193) opens ConditionalBranchEditorModal over the still-open macro builder. Both modals mount a CommandList, and both register their drop zone with the same svelte-dnd-action type:

CommandList.svelte -> baseDndOptions({ items, dragDisabled, type: "command", ... })

baseDndOptions (dndReorder.ts:60-79) never sets dropFromOthersDisabled, so two zones of the same type are mutually valid drop targets. CommandList also has no TRIGGERS.DROPPED_INTO_ANOTHER strip - compare ChoiceList.svelte:107-109, which added exactly that for the choice list because committing the source list verbatim after a cross-zone drop persists a COPY in both zones. CommandList.svelte does not even import TRIGGERS.

Expected failure modes, if the drag is reachable

Suggested shape

Either set dropFromOthersDisabled: true for command zones (they are never a legitimate cross-zone target - unlike folders, a command has no "move into" gesture), or mirror ChoiceList's DROPPED_INTO_ANOTHER strip. The former looks correct here.

Reproducing it needs a macro with a Conditional, the branch editor open on top, and a pointer drag between the two lists - worth doing before fixing, to confirm the modal stacking actually allows it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions