refactor(ui): make widthUnits mean "base width in columns" + tidy overrides
Follow-up cleanup now that card width is content-derived. Redefine widthUnits as the card's base width in knob columns (1 = 3-wide, 2 = 4-wide) — both the knob-grid column count and the card's minimum width — with selector/switch rows able to push wider. Values above 2 no longer do anything. - Delete the now-misleading widthUnits 3/4 overrides on 11 amps; they inherit AmpVoicePedal's 2 (all full-surface amps → the same tight 4-wide card). - Remove Mutant's redundant override (2 knobs + 2 switches → 3-wide either way). - Cabinet: keep widthUnits 2 so it's 4-wide like the amps — its Cab/Mic/Mic B selector captions (voice names) need the room to stay readable (per request). - Looper keeps widthUnits 3 (the one pedal still using the flat multiple for its bespoke timeline/knobs/transport layout). - Refresh the widthUnits docs (base + AmpVoicePedal + Cabinet); update the amp tests' widthUnits assertions (3/4 → 2; Looper stays 3). 675 tests pass; no visual change to the amps, Cabinet now matches their width. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -316,7 +316,8 @@ open class AmpVoicePedal: Pedal {
|
||||
/// The amp is fully wet (it replaces the dry signal); hide the Mix control.
|
||||
public override var showsMixControl: Bool { false }
|
||||
|
||||
/// Amp-head-style double-width card.
|
||||
/// Amps use a four-wide knob grid for their Gain/Bass/Mid/Treble + signature controls (the card
|
||||
/// width is sized to content — see `PedalView.enclosureWidth`).
|
||||
public override var widthUnits: Int { 2 }
|
||||
|
||||
public override var summary: String { summaryText }
|
||||
|
||||
@@ -75,9 +75,6 @@ public final class AnaheimAmpPedal: AmpVoicePedal {
|
||||
]
|
||||
}
|
||||
|
||||
/// Wider card for the three switches.
|
||||
public override var widthUnits: Int { 3 }
|
||||
|
||||
/// Creates an Anaheim amp.
|
||||
///
|
||||
/// - Parameters:
|
||||
|
||||
@@ -70,9 +70,6 @@ open class BoutiqueAmpPedal: AmpVoicePedal {
|
||||
}
|
||||
public override var powerAmpOversample: Int { 4 }
|
||||
|
||||
/// Wider card for the Presence/Depth/Master/Drive knobs plus the Channel switch.
|
||||
public override var widthUnits: Int { 4 }
|
||||
|
||||
/// Clean preamp, plus a cascaded lead stage on the Lead channel. `channel` is read at
|
||||
/// board-build time (the switch is `rebuildsOnChange`), so only the selected channel is built.
|
||||
public override func preampStage(_ signal: any ValidGeneratorInput) -> any ValidGeneratorInput {
|
||||
|
||||
@@ -36,9 +36,6 @@ public final class BritishBluesbreakerAmpPedal: BritishComboAmpPedal {
|
||||
]
|
||||
}
|
||||
|
||||
/// Wider card for the extra tremolo knobs plus the Bright and Tremolo switches.
|
||||
public override var widthUnits: Int { 3 }
|
||||
|
||||
/// The base Bright switch plus a Tremolo footswitch (compose `super` so Bright stays in sync).
|
||||
public override var effectSwitches: [PedalSwitch] {
|
||||
super.effectSwitches + [
|
||||
|
||||
@@ -63,9 +63,6 @@ public final class BritishDualAmpPedal: BritishComboAmpPedal {
|
||||
}
|
||||
public override var powerAmpOversample: Int { 4 }
|
||||
|
||||
/// Wider card for the extra Master/Drive/Reverb knobs plus the Bright and Channel switches.
|
||||
public override var widthUnits: Int { 4 }
|
||||
|
||||
/// Creates a British Dual amp.
|
||||
///
|
||||
/// - Parameters:
|
||||
|
||||
@@ -34,9 +34,6 @@ public final class BritishMasterAmpPedal: BritishComboAmpPedal {
|
||||
}
|
||||
public override var powerAmpOversample: Int { 4 }
|
||||
|
||||
/// Wider card for the Presence/Master knobs plus the Bright switch.
|
||||
public override var widthUnits: Int { 3 }
|
||||
|
||||
/// Creates a British Master amp.
|
||||
///
|
||||
/// - Parameters:
|
||||
|
||||
@@ -51,8 +51,8 @@ public final class CabinetPedal: Pedal {
|
||||
"Speaker-cabinet impulse-response convolution with selectable built-in voicings."
|
||||
}
|
||||
|
||||
/// Double-width card — three selectors (Cab / Mic / Mic B) need the room; at single width the
|
||||
/// dials crowd and the leading selector's caption clips.
|
||||
/// Four-wide card (same as the amps), so the Cab / Mic / Mic B selector captions — cabinet and
|
||||
/// mic voice names — stay readable rather than crowding.
|
||||
public override var widthUnits: Int { 2 }
|
||||
|
||||
// MARK: - Parameters
|
||||
|
||||
@@ -65,9 +65,6 @@ public final class ChimeTopBoostAmpPedal: AmpVoicePedal {
|
||||
]
|
||||
}
|
||||
|
||||
/// Wider card for the extra Cut/tremolo knobs plus the Brilliant and Tremolo switches.
|
||||
public override var widthUnits: Int { 3 }
|
||||
|
||||
// MARK: - Init
|
||||
|
||||
/// Creates a Chime Top Boost amp.
|
||||
|
||||
@@ -48,9 +48,6 @@ public final class FullertonDriveAmpPedal: AmpVoicePedal {
|
||||
]
|
||||
}
|
||||
|
||||
/// Wider card for the Reverb/Drive knobs plus the Bright and Channel switches.
|
||||
public override var widthUnits: Int { 3 }
|
||||
|
||||
public override var effectSwitches: [PedalSwitch] {
|
||||
[
|
||||
PedalSwitch(
|
||||
|
||||
@@ -68,9 +68,6 @@ open class FullertonReverbAmpPedal: AmpVoicePedal {
|
||||
]
|
||||
}
|
||||
|
||||
/// Wider card to hold the extra reverb/tremolo knobs plus the Bright switch.
|
||||
public override var widthUnits: Int { 3 }
|
||||
|
||||
// MARK: - Init
|
||||
|
||||
/// Creates a Fullerton Reverb amp.
|
||||
|
||||
@@ -82,9 +82,6 @@ public final class JazzCleanAmpPedal: AmpVoicePedal {
|
||||
/// Stereo output — the chorus feeds two independent power-amp/cabinet channels.
|
||||
public override var channelKind: PedalChannelKind { .widener }
|
||||
|
||||
/// Wider card for the reverb/chorus knobs plus the Bright and Chorus switches.
|
||||
public override var widthUnits: Int { 3 }
|
||||
|
||||
// MARK: - Init
|
||||
|
||||
/// Creates a Jazz Clean amp.
|
||||
|
||||
@@ -57,9 +57,6 @@ public final class MagnaVibratoAmpPedal: AmpVoicePedal {
|
||||
]
|
||||
}
|
||||
|
||||
/// Wider card for the vibrato knobs plus the Vibrato switch.
|
||||
public override var widthUnits: Int { 3 }
|
||||
|
||||
/// Creates a Magna Vibrato amp.
|
||||
///
|
||||
/// - Parameters:
|
||||
|
||||
@@ -31,10 +31,6 @@ public final class MutantPedal: Pedal {
|
||||
"Envelope-following auto-wah / funk filter that opens with your picking."
|
||||
}
|
||||
|
||||
/// Double-width so the two switches — Sweep (2-way) and the 3-way Mode — sit side by side
|
||||
/// without cramping now that switches lay out horizontally.
|
||||
public override var widthUnits: Int { 2 }
|
||||
|
||||
// MARK: - Parameters
|
||||
|
||||
/// Filter response selector. `0` = lowpass, `1` = bandpass, `2` = highpass. Driven by a three-state switch.
|
||||
|
||||
@@ -54,9 +54,6 @@ public final class SixtiesComboAmpPedal: AmpVoicePedal {
|
||||
public override var powerAmpOversample: Int { 4 }
|
||||
public override var powerAmpDriveInput: any ValidGeneratorInput { grittyPowerDrive }
|
||||
|
||||
/// Wider card for the tremolo knobs plus the Tremolo switch.
|
||||
public override var widthUnits: Int { 3 }
|
||||
|
||||
/// Creates a Sixties Combo amp.
|
||||
///
|
||||
/// - Parameters:
|
||||
|
||||
Reference in New Issue
Block a user