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 <noreply@anthropic.com>
This commit is contained in:
2026-08-04 11:48:18 -07:00
parent da68864f36
commit 11ce3f47d2
@@ -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)