Circuit-Editor Multi-Target Gate Support - #3426
Draft
Scott Carda (ScottCarda-MS) wants to merge 5 commits into
Draft
Circuit-Editor Multi-Target Gate Support#3426Scott Carda (ScottCarda-MS) wants to merge 5 commits into
Scott Carda (ScottCarda-MS) wants to merge 5 commits into
Conversation
Scott Carda (ScottCarda-MS)
force-pushed
the
sccarda/ce-multitarget
branch
from
August 4, 2026 17:06
120c492 to
4701cb1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Circuit Editor: multi-target / group drag-editing
Adds drag-editing for multi-wire gates in the
circuit-viscircuit 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. Also tightens the shift-extend
ghost/dropzone geometry so the previews line up with the group box in the
tricky cases (classical controls, long labels).
What's new
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.
copy at the target, using the same child-register remap as a unit-move.
offers dropzones on wires outside the group's span and paints a ghost border
showing the extended bounds, growing the group onto new wires.
group" test are driven off the group box's rendered pixel bounds instead of
the quantum-target range, so a classically-controlled group (whose box reaches
down to the producing measurement's classical wire) extends from the right
edge and offers dropzones on the correct wires.
wider than its child columns; that extra width is owned by the box, not any
column. The layout pass now publishes each group's box right edge through the
LayoutMap, and the editor stretches the group's trailing "extend-sideways"dropzone (both the always-on and shift-extend variants) to cover that slack —
no more dead gutter on the right of a wide-labeled group.
Changes
actions/circuit-actions/move.tsmoveAsUnit,shiftAllRegisters, subtree wire-swap helpers, and the unit-shift branch ofmoveY.actions/circuitActions.tsmoveOperation; clone-as-unit +sourceWireparam inaddOperation.editor/controllers/dragController.tseditor/draggable.tsmakeShiftExtendGhostgeometry helper (clones the rendered box, slides one edge) andtrailingBandRightX/bandRightXlabel-slack stretching.editor/domUtils.tsgetGroupBoxElem— recovers a group's rendered box<rect>so the ghost and inside-group test can read its pixel bounds.renderer/process.tsLayoutMapentry.renderer/layoutMap.tsLayoutScope.boxRightX— the enclosing group box's right edge, source of truth for label-slack stretching.ux/circuit-vis/README.mdDragControllerand the ghost box as the one sanctioned exception to "LayoutMap is the single source of geometry."test/circuit-editor/Testing
30 new circuit-editor tests, all passing: 7 clone-as-unit, 7 rigid unit-move /
bounds, 8 shift-extend lifecycle, 7 dropzone/ghost geometry (shift-extend ghost
edges + label-slack band stretch/overhang), and 1 shift-extend end-to-end
dropzone case.