fix(ui): harden horizontal switch row layout

Switches now lay out side by side (HStack). Polish so it degrades cleanly:
- PedalSwitchView caption: lineLimit(1) — no wrap → no height jitter between
  switches sharing a row.
- switchRow: .top alignment so segment bars stay level; doc updated (no longer
  "one per row").
- MutantPedal: widthUnits 2 so its Sweep (2-way) + Mode (3-way) switches sit
  side by side without cramping in a single-width card.

UI-only; no audio/state changes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-08-03 09:07:22 -07:00
parent 29b1747533
commit 17a0845225
3 changed files with 9 additions and 3 deletions
+4 -3
View File
@@ -791,13 +791,14 @@ public struct PedalView: View {
}
}
/// Row of segmented switches drawn from `pedal.effectSwitches`, one per row, beneath
/// the knob grid. Renders nothing when the pedal publishes no switches.
/// Row of segmented switches drawn from `pedal.effectSwitches`, laid out side by side beneath
/// the knob grid. Renders nothing when the pedal publishes no switches. `.top` alignment keeps
/// the segment bars level even if one switch's caption wraps differently.
@ViewBuilder
private var switchRow: some View {
let switches: [PedalSwitch] = pedal.effectSwitches
if !switches.isEmpty {
HStack(spacing: PedalView.knobSpacing) {
HStack(alignment: .top, spacing: PedalView.knobSpacing) {
ForEach(Array(switches.enumerated()), id: \.offset) { pair in
PedalSwitchView(pair.element)
}