Skip to content

Circuit-Editor Multi-Target Gate Support - #3426

Draft
Scott Carda (ScottCarda-MS) wants to merge 3 commits into
mainfrom
sccarda/ce-multitarget
Draft

Circuit-Editor Multi-Target Gate Support#3426
Scott Carda (ScottCarda-MS) wants to merge 3 commits into
mainfrom
sccarda/ce-multitarget

Conversation

@ScottCarda-MS

@ScottCarda-MS Scott Carda (ScottCarda-MS) commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Circuit Editor: multi-target / group drag-editing

Adds drag-editing for multi-wire gates in the circuit-vis circuit editor:
move multi-target gates and groups as rigid units, clone them as a unit
(Ctrl-drag), and extend a group onto new wires (Shift-drag). Purely additive on
top of the existing single-target editing paths.

What's new

  • Rigid unit-move. Dragging a multi-target gate or group shifts the gate's
    own registers and every register in its child grid by the same delta, so the
    box and its contents stay aligned. Classical controls anchor correctly
    (external measurement refs stay put, internal ones move with the subtree), and
    a shift that would push any wire below 0 is refused without mutating the model.
  • Clone-as-unit (Ctrl-drag). Leaves the source in place and drops a full
    copy at the target, using the same child-register remap as a unit-move.
  • Shift-to-extend (Shift-drag). Dragging a child out of an expanded group
    offers dropzones on wires outside the group's span and paints a ghost border
    showing the extended bounds, growing the group onto new wires.

Changes

Area File What it adds
Source actions/circuit-actions/move.ts moveAsUnit, shiftAllRegisters, subtree wire-swap helpers, and the unit-shift branch of moveY.
Source actions/circuitActions.ts Unit-shift wire-growth/bounds in moveOperation; clone-as-unit + sourceWire param in addOperation.
Source editor/controllers/dragController.ts Shift-extend lifecycle (setup / spawn dropzones / paint ghost / tear down) and the multi-leg dropzone loop.
Source editor/draggable.ts makeShiftExtendGhost geometry helper.
Docs ux/circuit-vis/README.md Documents the transient single-gesture shift-extend state on DragController.
Tests 4 files under test/circuit-editor/ 25 new tests (see below).

Testing

25 new circuit-editor tests, all passing: 7 clone-as-unit, 7 rigid unit-move /
bounds, 7 shift-extend lifecycle, 4 ghost-geometry.

# from source/npm/qsharp/
npm run build:ux
node --test "test/circuit-editor/**/*.test.mjs"

@ScottCarda-MS Scott Carda (ScottCarda-MS) changed the title multi-target gate support Circuit-Editor Multi-Target Gate Support Jul 8, 2026
Base automatically changed from sccarda/ce-foundation to main July 31, 2026 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant