Add-Pedal sheet: scrollable list, fixed header with type filter, stable size

The sheet couldn't scroll — PedalPaletteView doesn't self-wrap in a ScrollView
(the host must) and the sheet had none, so the list overflowed and drags just
resized the detent. Rework:

- Wrap the palette in a ScrollView; single fixed detent (fraction 0.82) so the
  sheet no longer resizes, and presentationContentInteraction(.scrolls) so drags
  scroll the list.
- Fixed header with the "Add Pedal" title, the type-filter menu, and Done —
  PedalPaletteView gains an external filter binding + showsFilterMenu flag so the
  filter can be hoisted out of the scrolling content.
- PedalCategory made public (+ Sendable) so the filter binding can cross the
  public palette init.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-04 17:21:49 -07:00
parent f97ba90ea6
commit 19feb03fe8
3 changed files with 83 additions and 27 deletions
@@ -9,7 +9,7 @@ import SwiftUI
/// A presentation grouping for pedals in the palette — used to colour-code the picker cards and to
/// drive the "filter by type" menu. Purely a UI concern: the mapping from a pedal's `displayName`
/// to its category lives here, keyed by name like ``PedalPaletteView``'s preferred order.
enum PedalCategory: String, CaseIterable, Identifiable {
public enum PedalCategory: String, CaseIterable, Identifiable, Sendable {
case gain = "Gain"
case dynamics = "Dynamics"
case filter = "EQ & Filter"
@@ -19,7 +19,7 @@ enum PedalCategory: String, CaseIterable, Identifiable {
case reverb = "Reverb"
case texture = "Texture"
var id: String { rawValue }
public var id: String { rawValue }
/// Accent colour used to tint the palette card and the filter chip.
var color: Color {