arkivanov / Decompose

Kotlin Multiplatform lifecycle-aware business logic components (aka BLoCs) with routing (navigation) and pluggable UI (Jetpack Compose, SwiftUI, JS React, etc.)
https://arkivanov.github.io/Decompose
Apache License 2.0
2.25k stars 85 forks source link

Fix standard predictive back nagiviation code sample #709

Closed TheMrMilchmann closed 6 months ago

TheMrMilchmann commented 6 months ago

The current code sample contains two mistakes:

  1. The animation parameter is actually called fallbackAnimation.
  2. The syntax selector = selector = ... looks like a typo.

I went ahead and quickly fixed both of them :)

Summary by CodeRabbit

coderabbitai[bot] commented 6 months ago

Walkthrough

The update primarily involves renaming a parameter from animation to fallbackAnimation in the RootContent function of the compose.md file. This change reflects a more precise naming for the parameter that handles animations when the main animation fails or is not applicable, ensuring clarity in the function's purpose and usage.

Changes

File Path Change Summary
.../compose.md Renamed animation to fallbackAnimation in fun RootContent(...)

🐇✨ In the land of code, where changes brew, A tiny rename, from old to new. animation fades, fallbackAnimation shines, Clearer paths for code that intertwines. Hopping through docs, with a cheer, CodeRabbit celebrates, with code so dear! 🎉 🐇✨


