MS-1547 Module selection in pool validation - #1816
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The new module-selector result flow can treat Cancel/Back the same as Save and can race sync initiation before module selection is persisted, leading to incorrect or unnecessary syncing.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds a module-selection path to the subject pool validation flow so users can resolve “module mismatch” situations by opening the existing module selector UI from the validation screen.
Changes:
- Added a “Select modules” action (with translations) and surfaced it in the validation screen UI for the
ModuleMismatchstate. - Wired navigation from
validate-subject-pooltoModuleSelectorFragment, including result handling on return. - Updated
module-selectorto finish with aModuleSelectorResultwhen dismissing.
File summaries
| File | Description |
|---|---|
| infra/resources/src/main/res/values/strings.xml | Adds “Select modules” string. |
| infra/resources/src/main/res/values-fr/strings.xml | Adds French translation for “Select modules”. |
| infra/resources/src/main/res/values-am-rET/strings.xml | Adds Amharic translation for “Select modules”. |
| feature/validate-subject-pool/src/main/res/navigation/graph_validate_subject_pool.xml | Adds nav destination/action for module selection screen. |
| feature/validate-subject-pool/src/main/res/layout/fragment_validate_subject_pool.xml | Adds “Select modules” button to the validation actions block. |
| feature/validate-subject-pool/src/main/res/layout-land/fragment_validate_subject_pool.xml | Adds landscape equivalent “Select modules” button. |
| feature/validate-subject-pool/src/main/java/com/simprints/feature/validatepool/screen/ValidateSubjectPoolFragment.kt | Shows the new action for module mismatch and triggers work when the module selector returns. |
| feature/validate-subject-pool/build.gradle.kts | Adds dependency on :feature:module-selector. |
| feature/module-selector/src/main/java/com/simprints/feature/moduleselector/ModuleSelectorResult.kt | Introduces a result type to return from module selector. |
| feature/module-selector/src/main/java/com/simprints/feature/moduleselector/ModuleSelectorFragment.kt | Finishes with ModuleSelectorResult when dismissing/backing out. |
Review details
Suppressed comments (1)
feature/module-selector/src/main/java/com/simprints/feature/moduleselector/ModuleSelectorFragment.kt:113
- ModuleSelectorEffects.Dismiss is emitted for both Cancel and Save actions, but is now handled by finishWithResult(..., ModuleSelectorResult). When used as a child screen, this makes Cancel indistinguishable from Save to the parent, and can cause the parent flow to proceed (e.g., start syncing) even when the user cancelled. Consider introducing separate effects (e.g., Dismiss, FinishSaved) and only calling finishWithResult for the Save/confirm path.
private fun handleEffect(effect: ModuleSelectorEffects) = when (effect) {
ModuleSelectorEffects.Dismiss -> findNavController().finishWithResult(this, ModuleSelectorResult)
is ModuleSelectorEffects.ShowPassword -> {
- Files reviewed: 10/10 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
f5332f2 to
23294bd
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The updated module-save flow can leave the UI without a result and/or persist changes after dismissal due to lifecycle-detached work and missing failure/in-flight handling in saveModules().
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 13/13 changed files
- Comments generated: 1
- Review effort level: Lite
23294bd to
b9fa27a
Compare
b9fa27a to
d5e6b05
Compare
d5e6b05 to
64358fc
Compare
|
Uncovered lines are the "result" and contract definitions. |
64358fc to
9bbee77
Compare
9bbee77 to
d63469f
Compare
d63469f to
73aff84
Compare
337515c to
82badfd
Compare
… subject validation screen
82badfd to
b1a727a
Compare
|



JIRA ticket
Will be released in: 2027.1.0
Notable changes
Testing guidance
Additional work checklist