-
-
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 StackNavigator#popToFirst extension function #722
Conversation
Warning Rate limit exceeded@arkivanov has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 34 minutes and 38 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThe code changes primarily involve renaming functions in Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant StackNavigator
note right of StackNavigator: Improved function names
User->>StackNavigator: popWhile(predicate)
User->>StackNavigator: popTo(index, onComplete)
User->>StackNavigator: popToFirst(onComplete)
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: 1
Outside diff range and nitpick comments (1)
decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/stack/StackNavigatorExt.kt (1)
Line range hint
78-87
: Refactor duplicate logic inpopWhile
.The two
popWhile
functions share a significant amount of logic. Consider refactoring to reduce duplication, possibly by having one function call the other with a defaultonComplete
parameter.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/stack/StackNavigatorExt.kt (4 hunks)
- decompose/src/commonTest/kotlin/com/arkivanov/decompose/router/stack/RouterPopToFirstTest.kt (1 hunks)
- decompose/src/commonTest/kotlin/com/arkivanov/decompose/router/stack/RouterPopToTest.kt (1 hunks)
Files skipped from review due to trivial changes (1)
- decompose/src/commonTest/kotlin/com/arkivanov/decompose/router/stack/RouterPopToFirstTest.kt
Additional comments not posted (1)
decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/stack/StackNavigatorExt.kt (1)
123-134
: Validate the newpopToFirst
function.The implementation of
popToFirst
correctly delegates topopTo(index = 0)
, which is a clean and efficient way to ensure that only the first configuration remains active. This maintains consistency and leverages existing logic effectively.
As part of #721.
Summary by CodeRabbit
Refactor
drop
topop
).Tests