Recent Review Details **Configuration used: CodeRabbit UI** **Review profile: CHILL**
Commits Files that changed from the base of the PR and between 0c2342d1631c15af6f06cebe96101155498df40e and fc5c5552bbf3fa560ad01137cb318e8fc2f24c23.
Files selected for processing (1) * docs/extensions/compose.md (1 hunks)
Additional Context Used
LanguageTool (50)
docs/extensions/compose.md (50)
Near line 9: Possible spelling mistake found. Context: ...etpack-and-multiplatform-compose). ### ProGuard rules for Compose for Desktop (JVM) If... --- Near line 11: Possible spelling mistake found. Context: ...will need to add the following rule for ProGuard, so that the app works correctly in rel... --- Near line 11: The conjunction “so that” does not require a comma. Context: ...d to add the following rule for ProGuard, so that the app works correctly in release mode... --- Near line 19: Only proper nouns start with an uppercase character (there are exceptions for headlines). Context: ...otlin/com/arkivanov/decompose/value) to Compose `State` use `Value.subscribeAsState(... --- Near line 19: The word ‘State.subscribeAsState(): State` extension function: ```kotlin import... --- Near line 45: Possible spelling mistake found. Context: ...ing JetBrains Compose, you can have the `LifecycleRegistry` react to changes in the window state u... --- Near line 77: The preposition “on” seems more likely in this position than the preposition “in”. Context: ... ``` !!!warning When using Compose in desktop platforms, make sure to always ... --- Near line 79: This sentence does not start with an uppercase letter. Context: ...eceive lifecycle events correctly. !!! note You can find the `runOnUiThread` m... --- Near line 85: A comma might be missing here. Context: ...a stack of components. However, in some cases observing the navigation state manually... --- Near line 85: The word ‘Value`, which makes it possible to observe t... --- Near line 101: Possible spelling mistake found. Context: ...overview.md) navigation model provides [ChildStack](https://github.com/arkivanov/Decompose... --- Near line 101: Only proper nouns start with an uppercase character (there are exceptions for headlines). Context: ...ecompose/router/stack/ChildStack.kt) as `Value` that can be observed in a ... --- Near line 101: Possible spelling mistake found. Context: ...d `Composable` components following the `ChildStack` changes. Both Compose extension modul... --- Near line 103: Only proper nouns start with an uppercase character (there are exceptions for headlines). Context: ...llowing the `ChildStack` changes. Both Compose extension modules provide the [Children... --- Near line 105: Possible spelling mistake found. Context: ...llowing features: - It listens for the `ChildStack` changes and displays the corresponding... --- Near line 107: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym. Context: ...figuration changes and process death. - It animates between children if there is a... --- Near line 159: You might be missing the article “the” here. Context: ...sed to just show/hide a certain part of UI, or to present a dialog, or a sheet (li... --- Near line 206: This sentence does not start with an uppercase letter. Context: ...odifier.width(300.dp), ) } ``` !!! note Child Slot might not be suitable f... --- Near line 215: Possible spelling mistake found. Context: ...overview.md) navigation model provides [ChildPages](https://github.com/arkivanov/Decompose... --- Near line 215: Only proper nouns start with an uppercase character (there are exceptions for headlines). Context: ...ecompose/router/pages/ChildPages.kt) as `Value` that can be observed in a ... --- Near line 217: Only proper nouns start with an uppercase character (there are exceptions for headlines). Context: ...rved in a `Composable` component. Both Compose extension modules provide the [Pages(..... --- Near line 219: Possible spelling mistake found. Context: ...llowing features: - It listens for the `ChildPages` changes and displays child components ... --- Near line 219: Possible spelling mistake found. Context: ...ges and displays child components using `HorizontalPager` or `VerticalPager` (see the related Je... --- Near line 219: Possible spelling mistake found. Context: ...d components using `HorizontalPager` or `VerticalPager` (see the related Jetpack Compose [docu... --- Near line 246: Possible missing comma found. Context: ...efined animation specs. To enable child animations you need to pass the `animation` argume... --- Near line 316: A determiner appears to be missing. Consider inserting it. Context: ... ### Separate animations for children Previous examples demonstrate simple cases, when... --- Near line 317: Usually, there’s no comma before “when”. Context: ...evious examples demonstrate simple cases, when all children have the same animation. B... --- Near line 346: ‘take into account’ might be wordy. Consider a shorter alternative. Context: ...f" width="512"> It is also possible to take into account the other child and the animation direc... --- Near line 368: The conjunction “so that” does not have a comma in front. Context: ... default stack animation is configurable, so that it's possible to avoid specifying the s... --- Near line 400: Possible spelling mistake found. Context: ...he animation block receives the current `ChildStack` and animates children using the provid... --- Near line 430: Possible spelling mistake found. Context: ... #### Implementing `StackAnimator` The `stackAnimation` function takes care of tracking the `C... --- Near line 430: Possible spelling mistake found. Context: ...on` function takes care of tracking the `ChildStack` changes. `StackAnimator` is only respo... --- Near line 430: Possible spelling mistake found. Context: ...e of tracking the `ChildStack` changes. `StackAnimator` is only responsible for manipulating t... --- Near line 430: Possible spelling mistake found. Context: ...` in the given `direction`, and calling `onFinished` at the end. ```kotlin import androidx... --- Near line 460: Possible spelling mistake found. Context: ...ished at the end } ``` #### Using `stackAnimator` function This is the simplest, but le... --- Near line 462: Possible spelling mistake found. Context: ...he simplest, but less powerful way. The `stackAnimator` function takes care of running the ani... --- Near line 494: Using many exclamation marks might seem excessive (in this case: 15 exclamation marks for a text that’s 9346 characters long) Context: ... examples. ## Predictive Back Gesture !!!warning Predictive Back Gesture supp... --- Near line 498: This sentence does not start with an uppercase letter. Context: ...lease use version 2.1.x. `Child Stack` supports the new [Android Predictive Back Gestur... --- Near line 500: Possible spelling mistake found. Context: ... To enable the gesture, first implement `BackHandlerOwner` interface in your component with `Chil... --- Near line 500: Possible spelling mistake found. Context: ...nent with `Child Stack`, then just pass `predictiveBackAnimation` to the `Children` function. ```kotlin... --- Near line 563: Possible spelling mistake found. Context: ...dard Android-like system animation The `androidPredictiveBackAnimatable` API resembles the standard back gestur... --- Near line 599: Possible spelling mistake found. Context: ...lly handles the gesture and manipulates `BackDispatcher` as needed. 1. Create `BackDispatcher`... --- Near line 601: Possible spelling mistake found. Context: ... `BackDispatcher` as needed. 1. Create `BackDispatcher` and assign it to a variable. 2. Create... --- Near line 602: Possible spelling mistake found. Context: ...gn it to a variable. 2. Create the root `DefaultComponentContext` and pass the previously created `BackD... --- Near line 602: Possible spelling mistake found. Context: ...ontext` and pass the previously created `BackDispatcher` as `backHandler` argument. 3. Pass the... --- Near line 602: Possible spelling mistake found. Context: ... previously created `BackDispatcher` as `backHandler` argument. 3. Pass the **same** `BackDi... --- Near line 603: Possible spelling mistake found. Context: ...Handler` argument. 3. Pass the **same** `BackDispatcher` to `PredictiveBackGestureOverlay`. ``... --- Near line 603: Possible spelling mistake found. Context: .... Pass the **same** `BackDispatcher` to `PredictiveBackGestureOverlay`. ```kotlin title="Using Composable Pr... --- Near line 635: Possible spelling mistake found. Context: ...he predictive back gesture, so it looks native-ish on iOS. ```kotlin title="In commonMain... --- Near line 748: Possible spelling mistake found. Context: ...an find samples in a separate branch - [compose-darwin/sample](https://github.com/arkivanov/De...
Additional comments not posted (1)
docs/extensions/compose.md (1)
`581-582`: Corrected parameter name and removed redundant assignment. This change correctly addresses the issues mentioned in the PR description. The parameter name `animation` has been replaced with `fallbackAnimation`, and the redundant assignment has been corrected. This should prevent any confusion and potential bugs related to the misuse of the parameter.
--- 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 - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit .` - `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 generate interesting stats about this repository and render them as a table.` - `@coderabbitai show all the console.log statements in this repository.` - `@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.` 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 as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger a review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai help` to get help. Additionally, you can add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Configration 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](https://docs.coderabbit.ai/guides/configure-coderabbit) 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](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.
arkivanov commented 6 months ago

Thank you!