Skip to content

[WIP] MS-1451 Module selection rework - #1790

Draft
luhmirin-s wants to merge 6 commits into
mainfrom
feature/MS-1451-module-selection-rework
Draft

[WIP] MS-1451 Module selection rework#1790
luhmirin-s wants to merge 6 commits into
mainfrom
feature/MS-1451-module-selection-rework

Conversation

@luhmirin-s

@luhmirin-s luhmirin-s commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

JIRA ticket
Will be released in: 2027.1.0

TBD, for now just running the copilot review

Notable changes

  • Re-implemented module selection screen in a reuseable module. Preserved features include:
    • Settings lock overlay
    • Showing list of modules with clear indication of which ones are selected
    • Text search option to filter module list
    • Sync on confirm
  • Changes compared to the old version:
    • Selected modules are marked with "selected checkbox" instead of chip
    • Added a toggle to filter only "selected" modules
    • "Confirm" button is enabled only when valid amount of modules is selected, otherwise and error messages is displayed
image image image image
  • Additionally to the functional rework this PR is an example of potential MVI architecture that we might use in the future refactoring:
    • ModuleSelectorMvi.kt contains definitions of the UI state, action and side effects present on the screen
    • ModuleSelectorViewModel.kt handles the UI actions in vm.onAction() and updates the state or emits side-effects accordingly
    • ModuleSelectorFragment.kt collects vm.state shared flow and renders the layout, collects vm.effects for side effects and sends user actions from view listeners to VM via vm.onAction().

Testing guidance

  • Module selection testiny cases + updated Appium tests.

Additional work checklist

  • Effect on other features and security has been considered
  • Design document marked as "In development" (if applicable)
  • External (Gitbook) and internal (Confluence) Documentation is up to date (or ticket created)
  • Test cases in Testiny are up to date (or ticket created)
  • Other teams notified about the changes (if applicable)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Reworks “module selection” by replacing the legacy dashboard module-selection screen with a new :feature:module-selector bottom-sheet dialog, while also relocating the settings-password dialog into :infra:ui-base for reuse. This aligns module selection with a dedicated feature module and updates navigation/resources accordingly.

Changes:

  • Added new :feature:module-selector module (UI, ViewModel, adapter, layouts) and wired it into the dashboard navigation graph.
  • Moved/centralized SettingsPasswordDialogFragment into :infra:ui-base with a new dialog layout + updated imports/usages.
  • Updated shared resources (strings + widget styles) and removed the legacy dashboard module-selection implementation and its tests/resources.

Reviewed changes

