Refactor: study options ViewModel migration#20720
Open
criticalAY wants to merge 3 commits intoankidroid:mainfrom
Open
Refactor: study options ViewModel migration#20720criticalAY wants to merge 3 commits intoankidroid:mainfrom
criticalAY wants to merge 3 commits intoankidroid:mainfrom
Conversation
- Extract business logic from StudyOptionsFragment into a dedicated ViewModel. - Introduces DeckStudyData, StudyOptionsState sealed interface, and moves collection queries and deck operations (rebuild, empty, unbury) into the ViewModel.
Replace direct collection access and mutable state in the fragment with ViewModel delegation. The fragment now observes StudyOptionsState via StateFlow and delegates operations (refresh, rebuild, empty, unbury) to StudyOptionsViewModel. Removes currentContentView, updateValuesFromDeckJob, retryMenuRefreshJob, and the col property getter.
Member
|
Can we defer this until 2.25? Lots of risk just before we go to beta |
david-allison
requested changes
Apr 12, 2026
Member
david-allison
left a comment
There was a problem hiding this comment.
The first commit introduces code without moving it, making it difficult for 'git blame' to work effectively.
The tests should ideally be introduced in the commit which introduces them in the ViewModel.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose / Description
Migrate the StudyOptionsFragment to use VM
Fixes
NA
Approach
See commits
How Has This Been Tested?
Manual test on Pixel 10 and unit test
Learning (optional, can help others)
NA
Checklist
Please, go through these checks before submitting the PR.