Skip to content

perf(animation): drop bouncy springs on high-frequency UI (E4.2)#549

Merged
rainxchzed merged 1 commit into
mainfrom
perf/e4-2-spring-sweep
May 8, 2026
Merged

perf(animation): drop bouncy springs on high-frequency UI (E4.2)#549
rainxchzed merged 1 commit into
mainfrom
perf/e4-2-spring-sweep

Conversation

@rainxchzed
Copy link
Copy Markdown
Member

@rainxchzed rainxchzed commented May 8, 2026

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 / LowBouncy overshoot 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

Surface Before After
BottomNavigation indicator X position spring(LowBouncy, StiffnessLow) tween(250ms, FastOutSlowInEasing)
BottomNavigation icon scale on selection spring(MediumBouncy, StiffnessLow) spring(NoBouncy, StiffnessMedium)
BottomNavigation icon offset Y same same fix
BottomNavigation label scale same same fix
HomeFilterChips indicator X spring(LowBouncy, StiffnessLow) tween(220ms)
HomeFilterChips press scale spring(MediumBouncy, StiffnessMedium) spring(NoBouncy, StiffnessMediumLow)
Tweaks β†’ Appearance β†’ ThemeModeOption scale spring(MediumBouncy, StiffnessLow) spring(NoBouncy, StiffnessMedium)
Tweaks β†’ Appearance β†’ ThemeColorOption scale same same fix
Tweaks β†’ Installation β†’ InstallerOption scale spring(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:331 scaleIn(spring(MediumBouncy)) inside AnimatedVisibility β€” one-shot enter animation only fires when the chip becomes selected; not high-frequency.

Test plan

  • :composeApp:compileDebugKotlinAndroid βœ…
  • Local CodeRabbit: 1 finding in RELEASE_NOTES_1.8.1.md (out-of-scope untracked file) β†’ skipped.
  • Manual: tab between Home / Search / Apps / Profile rapidly β†’ indicator slides predictably without overshoot. Tap chip filters on Home β†’ no jitter. Theme mode picker β†’ settles cleanly.

Why surface count is small

The codebase already used Spring.DampingRatioNoBouncy extensively. Only 5 files had bouncy springs. Of those, only 4 surfaces are high-frequency β€” easy + bounded sweep.

Out of scope

  • E4.3 β€” defer non-critical work in Application.onCreate / MainActivity.onCreate.
  • E4.4 β€” verify DetailsViewModel.loadDetails parallel async {}.
  • E4.5 β€” Macrobenchmark + scroll profile (needs Pixel 6).

Summary by CodeRabbit

  • Style
    • Updated animation transitions throughout the app for smoother interactions: bottom navigation tab movement, category filter indicators, and theme/installation option selections now respond with refined, less bouncy animations.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 8, 2026

Review Change Stack

Walkthrough

This 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.

Changes

Animation Parameter Refinement

Layer / File(s) Summary
Bottom Navigation Tab Animations
composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/app/navigation/BottomNavigation.kt
Tab indicator indicatorX animation changes from spring to tween(250ms, FastOutSlowInEasing). Selected-tab icon scale, icon vertical offset, and label scale all update spring parameters from MediumBouncy/StiffnessLow to NoBouncy/StiffnessMedium.
Filter Chips Indicator and Press Animations
feature/home/presentation/src/commonMain/kotlin/zed/rainxch/home/presentation/components/HomeFilterChips.kt
Chip row indicator position (indicatorX) animation switches from spring to tween(durationMillis = 220). Press feedback scale animation damping ratio changes from MediumBouncy to NoBouncy, with stiffness adjusted from StiffnessMedium to StiffnessMediumLow.
Settings Component Scale Animations
feature/tweaks/presentation/src/commonMain/kotlin/zed/rainxch/tweaks/presentation/components/sections/Appearance.kt, feature/tweaks/presentation/src/commonMain/kotlin/zed/rainxch/tweaks/presentation/components/sections/Installation.kt
ThemeModeOption and InstallerOption scale animations both shift spring parameters from DampingRatioMediumBouncy/StiffnessLow to DampingRatioNoBouncy/StiffnessMedium, producing crisper selection feedback.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 Bounces smooth, springs refined,
Tween and spring now intertwined,
No more wobble, crisp and true,
Animation flows brand new! ✨

πŸš₯ Pre-merge checks | βœ… 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
βœ… Passed checks (4 passed)
Check name Status Explanation
Description Check βœ… Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check βœ… Passed The title 'perf(animation): drop bouncy springs on high-frequency UI (E4.2)' accurately and specifically describes the main change: replacing bouncy spring animations with smoother alternatives on frequently-used UI surfaces as part of a performance optimization initiative.
Linked Issues check βœ… Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check βœ… Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
πŸ“ Generate docstrings
  • Create stacked PR
  • Commit on current branch
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch perf/e4-2-spring-sweep

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.

❀️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

ThemeColorOption scale 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. ThemeColorOption lives in a LazyRow of 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)) inside AnimatedVisibility is 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

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between a6d2be3 and 2afd250.

πŸ“’ Files selected for processing (4)
  • composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/app/navigation/BottomNavigation.kt
  • feature/home/presentation/src/commonMain/kotlin/zed/rainxch/home/presentation/components/HomeFilterChips.kt
  • feature/tweaks/presentation/src/commonMain/kotlin/zed/rainxch/tweaks/presentation/components/sections/Appearance.kt
  • feature/tweaks/presentation/src/commonMain/kotlin/zed/rainxch/tweaks/presentation/components/sections/Installation.kt

@rainxchzed rainxchzed merged commit 560376a into main May 8, 2026
1 check passed
@rainxchzed rainxchzed deleted the perf/e4-2-spring-sweep branch May 8, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant