Skip to content

refactor(deck-picker): introduce UiEvent#20683

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

refactor(deck-picker): introduce UiEvent#20683
david-allison wants to merge 2 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

@david-allison david-allison force-pushed the deck=picker-view-model branch from 2891b8f to 5028a84 Compare April 7, 2026 21:54
@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
@david-allison david-allison force-pushed the deck=picker-view-model branch from 36d7dbb to 919abb6 Compare April 21, 2026 10:44
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 919abb6 to abf3bc0 Compare April 21, 2026 12:40
@david-allison david-allison removed Needs Author Reply Waiting for a reply from the original author Has Conflicts labels Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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