ui(palette): move amp models into the routing row of the horizontal picker

The horizontal pedal-picker strip put all 26 amp models at the head of the
PEDALS row, stretching it into a very long horizontal scroll. Split the .amp
category out (ampGroup / effectGroups) and render it on the second row beside
the ROUTING cards, so the effects row stays short. Vertical catalog sheet
(the on-demand full list with a filter) is unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-08-03 17:50:03 -07:00
parent 0f6d69819d
commit 6cf698dbac
@@ -159,6 +159,18 @@ 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.
private var ampGroup: (category: PedalCategory, names: [String])? {
groupedVisiblePedals.first { $0.category == .amp }
}
/// Visible pedal groups excluding the amp models — everything the effects row shows.
private var effectGroups: [(category: PedalCategory, names: [String])] {
groupedVisiblePedals.filter { $0.category != .amp }
}
// MARK: - Body
public var body: some View {
@@ -191,8 +203,9 @@ public struct PedalPaletteView: View {
}
}
/// Horizontal scroller: a PEDALS row (leading filter + colour-coded cards) with the ROUTING
/// row stacked beneath it.
/// Horizontal scroller: a PEDALS row (leading filter + colour-coded effect cards) with a second
/// row that carries the amp models alongside the ROUTING cards. Amps live with routing rather
/// than at the head of the effects row so the effects row stays short.
private var horizontalBody: some View {
VStack(alignment: .leading, spacing: PedalPaletteView.sectionSpacing) {
HStack(alignment: .top, spacing: PedalPaletteView.sectionSpacing) {
@@ -200,7 +213,7 @@ public struct PedalPaletteView: View {
sectionTitle("PEDALS")
if showsFilterMenu { filterMenu }
}
ForEach(groupedVisiblePedals, id: \.category) { group in
ForEach(effectGroups, id: \.category) { group in
VStack(alignment: .leading, spacing: PedalPaletteView.rowSpacing) {
categoryLabel(group.category)
HStack(alignment: .top, spacing: PedalPaletteView.rowSpacing) {
@@ -211,10 +224,24 @@ public struct PedalPaletteView: View {
}
}
}
HStack(alignment: .top, spacing: PedalPaletteView.rowSpacing) {
sectionTitle("ROUTING")
ForEach(PedalPaletteView.routingOptions, id: \.title) { option in
routingCard(title: option.title, caption: option.caption, action: option.action)
HStack(alignment: .top, spacing: PedalPaletteView.sectionSpacing) {
if let amps: (category: PedalCategory, names: [String]) = ampGroup {
VStack(alignment: .leading, spacing: PedalPaletteView.rowSpacing) {
categoryLabel(amps.category)
HStack(alignment: .top, spacing: PedalPaletteView.rowSpacing) {
ForEach(amps.names, id: \.self) { name in
pedalRow(name)
}
}
}
}
VStack(alignment: .leading, spacing: PedalPaletteView.rowSpacing) {
sectionTitle("ROUTING")
HStack(alignment: .top, spacing: PedalPaletteView.rowSpacing) {
ForEach(PedalPaletteView.routingOptions, id: \.title) { option in
routingCard(title: option.title, caption: option.caption, action: option.action)
}
}
}
}
}