[PM-32122] Add cookie acquisition navigation#6529
Conversation
|
Great job! No new security vulnerabilities introduced in this pull request |
app/src/main/kotlin/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavScreen.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavViewModel.kt
Outdated
Show resolved
Hide resolved
app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavViewModelTest.kt
Outdated
Show resolved
Hide resolved
app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavViewModelTest.kt
Outdated
Show resolved
Hide resolved
app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/debugmenu/DebugMenuViewModelTest.kt
Outdated
Show resolved
Hide resolved
1490522 to
480eeb4
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #6529 +/- ##
==========================================
+ Coverage 86.37% 86.38% +0.01%
==========================================
Files 802 799 -3
Lines 56993 57000 +7
Branches 8245 8253 +8
==========================================
+ Hits 49227 49239 +12
+ Misses 4901 4895 -6
- Partials 2865 2866 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
17fab33 to
839639c
Compare
|
Claude finished @SaintPatrck's task in 4m 26s —— View job Code Review: PM-32122 Add cookie acquisition navigationReviewed commit: OverviewThis PR adds cookie acquisition as a top-level destination in the outer NavHost, wires MainViewModel to monitor cookie acquisition readiness, handles deeplink callbacks for cookie results, and adds debug menu controls. Review SummaryNo issues found. This is a clean, well-structured implementation that follows established codebase patterns. Key ObservationsArchitecture -- Cookie acquisition is correctly placed as a top-level NavHost destination (alongside root navigation and debug menu), preventing interference with the state-based navigation in Navigation safety -- The Reactive flow design -- The BackgroundEvent on NavigateBack -- Deeplink isolation -- Cookie callbacks ( Test coverage -- Comprehensive tests cover the positive navigation case, negative (null request) case, BackHandler behavior, NavigateBack event propagation, cookie callback routing in AuthCallbackViewModel, and debug menu trigger. Prior Review FeedbackAll feedback from previous review rounds has been addressed: Reviewed by Claude (automated review) |
...lin/com/x8bit/bitwarden/ui/platform/feature/cookieacquisition/CookieAcquisitionNavigation.kt
Show resolved
Hide resolved
| * Navigate back, dismissing the cookie acquisition screen. | ||
| * | ||
| * Implements [BackgroundEvent] because the cookie callback result may arrive while | ||
| * the screen is not resumed (e.g. returning from a Custom Tab browser session). |
| // fadeIn instead. | ||
| // The MigrateToMyItemsGraphRoute and ResetPasswordRoute animation | ||
| // should stay but due to an issue when combining certain animations, | ||
| // we are just using a fadeIn instead. |
There was a problem hiding this comment.
Are these changes needed?
There was a problem hiding this comment.
No. Leftover from experimenting with declaring acquisition destination in the RootNav. Extracted to #6553.
...lin/com/x8bit/bitwarden/ui/platform/feature/cookieacquisition/CookieAcquisitionScreenTest.kt
Outdated
Show resolved
Hide resolved
| // We skip the first 2 events because they are the default appTheme and appLanguage | ||
| awaitItem() | ||
| awaitItem() | ||
| skipItems(2) |
Add cookie acquisition as a top-level destination in the outer NavHost (alongside root navigation and debug menu) so it can overlay the app without interfering with the state-based navigation in RootNavScreen. MainViewModel monitors the cookie acquisition request flow combined with user/vault state and emits a one-shot NavigateToCookieAcquisition event when conditions are met. Dismissal is handled by the child CookieAcquisitionViewModel via a NavigateBack event (implementing BackgroundEvent to survive Custom Tab lifecycle transitions), which triggers popBackStack through an onDismiss callback. Wire the AuthCallback deeplink so cookie results from the browser are delivered back to the auth repository's cookie callback result flow. Add debug menu controls for triggering cookie acquisition manually during development. Co-Authored-By: Claude <noreply@anthropic.com>
This commit moves the call to `onSplashScreenRemoved()` inside the `composableWithSlideTransitions` block for the `CookieAcquisitionRoute`. This change ensures that the splash screen is only hidden when the cookie acquisition screen is actually being composed, improving the visual flow and preventing the splash screen from being dismissed prematurely.
839639c to
7fb9d1b
Compare
...lin/com/x8bit/bitwarden/ui/platform/feature/cookieacquisition/CookieAcquisitionNavigation.kt
Outdated
Show resolved
Hide resolved
…okieacquisition/CookieAcquisitionNavigation.kt Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
|
Thanks @david-livefront |

🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-32122
📔 Objective
Add cookie acquisition as a top-level destination in the outer NavHost (alongside root navigation and debug menu) so it can overlay the app without interfering with the state-based navigation in RootNavScreen.
MainViewModel monitors the cookie acquisition request flow combined with user/vault state and emits a one-shot NavigateToCookieAcquisition event when conditions are met. Dismissal is handled by the child CookieAcquisitionViewModel via a NavigateBack event (implementing BackgroundEvent to survive Custom Tab lifecycle transitions), which triggers popBackStack through an onDismiss callback.
Wire the AuthCallback deeplink so cookie results from the browser are delivered back to the auth repository's cookie callback result flow.
Add debug menu controls for triggering cookie acquisition manually during development.
🧪 Testing
adb shell am start -a android.intent.action.VIEW -d "bitwarden://sso_cookie_vendor?cookie=value&d=1"— verify the screen auto-dismisses📸 Screenshots
Screen_recording_20260212_160150.mp4