test(transitions): regression lock for the #269 motion guard - #281
Merged
Conversation
motionSuppressed() is now an exported, live-evaluated check (desktop: honors prefers-reduced-motion; plain browser: always suppress, since Svelte's out-transition completion never fires in background panes and stale views stacked forever). Every shared preset routes through it. 5 unit tests cover all three branches plus the zero-duration collapse of fadeQuick/modalScale/overlayFade/overlayFlyUp/slideDown/expandSlide.
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Locks the #269 fix with unit tests instead of leaving it verified-by-memory:
motionSuppressed()becomes an exported, live-evaluated check: desktop honorsprefers-reduced-motion; a plain browser (incl. background panes) always suppresses — Svelte's out-transition completion never fires there, which used to stack stale views forever (the ghost "+ New" and the blocked locator clicks).fadeQuick,modalScale,overlayFade,overlayFlyUp,slideDown,expandSlide) routes through it per invocation.Why
Closes #269 on merge — the root cause (stacked stale
.view-containeroverlays, which also made locator clicks fail actionability) is guarded and now regression-locked. Remaining verification pass in a real browser is belt-and-braces; if ghosting ever reappears, these tests define the contract.How
guarded()previously branched on module-loadisWebMode; suppression is now a named predicate re-evaluated per invocation — same behavior, testable seams.isWebModeimport dropped from transitions.ts (unused after refactor).Testing
npx svelte-check— 0 errorsnpm run test -- --run— 81/81 pass (5 new)npm run build— succeedscargo fmt --check/clippy/cargo test— CI covers (no Rust changes)Closes #269