Boards sheet, ⌘1–9 switching, unified player bar, input persistence

Boards sheet (BoardsSheetView): rename, drag-reorder, swipe-delete, plus
per-board enable/solo/level and a Solo/Blend + crossfade header. Opened from a
"Boards…" button in the builder; presented with medium/large detents on iOS.
Makes ShoeGaze.moveBoard public to back the reorder.

Keyboard switching: hidden ⌘1…⌘9 buttons in the builder solo (live-switch to)
the matching board and select it as the edit target.

Unified player: ShoeGazeView drops its bespoke Active picker + crossfade field
and hosts the shared BoardBarView, matching the builder.

Input persistence: the builder saves the input choice (test loop vs live
channel) to UserDefaults and restores it on appear. With no saved choice it
defaults to live input when the mic is already authorised and an input channel
exists, else stays on the test loop. The iOS builder now opens one input
channel so live input is actually available there.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-23 17:38:43 -07:00
parent c25d783b71
commit 4627b3b800
5 changed files with 349 additions and 75 deletions
+4 -3
View File
@@ -385,14 +385,15 @@ public final class ShoeGaze {
/// Moves `board` to `targetIndex` within `boards`, locating it by identity.
///
/// This is an internal helper that mutates `boards` directly — valid only because
/// `ShoeGaze` is `@MainActor` (no concurrent access). The method is `internal` rather than
/// `public` so callers outside the ShoeGaze module cannot disrupt board ordering.
/// `ShoeGaze` is `@MainActor` (no concurrent access). Reordering only permutes the
/// `boards` array; it does not touch the engine graph, so it is safe to call while the
/// engine is running.
///
/// - Parameters:
/// - board: The `PedalBoard` to reposition. No-op if not found in `boards`.
/// - index: The desired destination index. Clamped to `boards.count` after removal
/// so it is always a valid insertion point.
internal func moveBoard(_ board: PedalBoard, to index: Int) {
public func moveBoard(_ board: PedalBoard, to index: Int) {
guard let sourceIndex: Int = boards.firstIndex(where: { $0 === board }) else { return }
let removed: PedalBoard = boards.remove(at: sourceIndex)
let destination: Int = min(index, boards.count)