Skip to content

Visualizer: moving a model to the front of its chain keeps the next model - #7269

Merged
dkulp merged 1 commit into
xLightsSequencer:masterfrom
heffneil:fix/visualizer-move-to-front-chain
Oct 23, 2026
Merged

dkulp merged 1 commit into
xLightsSequencer:masterfrom
heffneil:fix/visualizer-move-to-front-chain

Conversation

@heffneil

Copy link
Copy Markdown
Contributor

Summary

In the controller visualizer, moving the middle model of a chain to the front knocked the model after it out of its place on the port.

Repro: a pixel port chained EFL-Bat -> GE_Spinner_32_2 -> Spider. Drag GE_Spinner_32_2 onto the left side of EFL-Bat. Expected GE_Spinner_32_2 -> EFL-Bat -> Spider. Instead the Spider dropped out of its position, and the work log reported "Model chain is broken so just stuffing the remaining 1 models in in their original order."

Cause: in DropFromController's dropped-on-a-model branch, the "model did not actually move" test was

(nextfrom == droppedOn && hit == LEFT) || (">" + droppedOn->GetName() == m->GetModelChain())

The second half is true whenever m already follows droppedOn, whatever side it was dropped on. For a right-hand drop that is indeed no move. For a left-hand drop it is a swap, but the test skipped re-linking m's follower, so Spider kept >GE_Spinner_32_2 while EFL-Bat was also set to >GE_Spinner_32_2. With two models chained to the same model the port's chain broke.

Fix: the "already follows droppedOn" case only counts as "not moved" for a right-hand drop.

iPad parity

State A. The iPad's assignModelToController (XLSequenceDocument.mm) never re-linked the model that followed the moved model in its old chain at all. Moving a model within a port could leave a stale or circular chain. It now re-chains that follower to what the moved model followed, and handles the moved model's own follower being the insertion point. The note is on row 31 in plans/platform-parity/07-controllers-setup-upload.md.

Testing

  • macOS desktop Debug build and xLights-iPadLib build succeed.
  • Manually tested the repro above on a real layout: the following model now stays on the port in the right order.

🤖 Generated with Claude Code

…odel

Dropping a model on the left of the model it already follows (moving the
middle model of A -> B -> C to the front) was treated as "not moved", so C
stayed chained to B while A was re-chained to B too; the chain broke and C
fell out of its place on the port. Only a right-hand drop onto the model it
already follows is a no-op. The iPad's assignModelToController never
re-linked the model that followed the moved one; it now does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dkulp
dkulp merged commit 40df3e0 into xLightsSequencer:master Oct 23, 2026
3 checks passed
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.

2 participants