From 11ce3f47d202715a6892a2fc1820264b8c08667c Mon Sep 17 00:00:00 2001 From: Joshua Parmenter Date: Tue, 4 Aug 2026 11:48:18 -0700 Subject: [PATCH] ui(palette): move Cabinet to row 2 between Routing and Amp Model The Cabinet got its own category (row 1, effects) in the last change; move it to the second row so the rig-structure blocks read left-to-right as Routing | Cabinet | Amp Model. Split a cabinetGroup out of effectGroups and render it between the Routing cards and the amp group in the horizontal picker. Co-Authored-By: Claude Opus 4.8 --- .../LyrebirdShoeGazeUI/PedalPaletteView.swift | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/Sources/LyrebirdShoeGazeUI/PedalPaletteView.swift b/Sources/LyrebirdShoeGazeUI/PedalPaletteView.swift index 9a71d8b..2cb16db 100644 --- a/Sources/LyrebirdShoeGazeUI/PedalPaletteView.swift +++ b/Sources/LyrebirdShoeGazeUI/PedalPaletteView.swift @@ -160,15 +160,21 @@ public struct PedalPaletteView: View { } /// The `.amp` bucket on its own, or `nil` when no amp models are visible. Split out so the - /// horizontal picker can drop the (large) amp list into the ROUTING row instead of letting it - /// stretch the head of the effects row. + /// horizontal picker can drop the (large) amp list into the second row (with Routing and the + /// Cabinet) instead of letting it stretch the head of the effects row. private var ampGroup: (category: PedalCategory, names: [String])? { groupedVisiblePedals.first { $0.category == .amp } } - /// Visible pedal groups excluding the amp models — everything the effects row shows. + /// The `.cabinet` bucket on its own, or `nil` when no cabinet is visible. Sits on the second row + /// between Routing and the amp models (rig-structure controls grouped together). + private var cabinetGroup: (category: PedalCategory, names: [String])? { + groupedVisiblePedals.first { $0.category == .cabinet } + } + + /// Visible pedal groups excluding the amp models and the cabinet — the actual effects row (row 1). private var effectGroups: [(category: PedalCategory, names: [String])] { - groupedVisiblePedals.filter { $0.category != .amp } + groupedVisiblePedals.filter { $0.category != .amp && $0.category != .cabinet } } // MARK: - Body @@ -232,6 +238,16 @@ public struct PedalPaletteView: View { } } } + if let cabinet: (category: PedalCategory, names: [String]) = cabinetGroup { + VStack(alignment: .leading, spacing: PedalPaletteView.rowSpacing) { + categoryLabel(cabinet.category) + HStack(alignment: .top, spacing: PedalPaletteView.rowSpacing) { + ForEach(cabinet.names, id: \.self) { name in + pedalRow(name) + } + } + } + } if let amps: (category: PedalCategory, names: [String]) = ampGroup { VStack(alignment: .leading, spacing: PedalPaletteView.rowSpacing) { categoryLabel(amps.category)