CCCT-2440 Connect App Launch For Remaining Pages And Back Navigation#3756
Conversation
[AI] Routed the delivery and learning progress fragments through the silent launch path by extracting the shared progress-dialog and outcome-routing wiring into ConnectAppLaunchUiController and delegating all three Connect launch surfaces to it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
[AI] Addressed launch-controller review findings by injecting ConnectAppLauncher, extracting a pure LaunchProgressMapper with unit tests, self-dismissing the dialog via a view-lifecycle observer, and exposing named learn/delivery launch entrypoints. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
[AI] Fixed the silent launch path dropping the "View Job Status" redirect by launching Home for result and routing REDIRECT_TO_CONNECT_OPPORTUNITY_INFO to the seated app's job status page, mirroring DispatchActivity's legacy handling. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
[AI] Fixed Connect app back navigation so app Home backs out to the opportunities list (ending the app session) and "View Job Status" opens the job-status page on top of the live Home, preserving back-to-Home; reworked the prior for-result redirect handling accordingly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
[AI] Addressed review feedback: renamed ConnectAppLaunchUiController to ConnectAppLaunchController, drove the launch dialog from the full LaunchDialogState, removed dead code (the unused launchHome and password-override helpers), removed the "silent" wording, and tightened comments. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Suggested Review Order
|
📝 WalkthroughWalkthroughThis PR refactors the Connect app launch flow by extracting repeated launch orchestration logic from multiple fragments into a shared Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app/src/org/commcare/activities/HomeScreenBaseActivity.java`:
- Around line 589-596: In userPressedOpportunityStatus() in
HomeScreenBaseActivity, handle the null case from
ConnectJobHelper.INSTANCE.getJobForSeatedApp(this) by adding user feedback
and/or logging: if job is null, call Android Toast (or Snackbar) to inform the
user (e.g., "No active job found") and add a process or Android log entry (Log.w
or your logger) noting that getJobForSeatedApp returned null; retain the
existing call to ConnectNavHelper.INSTANCE.goToActiveInfoForJob(this, job, true)
when job is non-null.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: c93923c9-e88c-4f39-907f-e8e2e6d2f5c3
📒 Files selected for processing (10)
RELEASES.mdapp/src/org/commcare/activities/HomeScreenBaseActivity.javaapp/src/org/commcare/connect/ConnectAppLaunchController.ktapp/src/org/commcare/connect/ConnectAppUtils.ktapp/src/org/commcare/connect/ConnectNavHelper.ktapp/src/org/commcare/fragments/connect/ConnectDeliveryProgressFragment.javaapp/src/org/commcare/fragments/connect/ConnectJobsListsFragment.javaapp/src/org/commcare/fragments/connect/ConnectLearningProgressFragment.javaapp/unit-tests/src/org/commcare/connect/LaunchProgressMapperTest.ktdocs/commcare/login-engine.md
💤 Files with no reviewable changes (1)
- app/src/org/commcare/connect/ConnectAppUtils.kt
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## CCCT-2439-connect-login-silent-launch-path #3756 +/- ##
=============================================================================
Coverage 25.61% 25.62%
Complexity 4390 4390
=============================================================================
Files 953 954 +1
Lines 57779 57806 +27
Branches 6915 6921 +6
=============================================================================
+ Hits 14799 14811 +12
- Misses 41152 41167 +15
Partials 1828 1828 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
[AI] Logged a non-fatal workflow entry when "View Job Status" is pressed but no Connect job is found for the seated app, instead of silently doing nothing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…om:dimagi/commcare-android into CCCT-2440-login-silent-launch-path-for-remaining-connect-pages
CCCT-2440
Product Description
Extends the no-login-screen Connect app launch to the remaining priority entry points and makes back navigation between the app and Connect consistent:
Screen_Recording_20260609_113107_CommCare.Debug.mp4
Technical Summary
ConnectJobsListsFragmentinto a sharedConnectAppLaunchController, and routes all three Connect launch surfaces (jobs list, delivery progress, learning progress) through it.RESULT_CANCELED) ends the app session and returns to the opportunities list viaConnectNavHelper.goToConnectJobsList(clearTop = true).userPressedOpportunityStatus("View Job Status") now launches the job-status page on top of the still-live home instead of finishing it, preserving back-to-home.LaunchProgressMapper→LaunchDialogState; dialog cleanup is handled by a view-lifecycle observer so callers don't manage it.HomeScreenBaseActivity.launchHomeandConnectAppUtils.getPasswordOverride/shouldOverridePassword).Safety Assurance
Safety story
What gives confidence:
LaunchProgressMapper,ConnectAppLauncher, andLaunchOutcomeRouterhave JVM unit-test coverage.Risks to review:
userPressedOpportunityStatusis shared with the legacyLoginActivitylaunch path; it now keeps home alive and launches the job page on top for that path too.ConnectAppUtils.getPasswordOverride/shouldOverridePasswordafter confirming no remaining source callers.Automated test coverage
LaunchProgressMapperTestcovers the per-phase dialog state mapping (seating / signing-in / syncing, percent handling, message override).ConnectAppLauncherTestandLaunchOutcomeRouterTestcover the launcher sequencing and outcome routing the controller delegates to.