Skip to content

refactor(deck-picker): introduce UiEvent#20683

Open
david-allison wants to merge 3 commits intoankidroid:mainfrom
david-allison:deck=picker-view-model
Open

refactor(deck-picker): introduce UiEvent#20683
david-allison wants to merge 3 commits intoankidroid:mainfrom
david-allison:deck=picker-view-model

Conversation

@david-allison
Copy link
Copy Markdown
Member

Note

Assisted-by: Claude Opus 4.6

Purpose / Description

A common pattern in MVI (and some of Compose) is to encapsulate all one-shot side-effects into a wrapper interface.

This is implemented via a Channel, enforcing correct one-shot and buffering behavior

This pattern allows:

  • Removal of 'StateFlow-related' bugs
  • Removal of 'val' flows
  • Simple 'Result' classes
  • Fewer methods handling 'Unit' in the DeckPicker

How Has This Been Tested?

  • Attempted to reproduce the issue listed in flowOfDecksReloaded and it worked as expected.
  • Trusting CI

Checklist

  • 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

`setup-gradle@v6` now hard-errors when it can't find files to build a
hash key.

Previously it had nothing to hash, now it hashes the selected PR

Fixes 20779

Assisted-by: Claude Opus 4.7 - diagnostics
A common pattern in MVI (and some of Compose) is to encapsulate all
one-shot side-effects into a wrapper interface.

This is implemented via a Channel, enforcing correct one-shot and
buffering behavior

This pattern allows:

* Removal of 'StateFlow-related' bugs
* Removal of 'val' flows
* Simple 'Result' classes
* Fewer methods handling 'Unit' in the DeckPicker

The test was updated as it should not have been accessing the flows
 of the ViewModel

Assisted-by: Claude Opus 4.6
Now we have UiEvent, we have no need for these classes

Assisted-by: Claude Opus 4.6
@david-allison david-allison force-pushed the deck=picker-view-model branch from 5028a84 to 36d7dbb Compare April 19, 2026 15:02
@david-allison david-allison added Needs Author Reply Waiting for a reply from the original author Next version Changes to be merged in the next version, to keep the current release stable. labels Apr 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Has Conflicts Needs Author Reply Waiting for a reply from the original author Needs Review Next version Changes to be merged in the next version, to keep the current release stable.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant