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:
@@ -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
|
// MARK: - Body
|
||||||
|
|
||||||
public var body: some View {
|
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
|
/// Horizontal scroller: a PEDALS row (leading filter + colour-coded effect cards) with a second
|
||||||
/// row stacked beneath it.
|
/// 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 {
|
private var horizontalBody: some View {
|
||||||
VStack(alignment: .leading, spacing: PedalPaletteView.sectionSpacing) {
|
VStack(alignment: .leading, spacing: PedalPaletteView.sectionSpacing) {
|
||||||
HStack(alignment: .top, spacing: PedalPaletteView.sectionSpacing) {
|
HStack(alignment: .top, spacing: PedalPaletteView.sectionSpacing) {
|
||||||
@@ -200,7 +213,7 @@ public struct PedalPaletteView: View {
|
|||||||
sectionTitle("PEDALS")
|
sectionTitle("PEDALS")
|
||||||
if showsFilterMenu { filterMenu }
|
if showsFilterMenu { filterMenu }
|
||||||
}
|
}
|
||||||
ForEach(groupedVisiblePedals, id: \.category) { group in
|
ForEach(effectGroups, id: \.category) { group in
|
||||||
VStack(alignment: .leading, spacing: PedalPaletteView.rowSpacing) {
|
VStack(alignment: .leading, spacing: PedalPaletteView.rowSpacing) {
|
||||||
categoryLabel(group.category)
|
categoryLabel(group.category)
|
||||||
HStack(alignment: .top, spacing: PedalPaletteView.rowSpacing) {
|
HStack(alignment: .top, spacing: PedalPaletteView.rowSpacing) {
|
||||||
@@ -211,14 +224,28 @@ public struct PedalPaletteView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
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) {
|
HStack(alignment: .top, spacing: PedalPaletteView.rowSpacing) {
|
||||||
|
ForEach(amps.names, id: \.self) { name in
|
||||||
|
pedalRow(name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
VStack(alignment: .leading, spacing: PedalPaletteView.rowSpacing) {
|
||||||
sectionTitle("ROUTING")
|
sectionTitle("ROUTING")
|
||||||
|
HStack(alignment: .top, spacing: PedalPaletteView.rowSpacing) {
|
||||||
ForEach(PedalPaletteView.routingOptions, id: \.title) { option in
|
ForEach(PedalPaletteView.routingOptions, id: \.title) { option in
|
||||||
routingCard(title: option.title, caption: option.caption, action: option.action)
|
routingCard(title: option.title, caption: option.caption, action: option.action)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// MARK: - Subviews
|
// MARK: - Subviews
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user