Skip to content

Comments

fix: keep deck selection dialog open for multi-select in widget config#20351

Open
pankaj0695 wants to merge 1 commit intoankidroid:mainfrom
pankaj0695:multi-deck-selection
Open

fix: keep deck selection dialog open for multi-select in widget config#20351
pankaj0695 wants to merge 1 commit intoankidroid:mainfrom
pankaj0695:multi-deck-selection

Conversation

@pankaj0695
Copy link
Contributor

Purpose / Description

Resolves the TODOs in

// TODO: Implement multi-select functionality so that user can select desired decks in once.
// TODO: Implement a functionality to hide already selected deck.

and the related TODO at
// TODO: Eventually, ensure that the user can't select a deck that is already selected.

  • Users had to repeatedly open/close the deck selection dialog to add multiple
    decks to the widget
  • Already selected decks were still visible in the dialog, leading to a "already selected" error

Approach

  • Added a keepOpen parameter (default false) to DeckSelectionDialog.newInstance() so existing callers are unaffected
  • When keepOpen is true, selecting a deck notifies the listener and removes the deck from the dialog list instead of dismissing
  • The dialog auto-dismisses when the list is empty or the 5-deck limit is reached
  • DeckPickerWidgetConfig now filters out already-selected decks before showing the dialog and passes keepOpen = true

How Has This Been Tested?

  • Existing DeckSelectionDialogTest - 2/2 tests passing
  • Manual testing on a physical Android 15 device:
    • Verified dialog stays open after each deck selection
    • Verified selected decks are removed from the dialog list
    • Verified dialog auto-closes on reaching the 5-deck limit
    • Verified previously selected decks reappear in the dialog after removal from widget config
    • Verified Cancel/back button dismisses dialog correctly

Before

Before.mp4

After

After.mp4

Checklist

Please, go through these checks before submitting the PR.

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant