-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Refactored withSavedState, replaced with saveable #172
Conversation
WalkthroughThe updates involve renaming the 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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (5)
- state-keeper/api/android/state-keeper.api (1 hunks)
- state-keeper/api/jvm/state-keeper.api (1 hunks)
- state-keeper/api/state-keeper.klib.api (1 hunks)
- state-keeper/src/commonMain/kotlin/com/arkivanov/essenty/statekeeper/StateKeeperExt.kt (1 hunks)
- state-keeper/src/commonTest/kotlin/com/arkivanov/essenty/statekeeper/StateKeeperExtTest.kt (1 hunks)
Additional comments not posted (28)
state-keeper/src/commonTest/kotlin/com/arkivanov/essenty/statekeeper/StateKeeperExtTest.kt (4)
12-23
: LGTM!The test method
saveable_holder_saves_and_restores_state
is well-named and covers the state-saving and restoring process thoroughly.
25-37
: LGTM!The test method
saveable_property_saves_and_restores_state
is well-named and covers the state-saving and restoring process thoroughly.
39-43
: LGTM!The class
ComponentWithStateHolder
demonstrates the usage of thesaveable
function with a state holder. The property is well-defined and the usage of thesaveable
function is clear.
45-46
: LGTM!The class
ComponentWithState
demonstrates the usage of thesaveable
function with a state property. The property is well-defined and the usage of thesaveable
function is clear.state-keeper/api/jvm/state-keeper.api (8)
40-40
: LGTM!The function declaration for
saveable
inStateKeeper
is correct.
41-41
: LGTM!The function declaration for
saveable
inStateKeeper
withFunction1
is correct.
42-42
: LGTM!The function declaration for
saveable
inStateKeeperOwner
is correct.
43-43
: LGTM!The function declaration for
saveable
inStateKeeperOwner
withFunction1
is correct.
44-44
: LGTM!The synthetic function declaration for
saveable$default
inStateKeeper
is correct.
45-45
: LGTM!The synthetic function declaration for
saveable$default
inStateKeeper
withFunction1
is correct.
46-46
: LGTM!The synthetic function declaration for
saveable$default
inStateKeeperOwner
is correct.
47-47
: LGTM!The synthetic function declaration for
saveable$default
inStateKeeperOwner
withFunction1
is correct.state-keeper/src/commonMain/kotlin/com/arkivanov/essenty/statekeeper/StateKeeperExt.kt (4)
25-36
: LGTM!The function
saveable
inStateKeeper
is implemented correctly, with appropriate parameter handling and return type.
53-64
: LGTM!The function
saveable
inStateKeeperOwner
is implemented correctly, with appropriate parameter handling and return type.
78-96
: LGTM!The function
saveable
for creating mutable delegated properties inStateKeeper
is implemented correctly, with appropriate parameter handling and return type.
110-118
: LGTM!The function
saveable
for creating mutable delegated properties inStateKeeperOwner
is implemented correctly, with appropriate parameter handling and return type.state-keeper/api/android/state-keeper.api (8)
54-54
: LGTM!The function declaration for
saveable
inStateKeeper
is correct.
55-55
: LGTM!The function declaration for
saveable
inStateKeeper
withFunction1
is correct.
56-56
: LGTM!The function declaration for
saveable
inStateKeeperOwner
is correct.
57-57
: LGTM!The function declaration for
saveable
inStateKeeperOwner
withFunction1
is correct.
58-58
: LGTM!The synthetic function declaration for
saveable$default
inStateKeeper
is correct.
59-59
: LGTM!The synthetic function declaration for
saveable$default
inStateKeeper
withFunction1
is correct.
60-60
: LGTM!The synthetic function declaration for
saveable$default
inStateKeeperOwner
is correct.
61-61
: LGTM!The synthetic function declaration for
saveable$default
inStateKeeperOwner
withFunction1
is correct.state-keeper/api/state-keeper.klib.api (4)
35-35
: LGTM! Verify the function usage in the codebase.The new function definition for
saveable
looks good and is approved.However, ensure that all function calls to
saveable
match the new signature.Verification successful
Verification Successful
The new
saveable
function definition is correctly integrated and used throughout the codebase.
state-keeper/src/commonTest/kotlin/com/arkivanov/essenty/statekeeper/StateKeeperExtTest.kt
state-keeper/src/commonMain/kotlin/com/arkivanov/essenty/statekeeper/StateKeeperExt.kt
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `saveable` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type kotlin $'saveable'Length of output: 1994
Script:
#!/bin/bash # Extract and review the relevant lines from the test file rg --context 5 'saveable' state-keeper/src/commonTest/kotlin/com/arkivanov/essenty/statekeeper/StateKeeperExtTest.kt # Extract and review the relevant lines from the main file rg --context 5 'saveable' state-keeper/src/commonMain/kotlin/com/arkivanov/essenty/statekeeper/StateKeeperExt.ktLength of output: 3892
37-37
: LGTM! Verify the function usage in the codebase.The new function definition for
saveable
with transformation functions inStateKeeper
looks good and is approved.However, ensure that all function calls to
saveable
match the new signature.Verification successful
Verify the function signatures for
saveable
.We need to ensure that all instances of the
saveable
function match the new signature, including theKSerializer
, transformation functions, and an optionalkey
.
Verification Successful: Function signatures match the new definition.
The
saveable
function usage in the codebase matches the new signature, including theKSerializer
, transformation functions, and an optionalkey
.
state-keeper/src/commonMain/kotlin/com/arkivanov/essenty/statekeeper/StateKeeperExt.kt
state-keeper/src/commonTest/kotlin/com/arkivanov/essenty/statekeeper/StateKeeperExtTest.kt
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `saveable` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type kotlin $'saveable'Length of output: 1994
Script:
#!/bin/bash # Description: Inspect lines where `saveable` function is used to verify the function signatures. # Extract lines around the occurrences of `saveable` to inspect the function signatures. rg --type kotlin --context 5 'saveable' state-keeper/src/commonMain/kotlin/com/arkivanov/essenty/statekeeper/StateKeeperExt.kt rg --type kotlin --context 5 'saveable' state-keeper/src/commonTest/kotlin/com/arkivanov/essenty/statekeeper/StateKeeperExtTest.ktLength of output: 3920
36-36
: LGTM! Verify the function usage in the codebase.The new function definition for
saveable
inStateKeeperOwner
looks good and is approved.However, ensure that all function calls to
saveable
match the new signature.
38-38
: LGTM! Verify the function usage in the codebase.The new function definition for
saveable
with transformation functions inStateKeeperOwner
looks good and is approved.However, ensure that all function calls to
saveable
match the new signature.Verification successful
Verification Successful: Function Calls Match New Signature
All function calls to
saveable
in the codebase match the new signature as defined inStateKeeperOwner
.
StateKeeperExt.kt
StateKeeperExtTest.kt
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `saveable` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type kotlin $'saveable'Length of output: 1994
Script:
#!/bin/bash # Description: Extract the function calls to `saveable` in identified files to verify the new function signature. # Extract lines where `saveable` is called in StateKeeperExt.kt rg --type kotlin --no-heading --line-number 'saveable' state-keeper/src/commonMain/kotlin/com/arkivanov/essenty/statekeeper/StateKeeperExt.kt # Extract lines where `saveable` is called in StateKeeperExtTest.kt rg --type kotlin --no-heading --line-number 'saveable' state-keeper/src/commonTest/kotlin/com/arkivanov/essenty/statekeeper/StateKeeperExtTest.ktLength of output: 1064
Script:
#!/bin/bash # Description: Extract the full lines of code containing the `saveable` function calls in the identified files to verify the new function signature. # Extract full lines of code containing `saveable` function calls in StateKeeperExt.kt sed -n '25p;53p;59p;78p;85,86p;90p;93p;110p;115p' state-keeper/src/commonMain/kotlin/com/arkivanov/essenty/statekeeper/StateKeeperExt.kt # Extract full lines of code containing `saveable` function calls in StateKeeperExtTest.kt sed -n '12p;26p;40p;46p' state-keeper/src/commonTest/kotlin/com/arkivanov/essenty/statekeeper/StateKeeperExtTest.ktLength of output: 989
Script:
#!/bin/bash # Description: Extract a few lines before and after each occurrence of `saveable` to capture the full function call context. # Extract context around `saveable` function calls in StateKeeperExt.kt rg --context 2 --type kotlin 'saveable' state-keeper/src/commonMain/kotlin/com/arkivanov/essenty/statekeeper/StateKeeperExt.kt # Extract context around `saveable` function calls in StateKeeperExtTest.kt rg --context 2 --type kotlin 'saveable' state-keeper/src/commonTest/kotlin/com/arkivanov/essenty/statekeeper/StateKeeperExtTest.ktLength of output: 2469
Summary by CodeRabbit
New Features
saveable
functions to replacewithSavedState
, providing more flexible state-saving capabilities forStateKeeper
andStateKeeperOwner
.Tests
saveable
functions correctly save and restore state.