refactor: extract widget storage behind WidgetRepository interface.#21065
Open
Giyutomioka-SS wants to merge 1 commit into
Open
refactor: extract widget storage behind WidgetRepository interface.#21065Giyutomioka-SS wants to merge 1 commit into
Giyutomioka-SS wants to merge 1 commit into
Conversation
465c044 to
62b1d1c
Compare
david-allison
approved these changes
May 17, 2026
Member
david-allison
left a comment
There was a problem hiding this comment.
One nitpick, rest looks good
62b1d1c to
97836c2
Compare
david-allison
approved these changes
May 17, 2026
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.
Note
Assisted-by Claude Opus 4.7
Research & architecture analysis
Decouples
WidgetStatusfromMetaDBby introducing aWidgetRepositoryinterface.MetaDbWidgetRepositorydelegates to the existingMetaDBmethods, so there’s no behavior change.Fixes
Approach
WidgetRepositoryinterface for the 3 widget-relatedMetaDBmethodsMetaDbWidgetRepositoryas a delegating implementation with constructor-injected context.AnkiDroidApp.onCreate()beforeChangeManager.subscribe()MetaDBusage inWidgetStatus.ktwith the interface and removed context fromfetchSmall()/fetchDue()How Has This Been Tested?
Local build, test compilation passes.
Checklist
Please, go through these checks before submitting the PR.