Copilot reviewed 46 out of 47 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
settings.gradle.kts Includes the new :feature:module-selector module in the Gradle settings.
infra/ui-base/src/test/java/com/simprints/infra/uibase/password/SettingsPasswordDialogFragmentTest.kt Adds an (ignored) test scaffold for the moved password dialog.
infra/ui-base/src/main/res/layout/dialog_settings_password_input.xml Adds the password input dialog layout used by the moved fragment.
infra/ui-base/src/main/java/com/simprints/infra/uibase/password/SettingsPasswordDialogFragment.kt Moves/repackages the password dialog into infra:ui-base and updates binding usage.
infra/ui-base/build.gradle.kts Enables ViewBinding via buildFeatures.viewBinding.
infra/resources/src/main/res/values/styles-widget.xml Adds a Simprints switch widget style + updates filled text input start icon tint.
infra/resources/src/main/res/values/strings.xml Adds module-selector UI strings (title, errors, labels).
infra/resources/src/main/res/values-om/strings.xml Adds Oromo translations for module-selector strings (partial).
infra/resources/src/main/res/values-fr/strings.xml Adds French translations for module-selector strings.
infra/resources/src/main/res/values-am/strings.xml Adds Amharic translations for module-selector strings.
infra/resources/src/main/res/values-am-rET/strings.xml Adds Amharic (ET) translations for module-selector strings.
feature/module-selector/src/main/res/layout/dialog_module_selector.xml Adds bottom-sheet dialog layout for module selection (list, search, toggle, lock overlay).
feature/module-selector/src/main/res/layout/dialog_module_selector_item.xml Adds list-row layout for selectable modules.
feature/module-selector/src/main/res/drawable/ic_overlay_lock.xml Adds lock overlay icon for the module selector.
feature/module-selector/src/main/java/com/simprints/feature/moduleselector/ModuleSelectorDialogViewModel.kt Implements selection/filtering/lock logic + saving and sync triggering.
feature/module-selector/src/main/java/com/simprints/feature/moduleselector/ModuleSelectorDialogFragment.kt Implements the bottom-sheet UI wiring (binding, adapter, state/effects collection).
feature/module-selector/src/main/java/com/simprints/feature/moduleselector/ModuleSelectorDialogContract.kt Defines dialog state/effects/actions models.
feature/module-selector/src/main/java/com/simprints/feature/moduleselector/adapter/ModuleSelectorViewHolder.kt Binds module/no-results rows and click handling.
feature/module-selector/src/main/java/com/simprints/feature/moduleselector/adapter/ModuleSelectorItem.kt Defines adapter item models (Module, NoResult).
feature/module-selector/src/main/java/com/simprints/feature/moduleselector/adapter/ModuleSelectorAdapter.kt Adds RecyclerView adapter with AsyncListDiffer.
feature/module-selector/src/main/AndroidManifest.xml Adds an (empty) manifest for the new feature module.
feature/module-selector/build.gradle.kts Declares the new feature module and its infra dependencies.
feature/module-selector/.gitignore Ignores the module’s build output.
feature/dashboard/src/test/java/com/simprints/feature/dashboard/settings/syncinfo/moduleselection/tools/ModuleQueryFilterTest.kt Removes legacy module-query filter unit tests.
feature/dashboard/src/test/java/com/simprints/feature/dashboard/settings/syncinfo/moduleselection/ModuleSelectionViewModelTest.kt Removes legacy module-selection ViewModel tests.
feature/dashboard/src/test/java/com/simprints/feature/dashboard/settings/syncinfo/moduleselection/ModuleSelectionFragmentTest.kt Removes legacy module-selection fragment test.
feature/dashboard/src/test/java/com/simprints/feature/dashboard/settings/password/SettingsPasswordDialogFragmentTest.kt Removes the old password-dialog test from dashboard.
feature/dashboard/src/main/res/xml/module_selection_chip.xml Removes legacy module-selection chip resource.
feature/dashboard/src/main/res/navigation/graph_dashboard.xml Switches module selection destination to the new dialog in :feature:module-selector.
feature/dashboard/src/main/res/layout/item_module.xml Removes legacy module item layout.
feature/dashboard/src/main/res/layout/fragment_sync_module_selection.xml Removes legacy module-selection fragment layout.
feature/dashboard/src/main/res/drawable/ic_close_chip.xml Removes legacy chip close icon.
feature/dashboard/src/main/java/com/simprints/feature/dashboard/settings/syncinfo/moduleselection/tools/ModuleQueryFilter.kt Removes legacy query filtering logic.
feature/dashboard/src/main/java/com/simprints/feature/dashboard/settings/syncinfo/moduleselection/tools/ModuleChipHelper.kt Removes legacy chip rendering helper.
feature/dashboard/src/main/java/com/simprints/feature/dashboard/settings/syncinfo/moduleselection/tools/ChipClickListener.kt Removes legacy chip click listener interface.
feature/dashboard/src/main/java/com/simprints/feature/dashboard/settings/syncinfo/moduleselection/ModuleSelectionViewModel.kt Removes legacy ViewModel implementation.
feature/dashboard/src/main/java/com/simprints/feature/dashboard/settings/syncinfo/moduleselection/ModuleSelectionQueryListener.kt Removes legacy query listener.
feature/dashboard/src/main/java/com/simprints/feature/dashboard/settings/syncinfo/moduleselection/ModuleSelectionFragment.kt Removes legacy module-selection fragment implementation.
feature/dashboard/src/main/java/com/simprints/feature/dashboard/settings/syncinfo/moduleselection/exceptions/TooManyModulesSelectedException.kt Removes legacy exception type.
feature/dashboard/src/main/java/com/simprints/feature/dashboard/settings/syncinfo/moduleselection/exceptions/NoModuleSelectedException.kt Removes legacy exception type.
feature/dashboard/src/main/java/com/simprints/feature/dashboard/settings/syncinfo/moduleselection/adapter/ModuleViewHolder.kt Removes legacy adapter implementation.
feature/dashboard/src/main/java/com/simprints/feature/dashboard/settings/syncinfo/moduleselection/adapter/ModuleSelectionListener.kt Removes legacy adapter listener.
feature/dashboard/src/main/java/com/simprints/feature/dashboard/settings/syncinfo/moduleselection/adapter/ModuleAdapter.kt Removes legacy adapter.
feature/dashboard/src/main/java/com/simprints/feature/dashboard/settings/SettingsFragment.kt Updates import to use the moved infra:ui-base password dialog.
feature/dashboard/src/main/java/com/simprints/feature/dashboard/settings/about/AboutFragment.kt Updates import to use the moved infra:ui-base password dialog.
feature/dashboard/src/main/java/com/simprints/feature/dashboard/logout/syncdecline/LogoutSyncDeclineFragment.kt Updates import to use the moved infra:ui-base password dialog.
feature/dashboard/build.gradle.kts Adds dependency on :feature:module-selector.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@luhmirin-s
luhmirin-s force-pushed the feature/MS-1451-module-selection-rework branch from bba87ea to ec2e75d Compare August 17, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants