Skip to content

Optimize player sheet animations for smoother transitions#488

Merged
theovilardo merged 4 commits intomasterfrom
codex/optimize-player-ui-animations-for-performance
Dec 11, 2025
Merged

Optimize player sheet animations for smoother transitions#488
theovilardo merged 4 commits intomasterfrom
codex/optimize-player-ui-animations-for-performance

Conversation

@theovilardo
Copy link
Copy Markdown
Owner

Summary

  • add shared animation spec and mutex-driven helper to keep player sheet expansion and translation in sync
  • reuse the helper for state changes and drag endings to avoid overlapping animations and jank
  • preserve overshoot polish while reducing duplicated animation launches

Testing

  • ./gradlew :app:compileDebugKotlin (fails: SDK location not found in container)

Codex Task

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 286 to +289
LaunchedEffect(showPlayerContentArea, currentSheetContentState) {
val targetFraction =
if (showPlayerContentArea && currentSheetContentState == PlayerSheetState.EXPANDED) 1f else 0f
val targetExpanded = showPlayerContentArea && currentSheetContentState == PlayerSheetState.EXPANDED

playerContentExpansionFraction.animateTo(
targetValue = targetFraction,
animationSpec = tween(
durationMillis = ANIMATION_DURATION_MS,
easing = FastOutSlowInEasing
)
)
animatePlayerSheet(targetExpanded = targetExpanded)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Sheet translation ignores new collapsed target

The new animatePlayerSheet helper is now the only place updating currentSheetTranslationY, and the surrounding LaunchedEffect is keyed only on showPlayerContentArea and currentSheetContentState. When sheetCollapsedTargetY changes while the sheet state stays the same (e.g., MainActivity recomputes it when the current route hides the mini player or bottom padding changes), this effect never re-runs, so the animatable stays at the old offset and the sheet renders at the wrong Y until the user drags or toggles the sheet. The removed LaunchedEffect(... sheetCollapsedTargetY, sheetExpandedTargetY) used to retarget the translation for these layout changes; with it gone, collapsed/expanded positions no longer track their moving targets.

Useful? React with 👍 / 👎.

The `kotlinx.coroutines.sync.MutatorMutex` import was removed as `androidx.compose.foundation.MutatorMutex` is already imported and used in `UnifiedPlayerSheet.kt`.
@theovilardo theovilardo merged commit b6302a1 into master Dec 11, 2025
@lostf1sh lostf1sh deleted the codex/optimize-player-ui-animations-for-performance branch January 16, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant