[Hack Week] Address PR review fixes for troubleshooting screen#15615
[Hack Week] Address PR review fixes for troubleshooting screen#15615hichamboushaba wants to merge 10 commits intohack-week/troubleshooting-screen-m5-fixesfrom
Conversation
Generated by 🚫 Danger |
|
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## hack-week/troubleshooting-screen-m5-fixes #15615 +/- ##
===============================================================================
- Coverage 39.62% 39.62% -0.01%
+ Complexity 11363 11356 -7
===============================================================================
Files 2263 2264 +1
Lines 130681 130680 -1
Branches 18321 18332 +11
===============================================================================
- Hits 51781 51780 -1
+ Misses 73605 73604 -1
- Partials 5295 5296 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
da5d80b to
e50a06b
Compare
- Stub selectedSite.get() to return a real SiteModel in tests - Store selectedSite.get() in a local val to avoid double call - Add App Passwords suppression tests for all three use cases - Remove unused wooCommerceStore field from StoreConnectionCheckUseCaseTest - Fix comment casing to use GIVEN/WHEN/THEN
e50a06b to
79c4b93
Compare
There was a problem hiding this comment.
Pull request overview
This PR iterates on the Troubleshoot Connection feature by applying review feedback: improving dark-mode icon contrast, renaming the feature from “ConnectivityTool” to “TroubleshootConnection” across UI/navigation/tests, and refining “Jetpack not connected” detection to rely on API error codes (while suppressing that detection for Application Password sites).
Changes:
- Updated Troubleshoot Connection UI icons to tint using
color_on_surfaceto ensure visibility in dark mode. - Renamed ConnectivityTool → TroubleshootConnection across fragments/screens/viewmodels, tests, and navigation actions/destinations.
- Adjusted connectivity check error classification to detect Jetpack-related failures via API
errorCode(unknown_token/invalid_blog) and added/updated unit tests accordingly.
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| WooCommerce/src/main/kotlin/com/woocommerce/android/ui/troubleshooting/TroubleshootConnectionScreen.kt | Uses color_on_surface for icon tint; renames screen composables to TroubleshootConnection. |
| WooCommerce/src/main/kotlin/com/woocommerce/android/ui/troubleshooting/TroubleshootConnectionFragment.kt | Renames fragment + wires TroubleshootConnection screen/viewmodel. |
| WooCommerce/src/main/kotlin/com/woocommerce/android/ui/troubleshooting/TroubleshootConnectionViewModel.kt | Renames viewmodel and keeps check orchestration consistent with new naming. |
| WooCommerce/src/main/kotlin/com/woocommerce/android/ui/troubleshooting/ConnectivityCheckCardData.kt | Updates imports/packages to troubleshooting namespace. |
| WooCommerce/src/main/kotlin/com/woocommerce/android/ui/troubleshooting/TechnicalDetailsBottomSheet.kt | Package rename to troubleshooting namespace. |
| WooCommerce/src/main/kotlin/com/woocommerce/android/ui/troubleshooting/useCases/JetpackErrorUtils.kt | Introduces helpers to identify Jetpack-related errors via API error codes. |
| WooCommerce/src/main/kotlin/com/woocommerce/android/ui/troubleshooting/useCases/StoreConnectionCheckUseCase.kt | Uses measureTimedValue, avoids multiple selectedSite.get(), switches Jetpack detection to API error codes + app-password suppression. |
| WooCommerce/src/main/kotlin/com/woocommerce/android/ui/troubleshooting/useCases/StoreProductsCheckUseCase.kt | Same as above for products check: timing + Jetpack error detection via API error code. |
| WooCommerce/src/main/kotlin/com/woocommerce/android/ui/troubleshooting/useCases/StoreOrdersCheckUseCase.kt | Adds orders check use case under troubleshooting with updated Jetpack detection + timing. |
| WooCommerce/src/main/kotlin/com/woocommerce/android/ui/troubleshooting/useCases/WPComConnectionCheckUseCase.kt | Adds WP.com connectivity check under troubleshooting with timing via measureTimedValue. |
| WooCommerce/src/main/kotlin/com/woocommerce/android/ui/troubleshooting/useCases/InternetConnectionCheckUseCase.kt | Adds internet connectivity check under troubleshooting with timing via measureTimedValue. |
| WooCommerce/src/main/kotlin/com/woocommerce/android/ui/troubleshooting/useCases/ErrorDetailsFormatter.kt | Package rename to troubleshooting namespace. |
| WooCommerce/src/main/kotlin/com/woocommerce/android/ui/prefs/MainSettingsFragment.kt | Updates settings navigation action to TroubleshootConnection destination. |
| WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/list/OrderListFragment.kt | Updates orders banner navigation to TroubleshootConnection destination. |
| WooCommerce/src/main/res/navigation/nav_graph_settings.xml | Renames settings action + fragment destination id/name for TroubleshootConnection. |
| WooCommerce/src/main/res/navigation/nav_graph_main.xml | Renames orders action + fragment destination id/name for TroubleshootConnection. |
| WooCommerce/src/test/kotlin/com/woocommerce/android/ui/troubleshooting/TroubleshootConnectionViewModelTest.kt | Updates test package/class names and references to TroubleshootConnection types. |
| WooCommerce/src/test/kotlin/com/woocommerce/android/ui/troubleshooting/useCases/StoreConnectionCheckUseCaseTest.kt | Updates tests for API error-code-based Jetpack detection + app-password suppression. |
| WooCommerce/src/test/kotlin/com/woocommerce/android/ui/troubleshooting/useCases/StoreOrdersCheckUseCaseTest.kt | Adds/updates tests for Jetpack detection using WPAPI network errorCode + suppression. |
| WooCommerce/src/test/kotlin/com/woocommerce/android/ui/troubleshooting/useCases/StoreProductsCheckUseCaseTest.kt | Adds/updates tests for Jetpack detection using Woo API apiErrorCode + suppression. |
| WooCommerce/src/test/kotlin/com/woocommerce/android/ui/troubleshooting/useCases/WPComConnectionCheckUseCaseTest.kt | Package/import updates for troubleshooting rename. |
| WooCommerce/src/test/kotlin/com/woocommerce/android/ui/troubleshooting/useCases/InternetConnectionCheckUseCaseTest.kt | Package/import updates for troubleshooting rename. |
| WooCommerce/src/test/kotlin/com/woocommerce/android/ui/troubleshooting/useCases/ErrorDetailsFormatterTest.kt | Package rename to troubleshooting namespace. |
| WooCommerce/src/main/kotlin/com/woocommerce/android/ui/connectivitytool/useCases/WPComConnectionCheckUseCase.kt | Removes old connectivitytool WP.com check use case (moved/renamed). |
| WooCommerce/src/main/kotlin/com/woocommerce/android/ui/connectivitytool/useCases/StoreOrdersCheckUseCase.kt | Removes old connectivitytool orders check use case (moved/renamed). |
| WooCommerce/src/main/kotlin/com/woocommerce/android/ui/connectivitytool/useCases/InternetConnectionCheckUseCase.kt | Removes old connectivitytool internet check use case (moved/renamed). |
Comments suppressed due to low confidence (2)
WooCommerce/src/test/kotlin/com/woocommerce/android/ui/troubleshooting/useCases/StoreConnectionCheckUseCaseTest.kt:46
- Test name grammar: use "a GENERIC_ERROR" instead of "an GENERIC_ERROR" for readability/searchability of test cases.
WooCommerce/src/test/kotlin/com/woocommerce/android/ui/troubleshooting/useCases/StoreConnectionCheckUseCaseTest.kt:173 - Test name grammar: use "a TIMEOUT" instead of "an TIMEOUT" for readability/searchability of test cases.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Description
Note
Addresses PR review feedback from the troubleshooting screen PRs with the following fixes:
Key Changes:
color_on_surfaceinstead of hardcodedwoo_blackfor check icons, ensuring proper visibility in dark mode.ConnectivityTool→TroubleshootConnectionacross Fragment, Screen, ViewModel, tests, and navigation graphs for consistency with the feature's user-facing name. Also renamed theconnectivitytoolpackage totroubleshooting.errorCode(unknown_tokenorinvalid_blog). Ensured this detection explicitly skips if the connection uses App Passwords.selectedSite.get(). Added App Passwords suppression tests for all three use cases. Avoided callingselectedSite.get()twice in production code.measureTimedValue: Replaced manualSystem.currentTimeMillis()timing with Kotlin'smeasureTimedValueacross all five use cases.Test Steps
RELEASE-NOTES.txtif necessary. Use the "[Internal]" label for non-user-facing changes.