perf(animation): drop bouncy springs on high-frequency UI (E4.2)#549
Conversation
WalkthroughThis PR systematically refines animation behavior across multiple UI components. Tab indicator positioning switches from bouncy spring dynamics to predictable 250ms tween easing. Icon, label, and chip scale animations reduce damping and adjust stiffness for less bouncy, more responsive interactions across bottom navigation, filter chips, and settings screens. ChangesAnimation Parameter Refinement
Estimated code review effortπ― 2 (Simple) | β±οΈ ~10 minutes Possibly related PRs
Poem
π₯ Pre-merge checks | β 4 | β 1β Failed checks (1 warning)
β Passed checks (4 passed)
βοΈ Tip: You can configure your own custom pre-merge checks in the settings. β¨ Finishing Touchesπ Generate docstrings
π§ͺ Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and canβt be posted inline due to platform limitations.
β οΈ Outside diff range comments (1)
feature/tweaks/presentation/src/commonMain/kotlin/zed/rainxch/tweaks/presentation/components/sections/Appearance.kt (1)
285-292:β οΈ Potential issue | π‘ Minor | β‘ Quick win
ThemeColorOptionscale spring was not updated β contradicts the stated PR objective.The PR objectives explicitly list this surface as a target:
Tweaks β Appearance β ThemeColorOption scale:
spring(MediumBouncy, StiffnessLow)βspring(NoBouncy, StiffnessMedium)Lines 289β291 still use
DampingRatioMediumBouncy/StiffnessLow.ThemeColorOptionlives in aLazyRowof color swatches that users tap freely, putting it in the same high-frequency category as the surfaces that were fixed.(Line 331's
scaleIn(spring(MediumBouncy))insideAnimatedVisibilityis intentionally left bouncy as a one-shot checkmark entrance β that is correct and should not change.)π Proposed fix
val scale by animateFloatAsState( targetValue = if (isSelected) 1.1f else 1f, animationSpec = spring( - dampingRatio = Spring.DampingRatioMediumBouncy, - stiffness = Spring.StiffnessLow, + dampingRatio = Spring.DampingRatioNoBouncy, + stiffness = Spring.StiffnessMedium, ), )π€ Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@feature/tweaks/presentation/src/commonMain/kotlin/zed/rainxch/tweaks/presentation/components/sections/Appearance.kt` around lines 285 - 292, The scale spring used by ThemeColorOption was not updated: change the animateFloatAsState animationSpec for the scale variable (in ThemeColorOption) from spring(dampingRatio = Spring.DampingRatioMediumBouncy, stiffness = Spring.StiffnessLow) to spring(dampingRatio = Spring.DampingRatioNoBouncy, stiffness = Spring.StiffnessMedium) so the ThemeColorOption uses the intended NoBouncy/Medium stiffness behavior; keep the separate scaleIn(spring(MediumBouncy)) for the AnimatedVisibility checkmark unchanged.
π€ Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In
`@feature/tweaks/presentation/src/commonMain/kotlin/zed/rainxch/tweaks/presentation/components/sections/Appearance.kt`:
- Around line 285-292: The scale spring used by ThemeColorOption was not
updated: change the animateFloatAsState animationSpec for the scale variable (in
ThemeColorOption) from spring(dampingRatio = Spring.DampingRatioMediumBouncy,
stiffness = Spring.StiffnessLow) to spring(dampingRatio =
Spring.DampingRatioNoBouncy, stiffness = Spring.StiffnessMedium) so the
ThemeColorOption uses the intended NoBouncy/Medium stiffness behavior; keep the
separate scaleIn(spring(MediumBouncy)) for the AnimatedVisibility checkmark
unchanged.
βΉοΈ Review info
βοΈ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 9cdb22d3-57d7-4366-a4a9-a89e24906a73
π Files selected for processing (4)
composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/app/navigation/BottomNavigation.ktfeature/home/presentation/src/commonMain/kotlin/zed/rainxch/home/presentation/components/HomeFilterChips.ktfeature/tweaks/presentation/src/commonMain/kotlin/zed/rainxch/tweaks/presentation/components/sections/Appearance.ktfeature/tweaks/presentation/src/commonMain/kotlin/zed/rainxch/tweaks/presentation/components/sections/Installation.kt
Survey #16: "reduce acceleration and bounce animations". Slice E4.2 of E4 Performance Pass.
What
Targeted bounce reduction on high-frequency selection animations only. Removed
Spring.DampingRatioMediumBouncy/LowBouncyovershoot from the surfaces a user hits dozens of times per session. Kept subtle bounces on one-shot animations (auth flow enter/exit, dialog scale-in) where the personality is intentional and not jarring.Changes
BottomNavigationindicator X positionspring(LowBouncy, StiffnessLow)tween(250ms, FastOutSlowInEasing)BottomNavigationicon scale on selectionspring(MediumBouncy, StiffnessLow)spring(NoBouncy, StiffnessMedium)BottomNavigationicon offset YBottomNavigationlabel scaleHomeFilterChipsindicator Xspring(LowBouncy, StiffnessLow)tween(220ms)HomeFilterChipspress scalespring(MediumBouncy, StiffnessMedium)spring(NoBouncy, StiffnessMediumLow)Tweaks β Appearance β ThemeModeOptionscalespring(MediumBouncy, StiffnessLow)spring(NoBouncy, StiffnessMedium)Tweaks β Appearance β ThemeColorOptionscaleTweaks β Installation β InstallerOptionscalespring(MediumBouncy, StiffnessLow)spring(NoBouncy, StiffnessMedium)Skipped (intentional bounce kept)
AuthenticationRootβ one-time auth flow, the bounce reads as personality not jitter.BottomNavigation.pressScaleβ micro press feedback at 0.85x; the subtle bounce IS the touch confirmation.Appearance.kt:331scaleIn(spring(MediumBouncy))insideAnimatedVisibilityβ one-shot enter animation only fires when the chip becomes selected; not high-frequency.Test plan
:composeApp:compileDebugKotlinAndroidβRELEASE_NOTES_1.8.1.md(out-of-scope untracked file) β skipped.Why surface count is small
The codebase already used
Spring.DampingRatioNoBouncyextensively. Only 5 files had bouncy springs. Of those, only 4 surfaces are high-frequency β easy + bounded sweep.Out of scope
Application.onCreate/MainActivity.onCreate.DetailsViewModel.loadDetailsparallelasync {}.Summary by CodeRabbit