Skip to content

providing the selected kind to launch custom study to provide user's intent#21017

Open
jatinkumar2409 wants to merge 1 commit into
ankidroid:mainfrom
jatinkumar2409:main
Open

providing the selected kind to launch custom study to provide user's intent#21017
jatinkumar2409 wants to merge 1 commit into
ankidroid:mainfrom
jatinkumar2409:main

Conversation

@jatinkumar2409
Copy link
Copy Markdown
Contributor

@jatinkumar2409 jatinkumar2409 commented May 11, 2026

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.

  • [ ✅] 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

@welcome
Copy link
Copy Markdown

welcome Bot commented May 11, 2026

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.

@jatinkumar2409 jatinkumar2409 changed the title providing the selected kind to launch custom study to provide user's … providing the selected kind to launch custom study to provide user's intent May 11, 2026
@david-allison david-allison added the Review High Priority Request for high priority review label May 12, 2026
Copy link
Copy Markdown
Member

@david-allison david-allison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, cheers! Would be great with a @NeedsTest or a Robolectric test

Comment thread AnkiDroid/src/main/java/com/ichi2/anki/dialogs/customstudy/CustomStudyDialog.kt Outdated
Comment thread AnkiDroid/src/main/java/com/ichi2/anki/dialogs/customstudy/CustomStudyDialog.kt Outdated
@david-allison david-allison added Needs Second Approval Has one approval, one more approval to merge and removed Needs Review labels May 12, 2026
@jatinkumar2409
Copy link
Copy Markdown
Contributor Author

@david-allison Done the changes

Copy link
Copy Markdown
Member

@david-allison david-allison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
}

Copy link
Copy Markdown
Member

@david-allison david-allison May 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be inlined for brevity

Copy link
Copy Markdown
Contributor

@Giyutomioka-SS Giyutomioka-SS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@jatinkumar2409
Copy link
Copy Markdown
Contributor Author

@Giyutomioka-SS Fixed the code . Requires your review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Second Approval Has one approval, one more approval to merge Review High Priority Request for high priority review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom Study > Study by card state or Tag

3 participants