Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added AnimatedVisibilityScope to ChildPanels content composables #835

Merged
merged 1 commit into from
Jan 9, 2025

Conversation

arkivanov
Copy link
Owner

@arkivanov arkivanov commented Jan 2, 2025

Closes #834.

Summary by CodeRabbit

Based on the comprehensive changes, here are the release notes:

  • New Features

    • Enhanced ChildPanels functionality with improved animation capabilities
    • Added support for more complex animations during child panel transitions
    • Introduced AnimatedVisibilityScope for more dynamic UI components
  • Improvements

    • Updated function signatures to support more flexible lambda parameters
    • Expanded predictive back gesture handling
    • Increased composability of UI elements
  • Technical Updates

    • Transitioned from Function3 to Function4 parameter types
    • Modified method signatures across multiple components to support enhanced animations

Copy link

coderabbitai bot commented Jan 2, 2025

Walkthrough

The pull request modifies the ChildPanels function signatures across multiple files to expose AnimatedVisibilityScope in composable lambdas. The changes involve updating function parameters to include AnimatedVisibilityScope as a receiver type, which allows for more dynamic and animated UI components. This modification enables developers to leverage animation capabilities directly within child panel composable functions.

Changes

File Change Summary
extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/panels/ChildPanels.kt Updated function signatures to include AnimatedVisibilityScope for mainChild, detailsChild, extraChild, and panel-related functions
extensions-compose-experimental/api/android/extensions-compose-experimental.api Updated method signatures from Function3 to Function4 in ChildPanelsKt and ComposableSingletons$ChildPanelsKt
extensions-compose-experimental/api/extensions-compose-experimental.klib.api Modified ChildPanels function signatures to accept Function4 parameters
extensions-compose-experimental/api/jvm/extensions-compose-experimental.api Updated method signatures similar to Android API changes

Assessment against linked issues

Objective Addressed Explanation
Expose AnimatedVisibilityScope in ChildPanels composable lambdas

Possibly related PRs

Poem

🐰 Hop, hop, animation's new dance!
Panels slide with graceful stance
Visibility scope now takes the lead
Smooth transitions at lightning speed
CodeRabbit's magic, smooth and bright! 🎉


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/panels/ChildPanels.kt (1)

297-298: DetailsPanel adds AnimatedVisibilityScope to content and placeholder.

This upgrade fosters more dynamic animation logic for both details panels and placeholders. Verify that placeholder animations do not unintentionally override main animations.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 537afc3 and f3dcf56.

📒 Files selected for processing (4)
  • extensions-compose-experimental/api/android/extensions-compose-experimental.api (2 hunks)
  • extensions-compose-experimental/api/extensions-compose-experimental.klib.api (1 hunks)
  • extensions-compose-experimental/api/jvm/extensions-compose-experimental.api (2 hunks)
  • extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/panels/ChildPanels.kt (8 hunks)
🔇 Additional comments (12)
extensions-compose-experimental/api/jvm/extensions-compose-experimental.api (2)

12-15: Expanded ChildPanels function signatures to function4-based lambdas.

By adding the AnimatedVisibilityScope receiver parameter, these ChildPanels overloads now enable composable content to directly leverage animation scopes. The change is well-structured and beneficial for advanced animation scenarios. Please validate any dependent calls in your project for proper parameter updates.


25-32: Lambda getters updated from Function2/Function3 to Function3/Function4.

These updated accessor signatures align with the new AnimatedVisibilityScope usage. Ensure your usage of these lambdas reflects the added parameter, as older function references may need refactoring.

extensions-compose-experimental/api/android/extensions-compose-experimental.api (2)

12-15: ChildPanels function signatures now accept an extra parameter for AnimatedVisibilityScope.

Switching from Function3 to Function4 is a breaking change for any direct references to these methods. Validate all references to confirm they match the newly introduced parameter.


25-32: Lambda getters refactored for composables requiring AnimatedVisibilityScope.

The shift to Function4 makes sense for advanced animation features. Make sure references are updated in any calling code that depended on the older function signatures.

extensions-compose-experimental/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/experimental/panels/ChildPanels.kt (7)

3-3: New import for AnimatedVisibilityScope.

This import unlocks advanced animation features within child composables, ensuring seamless integration with Compose’s animation APIs.


51-54: Additional AnimatedVisibilityScope parameters in ChildPanels for two-child setups.

This enhancement helps incorporate more dynamic animations for conditional visibility. Make sure the caller lambdas correctly handle the new scope parameter.


97-100: ChildPanels overload with direct ChildPanels object also enhanced to use AnimatedVisibilityScope.

Encourages uniform usage of animation scope in both reactive (Value) and direct ChildPanels usage. Confirm that any local usage also properly accommodates the new scope param.


146-151: Introduced AnimatedVisibilityScope to three-child variant for main/detail/extra.

This addition ensures consistent handling of animations across all panels. The placeholders for the second and third panels can now also leverage animations.


200-205: Three-child variant for ChildPanels object now supports AnimatedVisibilityScope-based composables.

Aligns with the approach in the reactive variant. Verify new lambdas are tested to avoid runtime mismatches.


264-264: MainPanel content param upgraded to AnimatedVisibilityScope receiver.

Allows inline and container-based animations for the main child. This consistent approach simplifies performing component animations under a single scope.


341-342: ExtraPanel updated to AnimatedVisibilityScope for content and placeholder.

Ensures consistent animation handling across all optional panels. Verify the layering of placeholders remains correct when all three panels are displayed.

extensions-compose-experimental/api/extensions-compose-experimental.klib.api (1)

65-68: Added fourth parameter to ChildPanels function signatures for the AnimatedVisibilityScope.

These additions enable composable animators to operate within the child content more declaratively. Ensure you modify your function references accordingly, as older references using Function3 might break at compile-time.

@arkivanov arkivanov merged commit b122157 into master Jan 9, 2025
3 checks passed
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.

[FR]: Expose AnimatedVisibilityScope in ChildPanels
1 participant