Loop-crossfade-ux review fixes: parked-drag no longer fakes LOOP OFF, waveform label contrast fixed, hover memoizes its bank read

Also corrects the cap-area, em-dash, glyph-overhang and heuristic-comment findings noted in review.
This commit is contained in:
2026-08-02 05:50:38 -04:00
parent a7c3c7a828
commit 1b4d0e67b7
10 changed files with 125 additions and 27 deletions
+16
View File
@@ -176,6 +176,21 @@ static void testEditingTheStartMarkerWhileOffLeavesTheEnableAndCrossfadeAlone()
CHECK(w.start == 512);
}
// Dragging the START marker while parked (never set) must not turn "DRAG TO SET LOOP" into
// "LOOP OFF" — the ordinary gesture that exposed the bug, distinct from the retained-span case
// above.
static void testEditingTheStartMarkerWhileParkedStaysParked() {
LoopMarks m = resolveLoopMarks(StoredLoop{}, kFrames);
CHECK(m.parked && !m.hasLoop);
m.start = 512;
const LoopMarks after = writeThenRead(m);
CHECK(!after.hasLoop);
CHECK(after.parked);
const LoopBounds d = defaultLoopBounds(kFrames);
CHECK(after.loopStart == d.start && after.loopEnd == d.end);
CHECK(after.start == 512);
}
static void testANegativeCrossfadeNeverReachesTheStore() {
LoopMarks m = resolveLoopMarks(storedSpan(true, 4000, 6000, 0), kFrames);
m.crossfade = -1;
@@ -197,6 +212,7 @@ int main() {
testDraggingALoopMarkWhileOffTurnsItOn();
testEditingTheStartMarkerWhileOffLeavesTheEnableAndCrossfadeAlone();
testEditingTheStartMarkerWhileParkedStaysParked();
testANegativeCrossfadeNeverReachesTheStore();
if (g_fail == 0) {
+3 -2
View File
@@ -157,8 +157,9 @@ static void testHoldCellIsReservedAndFollowsTheVelocityCellGrammar() {
// the agreed remedy if it cannot is to narrow the enable's segments, never to move the floor.
static void testTheControlRunLeavesTheTitleReadableAtTheEditorFloor() {
const ChromeRects r = chromeRects(chromeBand(), kKnob);
// "ReaSampler 9000" (15 chars) plus a bracketed 20-char capture name, at the toolbar font's
// generous ~7 px/char estimate: 38 * 7.
// "ReaSampler 9000" (15 chars) plus a bracketed 20-char capture name, at an assumed 7 px/char
// for the toolbar font: 38 * 7. A HEURISTIC, not a measured Segoe UI metric — no font-metric
// measurement backs this number; it gates a phase-wide acceptance criterion regardless.
constexpr int kTitleTextFloorPx = 266;
CHECK(r.title.width >= kTitleTextFloorPx);
// Nothing in the run reaches into the title's slot.
+20
View File
@@ -269,6 +269,25 @@ static void testCardNameScrimClearsBodyFloorOnItsWorstBackground() {
< textFloor(TextClass::Body));
}
// The waveform band's state caption and its four mark labels (editor_paint_waveform.cpp) draw
// text/dim (the caption, the non-promoted labels) and text/primary (the promoted label) — both
// Font::Micro, both body class — over a bg/base scrim at kWaveformLabelScrimAlpha, itself drawn
// over whatever drawEnvelope left in that rect. Unlike the card name strip, the worst case here
// is text/DIM, not text/primary, so the alpha is higher than kCardNameScrimAlpha's — pin both
// roles against the worst background (a full-scale envelope peak, accent/primary) and pin the
// defect the scrim exists to close.
static void testWaveformLabelScrimClearsBodyFloorOnItsWorstBackground() {
const KitColor scrim = roleColor(Role::BgBase);
const KitColor onFill = compositeOver(scrim, roleColor(Role::AccentPrimary),
kWaveformLabelScrimAlpha);
CHECK(contrastRatio(roleColor(Role::TextDim), onFill) >= textFloor(TextClass::Body));
CHECK(contrastRatio(roleColor(Role::TextPrimary), onFill) >= textFloor(TextClass::Body));
// Without the scrim, text/dim on the bare accent-lime fill is UNDER floor (~1.58:1) — pins
// the defect the scrim exists to close, so a future removal of the scrim fails this first.
CHECK(contrastRatio(roleColor(Role::TextDim), roleColor(Role::AccentPrimary))
< textFloor(TextClass::Body));
}
// --- Single point of change (structural guarantee) ----------------------------
//
// roleColor is the ONLY color source; there is no other public accessor that yields a
@@ -366,6 +385,7 @@ int main() {
testTextOnPastelFillClearsBodyFloor();
testTextOnHoverSurfaceClearsFloor();
testCardNameScrimClearsBodyFloorOnItsWorstBackground();
testWaveformLabelScrimClearsBodyFloorOnItsWorstBackground();
testCurveTraceOnHoverSurfaceClearsFloor();
testSecondaryTertiaryAreDistinguishable();
testOverlayTraceClearsIndicatorFloorOnTheWaveform();