Skip to content

feat: Deckpicker progress adoption - #21831

Open
criticalAY wants to merge 2 commits into
ankidroid:mainfrom
criticalAY:deckpicker-progress-adoption
Open

criticalAY wants to merge 2 commits into
ankidroid:mainfrom
criticalAY:deckpicker-progress-adoption

Conversation

@criticalAY

Copy link
Copy Markdown
Contributor

Note

Assisted-by: Claude Opus 5

Purpose / Description

Adopt progress for DeckPicker i.e. the ViewModel reports its own progress and the fragment observes it

Fixes

Approach

See commit

How Has This Been Tested?

Unit testing only

Learning (optional, can help others)

NA

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

Every observer dismissed the one shared dialog on `Idle`, so with two
observers in an activity, one could close the other's dialog.

Assisted-by: Claude Opus 5 (implementation iteration and tests)
@criticalAY
criticalAY force-pushed the deckpicker-progress-adoption branch from abd8194 to b77fd6c Compare September 29, 2026 06:59
@david-allison david-allison added the Needs Author Reply Waiting for a reply from the original author label Sep 29, 2026

@david-allison david-allison left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For the DeckPicker: we need to be sure that withProgress blocks operations immediately - modifying the selected deck can cause an operation to occur on the wrong decks.

This PR waits 600ms before performing blocking input, rather than blocking input immediately

Rest LGTM!

@david-allison david-allison added Needs Author Reply Waiting for a reply from the original author and removed Needs Author Reply Waiting for a reply from the original author labels Sep 29, 2026
Comment on lines 300 to 302
launchCatchingTask {
withProgress(TR.emptyCardsDeleting()) {
viewModel.deleteEmptyCards(report, keepNotes).join()
}
viewModel.deleteEmptyCards(report, keepNotes).join()
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just to note: I'd like to move the launchCatchingTask into the ViewModel. Makes the calling code much cleaner.

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

Labels

Needs Author Reply Waiting for a reply from the original author Needs Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants