Skip to content

Fixed Children composable sometimes sticks with switching the stack quickly#979

Merged
arkivanov merged 1 commit intomasterfrom
fix-children-animation
Jan 25, 2026
Merged

Fixed Children composable sometimes sticks with switching the stack quickly#979
arkivanov merged 1 commit intomasterfrom
fix-children-animation

Conversation

@arkivanov
Copy link
Copy Markdown
Owner

@arkivanov arkivanov commented Jan 25, 2026

Fixes: #862
Related to: #976

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced stack animation behavior during component state transitions for improved reliability.
    • Improved animation completion callback handling to ensure consistent animation performance across recompositions.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jan 25, 2026

📝 Walkthrough

Walkthrough

Two targeted fixes to the stack animation system address rapid navigation freezing. One change adds conditional logic for single-item stack updates to preserve non-exiting items, while the other wraps callback references with rememberUpdatedState to maintain freshness across recompositions.

Changes

Cohort / File(s) Summary
Stack Animation State Management
extensions-compose/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/stack/animation/AbstractStackAnimation.kt, extensions-compose/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/stack/animation/DefaultStackAnimator.kt
Fixed animation handling during rapid updates: (1) AbstractStackAnimation now conditionally preserves single non-exiting items instead of wholesale replacement, comparing last keys of old/new sets. (2) DefaultStackAnimator wraps onFinished callback with rememberUpdatedState to ensure callback freshness across recompositions. Both changes prevent animation state corruption during rapid navigation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 Hop, hop, the tabs now dance with grace,
No more freezing in this animation race,
State remembered, callbacks fresh and true,
Rapid navigation flows right through! ✨

🚥 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 accurately describes the fix for the animation/rendering issue that occurs when rapidly switching stacks, which is the primary objective of this changeset.
Linked Issues check ✅ Passed The code changes address the core issue [#862] by fixing the stack animation logic to properly handle rapid switching, preventing the navigation from freezing.
Out of Scope Changes check ✅ Passed All changes are focused on stack animation handling in the compose extensions and are directly related to resolving the rapid tab switching freeze issue.

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

✨ Finishing touches
  • 📝 Generate docstrings

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.

@arkivanov arkivanov merged commit 67adb50 into master Jan 25, 2026
3 checks passed
@arkivanov arkivanov deleted the fix-children-animation branch January 25, 2026 17:30
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.

Navigation freezes when rapidly switching tabs

1 participant