Ask which deck options to open in reviewer#20118
Closed
Sandesh282 wants to merge 1 commit intoankidroid:mainfrom
Closed
Ask which deck options to open in reviewer#20118Sandesh282 wants to merge 1 commit intoankidroid:mainfrom
Sandesh282 wants to merge 1 commit intoankidroid:mainfrom
Conversation
|
First PR! 🚀 We sincerely appreciate that you have taken the time to propose a change to AnkiDroid! Please have patience with us as we are all volunteers - we will get to this as soon as possible. |
Contributor
|
Important Maintainers: This PR contains Strings changes
|
Member
|
Thanks so much! But this is already handled in #19963: |
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
When reviewing cards, if the current deck differs from the card’s deck, opening Deck Options currently takes the user directly to one deck without giving a choice. Desktop Anki allows the user to choose which deck’s options to open in this case.
This PR brings the Android reviewer behavior in line with desktop Anki by prompting the user to choose which deck’s options they want to open.
Due to AnkiDroid’s internal handling of the current deck during review, this choice is rarely triggered in normal usage, but the logic matches desktop Anki behavior and resolves the underlying ambiguity.
Fixes
Approach
The decision logic lives in the ReviewerViewModel. When the current deck and the card’s deck differ, the ViewModel emits a signal requesting user choice instead of navigating immediately.
The ReviewerFragment observes this signal and displays a simple dialog allowing the user to choose the target deck. Once selected, the final navigation to Deck Options is emitted by the ViewModel.
This keeps navigation logic centralized in the ViewModel and limits the Fragment to UI responsibilities.
How Has This Been Tested?
Note: The dialog only appears when the current study deck differs from the card’s deck. In AnkiDroid, the “current deck” is internally updated to the card’s deck during review, which makes this condition rare to trigger naturally. This matches internal behavior observed during debugging and is discussed in the linked issue.
The dialog behavior and navigation flow were verified by temporarily forcing the choice path during testing.
Test configuration:
Learning (optional, can help others)
Reviewed how desktop Anki handles deck option selection when the reviewer’s current deck and the card’s deck differ, and mirrored that behavior while keeping Android architecture constraints in mind.
Checklist