fix(instrument-ui): distinguish Disabled from Off, add hover cue to mode toggles, close review minors

Adds a hairline outline for Disabled chrome buttons, resolves Hover on the four
mode-selector single-buttons, re-measures the control-surface doc's 1.2 layout
table post-reflow, and adds a structural test pinning every enable/mode toggle
to a derived segment.
This commit is contained in:
2026-08-03 13:43:38 -04:00
parent 450559f155
commit 73c69f689c
8 changed files with 108 additions and 33 deletions
+26
View File
@@ -6,6 +6,7 @@
#include "../src/core/instrument/ui/deck_values.h"
#include "../src/core/instrument/engine/master_gain.h"
#include "../src/core/instrument/ui/deck_groups.h"
#include <cmath>
#include <cstdio>
@@ -450,9 +451,34 @@ static void testASingleButtonsDerivedSegmentFlipsTheFieldItNames() {
}
}
// The cross-check the hand-maintained list above cannot catch: a control RE-STYLED to a
// single button (kEnable/kMode) with no nextToggleSegment entry silently commits segment -1,
// which setDeckParam reads as "off" — a latch, not a toggle. Swept over every group
// sampleDeckGroups actually ships, in both play modes, rather than a fixed id list, so a
// future re-style is caught the moment it lands here with no entry above. kLimiterEnable is
// the one shipped kEnable that is excluded: it lives on `InstrumentParams::limiterEnabled`,
// outside `PlaySeconds`, and commits through its own handler (editor_input_deck.cpp) rather
// than through nextToggleSegment/setDeckParam at all.
static void testEveryShippedSingleButtonToggleHasADerivedSegment() {
const PlaySeconds p;
for (PlayMode mode : {PlayMode::Gate, PlayMode::Trigger}) {
for (const DeckGroupDesc& g : sampleDeckGroups(mode)) {
for (const DeckToggleDesc* t : {&g.captionToggle, &g.captionToggle2, &g.rowToggle}) {
if (t->id < 0) continue;
if (t->style != DeckToggleStyle::kEnable && t->style != DeckToggleStyle::kMode)
continue;
const DeckParam id = static_cast<DeckParam>(t->id);
if (id == DeckParam::kLimiterEnable) continue;
CHECK(nextToggleSegment(id, p) != -1);
}
}
}
}
int main() {
testTheTwoCeilingNamesAreOneNumber();
testASingleButtonsDerivedSegmentFlipsTheFieldItNames();
testEveryShippedSingleButtonToggleHasADerivedSegment();
testNormRoundTripsThroughEveryValueDomain();
testRateKnobEndsAreTheStretchersOwnBounds();
testRateAndPitchBindTheirOwnFields();