providing the selected kind to launch custom study to provide user's intent#21017
providing the selected kind to launch custom study to provide user's intent#21017jatinkumar2409 wants to merge 1 commit into
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. |
david-allison
left a comment
There was a problem hiding this comment.
Looks good, cheers! Would be great with a @NeedsTest or a Robolectric test
|
@david-allison Done the changes |
david-allison
left a comment
There was a problem hiding this comment.
Please note, this is a STRONG approve, only sharing my thoughts because you pinged. I'd recommend not doing anything here unless you have the time
I really appreciate the diligence!
| if (viewModel.selectedCardStateIndex == AdapterView.INVALID_POSITION) { | ||
| viewModel.selectedCardStateIndex = 0 | ||
| } | ||
|
|
There was a problem hiding this comment.
There's still a little space here and in a few other places in the "files changed"
| // skip tag selection if there's no tags to select | ||
| if (nids.isEmpty()) { | ||
| launchCustomStudy(contextMenuOption, n) | ||
| val selectedKind = viewModel.selectedKind |
There was a problem hiding this comment.
This can be inlined for brevity
Giyutomioka-SS
left a comment
There was a problem hiding this comment.
Nit: Line 154 could use viewModel.selectedKind instead of manually doing CustomStudyCardState.entries[selectedCardStateIndex].kind, keeping the ViewModel as the single source of truth for kind resolution.
|
@Giyutomioka-SS Fixed the code . Requires your review |
Providing the selected kind to launch custom study
Purpose / Description
The user's chosen option was overriden for custom study
Fixes
Approach
It was a smaller bug the launch custom study was using the default parameter
How Has This Been Tested?
ankidroid_fix.mp4
I tested this in realme c30s
Learning (optional, can help others)
Describe the research stage
Links to blog posts, patterns, libraries or addons used to solve this problem
Checklist
Please, go through these checks before submitting the PR.