-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Jetpack connection UI #22079
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
Jetpack connection UI #22079
Conversation
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.
Pull Request Overview
This PR introduces a new Jetpack connection UI that guides users through the process of connecting their self-hosted WordPress site to Jetpack. The implementation includes a step-by-step connection flow with visual status indicators and error handling.
- Adds a complete Jetpack connection UI with ViewModel, Activity, and Compose screen
- Implements a multi-step connection process with status tracking and error handling
- Provides user feedback through animated UI states and confirmation dialogs
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
File | Description |
---|---|
strings.xml | Adds localized strings for the Jetpack connection UI |
WPMainActivity.java | Temporarily launches the new Jetpack connection activity for testing |
JetpackConnectionViewModel.kt | Implements the connection logic and state management |
JetpackConnectionScreen.kt | Provides the Compose UI for the connection flow |
JetpackConnectionActivity.kt | Activity that hosts the connection screen |
ScreenWithTopAppBarM3.kt | Reusable Compose component for screens with top app bars |
AndroidManifest.xml | Registers the new JetpackConnectionActivity |
...Press/src/main/java/org/wordpress/android/ui/jetpackconnection/JetpackConnectionViewModel.kt
Outdated
Show resolved
Hide resolved
...Press/src/main/java/org/wordpress/android/ui/jetpackconnection/JetpackConnectionViewModel.kt
Outdated
Show resolved
Hide resolved
...Press/src/main/java/org/wordpress/android/ui/jetpackconnection/JetpackConnectionViewModel.kt
Outdated
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/ui/jetpackconnection/JetpackConnectionScreen.kt
Outdated
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/ui/jetpackconnection/JetpackConnectionScreen.kt
Outdated
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/ui/main/WPMainActivity.java
Show resolved
Hide resolved
…nto feature/jetpack-connection-ui
|
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.
LGTM!
9e9bbad
into
feature/jetpack-connection-feature-branch
* Jetpack connection UI (#22079) * Added shell for JetpackConnectionViewModel * Added shell for JetpackConnectionScreen * Fleshed out JetpackConnectionScreen * Minor tweaks * Added canInitiateJetpackConnection * Updated comment * Renamed const * Removed wpApiClient * Added activity shell * Added activity to manifest * Handle close * Pass states rather than the view model * Pass states rather than the view model,p2 * Dummy code to simulate login * Dummy code to simulate login, p2 * Added done button * Animate Done button, added Failed status * Use light MaterialTheme.colorScheme.error color background for failed steps * Animate changes to ConnectionStepItem * Added startNextStep * Added startNextStep, p2 * Added startNextStep, p3 * Fixed UI testing * Fixed UI testing, p2 * Changed color for completed and in-progress cards * Changed color for completed and in-progress cards again * Removed elevation and changed card to column * First pass at Retry * Second pass at Retry * Third pass at Retry * Added error states * Combined states * Fixed Detekt errors * Replaced hard-coded hex color values * Minor formatting changes * Minor formatting changes, p2 * Minor formatting changes, p3 * Updated preview to use JetpackConnectionScreen * Simplified ConnectionStepItem * Moved Screen to ScreenWithTopAppBarM3 * Added modifier * Changed two icons * Fix the done/retry button to the bottom * Removed the heading and changed the screen title * Increase elevation of in-progress step, remove elevation animation * First pass at confirming cancellation * Second pass at confirming cancellation * Fixed detekt warnings * Fixed detekt warnings * Changed fun name * Fixed isActive check * Use ErrorEvent instead of a string * Fixed new Detekt warnings * Renamed variable * Retry starts at the failed step * Moved getNextStep to its own fun * Simplified retrying from step * Added optional message to ErrorType * Updated wp.com error message * Moved color constants to color resources * Use existing color resources for in-progress step * Don't use !! for selected site * Replaced throwing exception with error() to resolve Detekt warning * Simplified JetpackConnectionViewModel * Simplified JetpackConnectionScreen * Simplified JetpackConnectionActivity * Added Jetpack Connection feature flag * Jetpack Connection cleanup (#22104) * Rely on isUsingSelfHostedRestApi to determine whether we can use the new JP REST connection * Removed starting the flow from the main activity * Launch the new flow from stats if available * Simplified canInitiateJetpackConnection * Renamed feature to Experimental Jetpack *REST* Connection to avoid confusion with existing web-based flow * Fixed Detekt line length warnings * Add "Simulated" to screen title to make it clear there's nothing happening * Renamed experimental key * Jetpack connect start button (#22110) * Fixed title casing * Added start button * Wired up start button * Reset uiEvent when starting flow, removed unused init
* Jetpack connection UI (#22079) * Added shell for JetpackConnectionViewModel * Added shell for JetpackConnectionScreen * Fleshed out JetpackConnectionScreen * Minor tweaks * Added canInitiateJetpackConnection * Updated comment * Renamed const * Removed wpApiClient * Added activity shell * Added activity to manifest * Handle close * Pass states rather than the view model * Pass states rather than the view model,p2 * Dummy code to simulate login * Dummy code to simulate login, p2 * Added done button * Animate Done button, added Failed status * Use light MaterialTheme.colorScheme.error color background for failed steps * Animate changes to ConnectionStepItem * Added startNextStep * Added startNextStep, p2 * Added startNextStep, p3 * Fixed UI testing * Fixed UI testing, p2 * Changed color for completed and in-progress cards * Changed color for completed and in-progress cards again * Removed elevation and changed card to column * First pass at Retry * Second pass at Retry * Third pass at Retry * Added error states * Combined states * Fixed Detekt errors * Replaced hard-coded hex color values * Minor formatting changes * Minor formatting changes, p2 * Minor formatting changes, p3 * Updated preview to use JetpackConnectionScreen * Simplified ConnectionStepItem * Moved Screen to ScreenWithTopAppBarM3 * Added modifier * Changed two icons * Fix the done/retry button to the bottom * Removed the heading and changed the screen title * Increase elevation of in-progress step, remove elevation animation * First pass at confirming cancellation * Second pass at confirming cancellation * Fixed detekt warnings * Fixed detekt warnings * Changed fun name * Fixed isActive check * Use ErrorEvent instead of a string * Fixed new Detekt warnings * Renamed variable * Retry starts at the failed step * Moved getNextStep to its own fun * Simplified retrying from step * Added optional message to ErrorType * Updated wp.com error message * Moved color constants to color resources * Use existing color resources for in-progress step * Don't use !! for selected site * Replaced throwing exception with error() to resolve Detekt warning * Simplified JetpackConnectionViewModel * Simplified JetpackConnectionScreen * Simplified JetpackConnectionActivity * Added Jetpack Connection feature flag * Jetpack Connection cleanup (#22104) * Rely on isUsingSelfHostedRestApi to determine whether we can use the new JP REST connection * Removed starting the flow from the main activity * Launch the new flow from stats if available * Simplified canInitiateJetpackConnection * Renamed feature to Experimental Jetpack *REST* Connection to avoid confusion with existing web-based flow * Fixed Detekt line length warnings * Add "Simulated" to screen title to make it clear there's nothing happening * Renamed experimental key * Fixed title casing * Added start button * Wired up start button * Reset uiEvent when starting flow, removed unused init * Removed code for steps other than Step 1 (login to wp.com) * Removed code for steps other than Step 1 (login to wp.com), p2 * First attempt at wp.com login * Remove automatic step completion * Use correct discovery url * Added error type for discovery failure * First pass at launching and awaiting password flow * Retain when waiting for password flow * First pass at switching from app password to wp.com login (broken) * Second pass at switching from app password to wp.com login (broken) * Use showSignInForResultWpComOnly * Check for account token * Add sign-in flow for JP rest connect * Added error type for login wp.com failure, minor code reformatting * Don't show "Failed" status for errors, only show error message * Removed unused account store and deleted commented code * Added comment to LoginActivity * Added comment to loginWpCom * Fixed Detekt warning * Added comment to ActivityLauncher and shortened function name * Don't expose isWaitingForWPComLogin
Closes #CMM-641
This PR implements the UI for the Rest-based Jetpack connection flow. Note there is no networking logic here - that will come later - and there are a number of
TODOs
. This is being merged into a feature branch so end users won't see it until the feature branch is eventually merged.For now, when the main activity starts I automatically show the connection flow. This will be removed before merging.
To test
ui.mp4