-
-
Notifications
You must be signed in to change notification settings - Fork 85
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 docs about initializing the navigation on the Main thread #725
Conversation
WalkthroughThe recent updates focus on ensuring thread safety and performance by recommending that certain methods in the Decompose navigation API be called on the Main thread. This change is reflected through added documentation comments across various files, emphasizing the need to perform these operations on the Main thread to avoid unexpected behavior. Changes
Poem
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this 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
Outside diff range and nitpick comments (3)
docs/navigation/overview.md (3)
Line range hint
9-9
: To avoid repetitive sentence structure, consider rephrasing the list of navigation models.- - [Child Stack](../navigation/stack/overview.md) - prefer this way if you need to organize child components in a stack and navigate between them. - - [Child Slot](../navigation/slot/overview.md) - prefer this way if you need to activate-dismiss one child component at a time. - - [Child Pages](../navigation/pages/overview.md) - prefer this way if you need to organize child components in a list with one selected component. + - [Child Stack](../navigation/stack/overview.md): Ideal for organizing child components in a stack and navigating between them. + - [Child Slot](../navigation/slot/overview.md): Suitable for activating and dismissing one child component at a time. + - [Child Pages](../navigation/pages/overview.md): Best used to organize child components in a list with one selected component.
Line range hint
36-36
: It might be beneficial to replace "make sure" with a stronger directive to ensure proper setup.- Please make sure you [setup](https://github.com/Kotlin/kotlinx.serialization#setup) `kotlinx-serialization` correctly and applied the plugin. + Please ensure you [setup](https://github.com/Kotlin/kotlinx.serialization#setup) `kotlinx-serialization` correctly and applied the plugin.
Line range hint
39-39
: Consider adding a comma after "Android" for better readability.- On Android the amount of data that can be preserved is [limited](https://developer.android.com/guide/components/activities/parcelables-and-bundles). + On Android, the amount of data that can be preserved is [limited](https://developer.android.com/guide/components/activities/parcelables-and-bundles).
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (5)
- decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/children/ChildrenFactory.kt (2 hunks)
- decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/pages/ChildPagesFactory.kt (3 hunks)
- decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/slot/ChildSlotFactory.kt (2 hunks)
- decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/stack/ChildStackFactory.kt (3 hunks)
- docs/navigation/overview.md (1 hunks)
Files skipped from review due to trivial changes (1)
- decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/slot/ChildSlotFactory.kt
Additional context used
LanguageTool
docs/navigation/overview.md
[style] ~3-~3: The expression “come in handy” is rather colloquial. Consider replacing it to add a more formal tone to your writing. (COME_IN_HANDY)
Context: ...witch child components, then navigation comes in handy. Currently, Decompose provides two pre...
[style] ~9-~9: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym. (ENGLISH_WORD_REPEAT_BEGINNING_RULE)
Context: ...smiss one child component at a time. - Child Pages...
[style] ~36-~36: Consider using a different verb to strengthen your wording. (MAKE_SURE_ENSURE)
Context: ...should be implemented manually. Please make sure you [setup](https://github.com/Kotlin/k...
[uncategorized] ~39-~39: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ... applied the plugin. !!!warning On Android the amount of data that can be preserve...
Markdownlint
docs/navigation/overview.md
20-20: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces
Additional comments not posted (5)
docs/navigation/overview.md (2)
43-46
: The addition emphasizing the initialization and performance of navigation on the Main thread is clear and well-placed. This should help ensure that developers use the API in a thread-safe manner.
43-43
: Consider revising the phrase "comes in handy" to maintain a formal tone in documentation.- navigation comes in handy. + navigation proves useful.Likely invalid or redundant comment.
decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/stack/ChildStackFactory.kt (1)
20-21
: The documentation additions clearly emphasize the importance of thread safety by recommending the main thread for method calls. This is crucial for avoiding concurrency issues in UI operations.Also applies to: 66-66, 88-89
decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/pages/ChildPagesFactory.kt (1)
21-22
: Documentation stressing the use of the Main thread for method calls is well-placed and essential for ensuring that UI operations are handled correctly in a multithreaded environment.Also applies to: 89-90
decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/children/ChildrenFactory.kt (1)
23-23
: The addition of comments recommending the Main thread for method calls is appropriate and crucial for maintaining thread safety in UI component management.Also applies to: 79-80
Related to #712.
Summary by CodeRabbit