ADR-0059: Onboarding bank picker shows and preselects installed apps
Context
The bank-selection step listed every known app and preselected all of them,
even when none were installed: the filter was showAll || detected.isEmpty() ||
package in detected, so an empty detection result silently overrode the
unchecked Show all supported apps control, and selected started as the
whole catalog. On a clean emulator the picker therefore showed a fully selected
list of "Not installed on this device" rows — the visible control state did not
explain the list, and finishing tracked apps the user does not have.
Decision
Visibility and selection both follow installed apps, and the only way to see uninstalled apps is an explicit opt-in.
- The list shows
detected ∩ knownunless Show all supported apps is ticked; the silentdetected.isEmpty()fallback is removed. When nothing is installed the step states that plainly and points at the Show all control instead of presenting uninstalled rows as selectable defaults. - The default selection is
detected ∩ known(the installed subset). It is applied once detection finishes and only while the user has not edited the selection; a deliberate toggle always wins. - Visibility never changes the selection: toggling Show all on or off keeps every chosen package, and deselecting a visible app keeps it deselected.
- Finish persists the selected set as
tracked_packages(ADR-0008); the check still requires at least one selected app. - Selection lives in pure functions (
visibleBankApps,defaultBankSelectioninBankCatalog.kt) so the policy is JVM-testable without a picker.
Consequences
- The picker and its Show all control can never disagree; a no-install device shows an explicit empty state instead of a misleading full list.
- Users with no installed bank apps select nothing by default and must opt into Show all to configure uninstalled packages deliberately.
- A user who installed no bank apps is not silently tracked onto every known package. Manual-only setup (ADR-0056) remains the no-install path.
Verification
BankSelectionTest covers visibility and default selection for none/some/all
installed and the known-order guarantee. OnboardingBanksStepTest renders the
step for the no-install, detection-pending and Show-all cases and proves the
control only triggers the visibility action. OnboardingSelectionPolicyTest
proves Show-all toggles preserve deliberate choices and Finish persists the
chosen set.