-
-
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
Annotate StackNavigator#push as delicate API #747
Conversation
WalkthroughThe recent changes enhance the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant StackNavigator
participant Component
User->>Component: Initiates action (e.g. button click)
Component->>StackNavigator: Calls pushNew(configuration)
StackNavigator-->>Component: Updates navigation stack
Component-->>User: Reflects new state or configuration
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 Configuration 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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (6)
- decompose/src/commonMain/kotlin/com/arkivanov/decompose/Annotations.kt (1 hunks)
- decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/stack/StackNavigatorExt.kt (2 hunks)
- docs/navigation/stack/navigation.md (1 hunks)
- sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/cards/DefaultCardsComponent.kt (2 hunks)
- sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/counters/DefaultCountersComponent.kt (2 hunks)
- sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/dynamicfeatures/DefaultDynamicFeaturesComponent.kt (2 hunks)
Files skipped from review due to trivial changes (1)
- docs/navigation/stack/navigation.md
Additional comments not posted (9)
decompose/src/commonMain/kotlin/com/arkivanov/decompose/Annotations.kt (1)
26-32
: LGTM! The new annotation class is consistent and well-documented.The
DelicateDecomposeApi
annotation is appropriately defined with@RequiresOptIn
and@Retention
annotations. The documentation comment provides clear guidance on its usage.sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/counters/DefaultCountersComponent.kt (2)
9-9
: LGTM! The import statement forpushNew
is necessary and correct.The import statement for
pushNew
is required for the updatedonNext
function.
39-39
: LGTM! The updatedonNext
function improves navigation.The
onNext
lambda function now usespushNew
to create a new configuration with an incremented index andisBackEnabled
set totrue
.sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/cards/DefaultCardsComponent.kt (2)
10-10
: LGTM! The import statement forpushNew
is necessary and correct.The import statement for
pushNew
is required for the updatedonAddClicked
function.
Line range hint
57-62
:
LGTM! The updatedonAddClicked
function improves navigation.The
onAddClicked
function now usespushNew
to create a new configuration with an incremented number and sets the color based on the number.sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/dynamicfeatures/DefaultDynamicFeaturesComponent.kt (2)
8-8
: LGTM! The import change is appropriate.The import statement for
push
has been replaced withpushNew
, which aligns with the updated method usage in the file.
54-54
: LGTM! TheonFeature2
callback update is appropriate.The
onFeature2
callback now usespushNew
instead ofpush
, which improves navigation clarity and avoids pushing duplicate configurations.decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/stack/StackNavigatorExt.kt (2)
3-4
: LGTM! The import change is appropriate.The import statement for
DelicateDecomposeApi
has been added, which aligns with the addition of theDelicateDecomposeApi
annotation in the file.
16-24
: LGTM! Thepush
function update is appropriate.The
push
function has been annotated withDelicateDecomposeApi
and its documentation has been updated to provide clearer guidance on the usage and implications of this method.However, ensure that all function calls to
push
are reviewed to verify correct usage.
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (9)
- decompose/api/android/decompose.api (1 hunks)
- decompose/api/decompose.klib.api (1 hunks)
- decompose/api/jvm/decompose.api (1 hunks)
- decompose/src/commonMain/kotlin/com/arkivanov/decompose/Annotations.kt (1 hunks)
- decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/stack/StackNavigatorExt.kt (2 hunks)
- docs/navigation/stack/navigation.md (1 hunks)
- sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/cards/DefaultCardsComponent.kt (2 hunks)
- sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/counters/DefaultCountersComponent.kt (2 hunks)
- sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/dynamicfeatures/DefaultDynamicFeaturesComponent.kt (2 hunks)
Files skipped from review as they are similar to previous changes (6)
- decompose/src/commonMain/kotlin/com/arkivanov/decompose/Annotations.kt
- decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/stack/StackNavigatorExt.kt
- docs/navigation/stack/navigation.md
- sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/cards/DefaultCardsComponent.kt
- sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/counters/DefaultCountersComponent.kt
- sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/dynamicfeatures/DefaultDynamicFeaturesComponent.kt
Additional comments not posted (4)
decompose/api/jvm/decompose.api (1)
78-79
: AnnotationDelicateDecomposeApi
is correctly defined.The annotation is properly defined and follows best practices.
decompose/api/android/decompose.api (1)
91-92
: AnnotationDelicateDecomposeApi
is correctly defined.The annotation is properly defined and follows best practices.
decompose/api/decompose.klib.api (2)
253-255
: LGTM!The
DelicateDecomposeApi
annotation class is correctly implemented as a marker.
256-258
: LGTM!The
ExperimentalDecomposeApi
annotation class is correctly implemented as a marker.
* Marks delicate Decompose API that requires special attention when used. | ||
* See the docs of the annotated API for more information. | ||
*/ | ||
@RequiresOptIn(level = RequiresOptIn.Level.WARNING) |
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.
I'd recommend marking the level as ERROR to force people to read the description. Otherwise the issue may persist
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.
Thanks. I will keep it as warning for now, similar to DelicateCoroutinesApi.
Closes #741.
Summary by CodeRabbit
New Features
DelicateDecomposeApi
annotation to signal APIs that require careful handling.pushNew
, enhancing navigation behavior.Documentation
push
function, clarifying its usage and suggesting alternatives.Bug Fixes