Drag effect slots to reorder the chain #10

Merged
erdoar merged 1 commit from claude/reorder-effects into main 2026-10-10 02:56:41 +00:00
erdoar commented 2026-10-10 02:48:25 +00:00 (Migrated from github.com)

Stacked on erdoar/plug#9 (remember settings). This PR's base is that branch, so the diff shows only the reorder change. Merge #9 first.

Summary

  • PluginChain.move(fromOffsets:toOffset:) follows SwiftUI's onMove convention, so moving several slots keeps their order.
  • The slot list gets onMove: drag a row to reorder. The engine rewires the effects in the new order and settings are saved.

Tested

  • Linux, Swift 6.0.3: 20 tests pass. That includes new move tests for up, down, several slots, and no-op or out-of-range moves. The app files pass a syntax-only parse.

To test on the Mac

  1. Quit Plug, then run swift test.
  2. Run scripts/bundle.sh --open, add two or three effects, and drag a row to a new position. The list should reorder and the sound should follow the new order. With AUDelay before or after a distortion or filter, the difference is audible.
  3. Quit and reopen Plug. The new order should be kept.

🤖 Generated with Claude Code

https://claude.ai/code/session_011C96TJ2L7nzVMFTH7raNu5


Generated by Claude Code

Stacked on erdoar/plug#9 (remember settings). This PR's base is that branch, so the diff shows only the reorder change. Merge #9 first. ## Summary - `PluginChain.move(fromOffsets:toOffset:)` follows SwiftUI's `onMove` convention, so moving several slots keeps their order. - The slot list gets `onMove`: drag a row to reorder. The engine rewires the effects in the new order and settings are saved. ## Tested - Linux, Swift 6.0.3: 20 tests pass. That includes new move tests for up, down, several slots, and no-op or out-of-range moves. The app files pass a syntax-only parse. ## To test on the Mac 1. Quit Plug, then run `swift test`. 2. Run `scripts/bundle.sh --open`, add two or three effects, and drag a row to a new position. The list should reorder and the sound should follow the new order. With AUDelay before or after a distortion or filter, the difference is audible. 3. Quit and reopen Plug. The new order should be kept. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_011C96TJ2L7nzVMFTH7raNu5 --- _Generated by [Claude Code](https://claude.ai/code/session_011C96TJ2L7nzVMFTH7raNu5)_
Sign in to join this conversation.
No description provided.