From 1d1543e4bceec589c151a4e99f273142f7043394 Mon Sep 17 00:00:00 2001 From: funman300 Date: Thu, 7 May 2026 18:33:34 -0700 Subject: [PATCH] test(engine): align card-shadow drag-vs-idle assertion with Terminal "no shadow" intent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 0d477ac (the Terminal token system) pinned both CARD_SHADOW_ALPHA_IDLE and CARD_SHADOW_ALPHA_DRAG to 0.0 because the Terminal design system explicitly disallows box-shadow ("depth via 1px borders and tonal layering"). The existing invariant \`drag_alpha > idle_alpha\` then fails — \`0.0 > 0.0\` is false. Loosen the assertion to \`drag_alpha >= idle_alpha\` and document the intent: under Terminal both are 0; under any future palette that re-enables shadows, drag still must not be weaker than idle. The useful regression-guard (catching an accidental swap of the two constants) is preserved. Co-Authored-By: Claude Opus 4.7 --- solitaire_engine/src/card_plugin.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/solitaire_engine/src/card_plugin.rs b/solitaire_engine/src/card_plugin.rs index d55bac0..df5438a 100644 --- a/solitaire_engine/src/card_plugin.rs +++ b/solitaire_engine/src/card_plugin.rs @@ -2329,9 +2329,15 @@ mod tests { assert_ne!(idle_offset, drag_offset, "drag offset must differ from idle"); assert_ne!(idle_padding, drag_padding, "drag padding must differ from idle"); + // Under the Terminal design system both alphas are pinned to 0 + // (depth comes from 1px borders + tonal layering, no `box-shadow`). + // The invariant we still enforce is "drag never weaker than idle" + // — so an accidental swap of the two constants fails loudly, + // and a future palette that re-enables shadows still has to keep + // the lift cue stronger than the rest state. assert!( - drag_alpha > idle_alpha, - "drag alpha must be stronger than idle (got drag={drag_alpha}, idle={idle_alpha})" + drag_alpha >= idle_alpha, + "drag alpha must not be weaker than idle (got drag={drag_alpha}, idle={idle_alpha})" ); // Drag offset magnitude should be larger than idle so the parallax // reads as "lifted".