Flank bypass switch with Level and Mix for a symmetric pedal footer

Move the Mix knob out of the knob grid into the bottom control row, to the
right of the bypass footswitch, mirroring Level on the left. Every pedal
now shares a consistent knob-switch-knob footer. The knob grid drops the
trailing Mix and Level entries (was just Level).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-21 15:53:57 -07:00
parent 393fb47a78
commit b564b154a0
+20 -8
View File
@@ -278,13 +278,14 @@ public struct PedalView: View {
.clipShape(RoundedRectangle(cornerRadius: PedalView.namePlateCornerRadius))
}
/// Grid of the effect + `Mix` knobs, in rows of up to `knobColumnCount`.
/// Grid of the effect knobs, in rows of up to `knobColumnCount`.
///
/// The `Level` knob (the last entry of `pedal.knobs`) is dropped here and rendered in
/// the bottom control row next to the bypass switch, leaving more room for the effect
/// controls at the top.
/// The trailing `Mix` and `Level` knobs (the last two entries of `pedal.knobs`) are
/// dropped here and rendered in the bottom control row flanking the bypass switch —
/// `Level` on the left, `Mix` on the right — leaving more room for the effect controls
/// at the top and giving every pedal a symmetric footer.
private var knobGrid: some View {
let knobs: [PedalKnob] = Array(pedal.knobs.dropLast())
let knobs: [PedalKnob] = Array(pedal.knobs.dropLast(2))
let rows: [[PedalKnob]] = stride(
from: 0,
to: knobs.count,
@@ -327,17 +328,18 @@ public struct PedalView: View {
}
}
/// Bottom control row: the `Level` knob and the bypass switch side-by-side, centred
/// with equal padding below.
/// Bottom control row: the `Level` knob, the bypass switch, and the `Mix` knob,
/// side-by-side and centred — a symmetric knob-switch-knob footer shared by all pedals.
private var bottomControls: some View {
HStack(alignment: .center, spacing: PedalView.bottomControlsSpacing) {
levelControl
bypassControl
mixControl
}
.frame(maxWidth: .infinity)
}
/// The `Level` knob — the last entry of `pedal.knobs`.
/// The `Level` knob — the last entry of `pedal.knobs` — placed left of the bypass switch.
@ViewBuilder
private var levelControl: some View {
if let level: PedalKnob = pedal.knobs.last {
@@ -346,6 +348,16 @@ public struct PedalView: View {
}
}
/// The `Mix` knob — the second-to-last entry of `pedal.knobs` — placed right of the
/// bypass switch to mirror `Level`.
@ViewBuilder
private var mixControl: some View {
if let mix: PedalKnob = pedal.knobs.dropLast().last {
ParameterKnob(mix.label, node: mix.node, range: mix.range)
.foregroundStyle(Color.white)
}
}
/// LED + footswitch bypass control, paired beside the Level knob.
private var bypassControl: some View {
// Reading `pedal.$bypass.value` here registers this view for automatic