-
Notifications
You must be signed in to change notification settings - Fork 1.3k
CMM-1136 Select newly added self-hosted site after login #22482
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
Conversation
Generated by 🚫 Danger |
This comment was marked as outdated.
This comment was marked as outdated.
|
| App Name | Jetpack | |
| Flavor | Jalapeno | |
| Build Type | Debug | |
| Version | pr22482-2b24166 | |
| Commit | 2b24166 | |
| Direct Download | jetpack-prototype-build-pr22482-2b24166.apk |
|
| App Name | WordPress | |
| Flavor | Jalapeno | |
| Build Type | Debug | |
| Version | pr22482-2b24166 | |
| Commit | 2b24166 | |
| Direct Download | wordpress-prototype-build-pr22482-2b24166.apk |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## trunk #22482 +/- ##
=======================================
Coverage 38.94% 38.94%
=======================================
Files 2189 2189
Lines 105355 105356 +1
Branches 14946 14946
=======================================
+ Hits 41034 41035 +1
Misses 60890 60890
Partials 3431 3431 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
When adding a self-hosted site while logged into WordPress.com, the main activity now correctly switches to show the newly added site instead of continuing to show the previously selected WordPress.com site. This fix handles both login flows by tracking site IDs before navigation and detecting new sites on resume. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
ecf37d1 to
70d8ff5
Compare
WordPress/src/main/java/org/wordpress/android/ui/main/WPMainActivity.java
Fixed
Show fixed
Hide fixed
When a self-hosted site is added, automatically select it by detecting non-WP.com sites in the OnSiteChanged event. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace the inelegant onSiteChanged approach with explicit site ID passing: - Username/password login: setSite(data) in ADD_ACCOUNT case - Application password login: Pass newSiteLocalId via intent to WPMainActivity - Remove the broad "select any self-hosted site" code from onSiteChanged Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove the intent extra after selecting the site to prevent re-selecting on activity recreation (e.g., rotation). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove sSiteIdsBeforeNavigation and selectNewlyAddedSiteIfNeeded() as they're no longer needed. Site selection is now handled explicitly via: - setSite(data) for username/password login - ARG_SELECTED_SITE intent extra for application password login Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Claude finished @nbradbury's task in 1m 13s —— View job Code Review for PR #22482I've completed a comprehensive review of the changes to select newly added self-hosted sites after login. Tasks
SummaryThis PR implements site selection after adding a self-hosted site via application password login. The implementation is clean and well-structured, with proper test coverage. The changes follow good architectural patterns and maintain consistency with the existing codebase. Key ChangesThe PR modifies the application password login flow to pass the newly added site's local ID to
Code Quality: ✅ ExcellentStrengths:
Minor Observations:
Security:
|
|
adalpari
left a comment
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 and works as expected! 🚢 it!





Partially resolves CMM-1136
Prior to this PR, if you're logged into wp.com and add a self-hosted site, the previously selected wp.com site would remain selected. This PR makes the added self-hosted site the selected site after logging into it.
To test: