Skip to content
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

Change special folder success to loading and change navigation #7569

Merged
merged 4 commits into from
Jan 26, 2024

Conversation

wmontwe
Copy link
Member

@wmontwe wmontwe commented Jan 26, 2024

Don't allow navigating back to transient special folders screen

Fixes #7553

@wmontwe wmontwe requested a review from cketti as a code owner January 26, 2024 12:33
Copy link
Member

@cketti cketti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be consistent with the other transient screens the "Next" button should only be shown when the user has to manually specify the folder mapping.

@wmontwe wmontwe force-pushed the change-special-folder-success-to-loading branch from a1e3413 to 6b5d1ca Compare January 26, 2024 15:38
@wmontwe wmontwe requested a review from cketti January 26, 2024 15:38
@@ -129,23 +129,14 @@ class SpecialFoldersViewModel(

private fun navigateNext() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By changing this to fun navigateNext(isManualSetup: Boolean) we can pass in the appropriate value at the call sites and don't need State.isManualSetup.

@@ -33,7 +33,7 @@ class SpecialFoldersScreenKtTest : ComposeTest() {
assertThat(onNextCounter).isEqualTo(0)
assertThat(onBackCounter).isEqualTo(0)

viewModel.effect(Effect.NavigateNext)
viewModel.effect(Effect.NavigateNext(true))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use a named argument here and in all the other Effect.NavigateNext constructor calls in tests.

Copy link
Member Author

@wmontwe wmontwe Jan 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You always have fresh ideas, why not write them down for everyone to participate or automate this, thanks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some things are hard to write down in a formal rule. But it always comes down to "how easy is this code to read?".

Easy to read: enableProgressIndicator(true)
Somewhat verbose, but fine: enableProgressIndicator(enable = true)
Really verbose: enableProgressIndicator(enableProgressIndicator = true)

Leaves the reader wondering about the parameter: Effect.NavigateNext(true)
The reader has a better idea what the argument is about: Effect.NavigateNext(isManualSetup = true)

@wmontwe wmontwe merged commit 4dad531 into main Jan 26, 2024
2 checks passed
@wmontwe wmontwe deleted the change-special-folder-success-to-loading branch January 26, 2024 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Account setup] Don't allow navigating back to transient special folders screen
2 participants