test(hig): catch the animation modifier in the Reduce Motion gate, and gate the four call sites it was missing - #3020
Merged
Merged
Conversation
…proposed, or an image will not attach
…d gate the four call sites it was missing
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
This branch was successfully deployed
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.
Found while investigating #2995. The AI composer's focus crossfade played at full duration under Reduce Motion, and the reason it had never been caught is that
ReduceMotionGateTestsonly ever looked for the literal stringwithAnimation.The guard had a blind spot
There are two ways to animate in SwiftUI, and the scan only knew one:
The modifier form is the one a view uses for a state-driven transition, so the gap was not a corner case.
modifierOffendersnow scans for it, skipping the three shapes that are already correct:.animation(nil, …)is the reduced behaviour already,.motionAnimation(is the gate itself, andCALayer.animation(forKey:)is a lookup rather than a change.What the widened scan found
Four call sites, now going through
motionAnimation/withMotion:SyncStatusIndicator.animation(.default, value: syncStatus)on every sync state changeAIChatPanelViewAIChatMessageViewForeignKeyPickerViewwithAnimation { … }callsOpacityPulseinView+SymbolEffectCompatneeded more than a gate. Gating its animation alone would have parked the view at the dimmed end of a pulse that never runs, which reads as a disabled control, so Reduce Motion now withdraws the pulse and holds opacity at 1.mainis currently red on this testThe two
ForeignKeyPickerViewcalls came in with #3009, which merged earlier today. They are plainwithAnimation { … }, so the existing scan already flags them:ReduceMotionGateTestsfails onmainright now, before any of my changes. This PR fixes them because it owns that guard, but the failure is not mine and is worth knowing about separately.Verification
buildBUILD SUCCEEDED (xcodebuild, Debug, private-derivedDataPath)TablePro/, which is what the assertion checks.TableProTestscompiled clean (module emitted, zeroerror:in 43k lines of log).The test case itself did not get to execute. Three other Claude sessions were building on this machine throughout, the shared DerivedData build database was locked (
database is locked. Possibly there are two concurrent builds running in the same filesystem location), and a private DerivedData took free disk from 28 GB to 4.6 GB, at which point I stopped rather than risk an out-of-space failure across the other sessions. The scan result above is the substantive claim and it is verified; what is unconfirmed is only the XCTest run around it. CI will run it.Worth re-running
ReduceMotionGateTestson CI for this branch before merge, since it is the whole point of the change.