Open
Conversation
ff79364 to
1b3060e
Compare
� This is the 1st commit message: added test files for currentdeckid() mark test as flaky Issue 19729 fix(deckpicker): Added contentDescription to sync and add card buttons deprecation(libanki): prefer `defaultsForAdding()` over `current()` Deprecates Notetypes.current() in favor of col.defaultsForAdding() Fixes: 19650 Co-authored-by: David Allison <62114487+david-allison@users.noreply.github.com> chore: log 'Activity with no Application' error It's likely that there's another cause other than the backup manager Diagnostics for issue 19050 style: fix dangling top-level KDocs This breaks KtLint 1.8.0 > A dangling toplevel KDoc is not allowed (cannot be auto-corrected) * modify `libs.versions.toml` to use `ktlint = '1.8.0'` * ./gradlew ktLintFormat * revert all changes * manually fix warnings, searching for 'dangling' * manually check fixes ensuring only top-level comments are processed Issue 19614 - updating ktLint docs(github): Explain workflows Quality Checks can be linked to from other pages as an onboarding guide https://github.com/ankidroid/Anki-Android/tree/main/.github/workflows/README.md#quality-checks docs(deps): improve AndroidX lifecycle-process * link changelogs * rename to 'androidxLifecycleProcess' * make location consistent with other libraries Added in 7f7cd37 Disable "Scroll toolbar" if toolbar is not shown In the note editor's overflow menu, disable the "Scroll toolbar" option if the toolbar (for HTML formatting) is not shown. Add comprehensive tests for Card.currentDeckId() - Test normal deck scenario (oDid=0 returns did) - Test filtered deck scenario (oDid takes priority) - Test precedence when both IDs are positive - Test real-world filtered deck usage - Test normal deck default behavior - Test edge case where both IDs are same Addresses @NeedsTest annotation on currentDeckId() method Update Card.kt Update CardTest.kt chore: fix warnings in ExifUtil and UniqueArrayList * Convert var to val in ExifUtil * Fix KDoc references in UniqueArrayList Issue: 13282 Co-authored-by: David Allison <62114487+david-allison@users.noreply.github.com> Add comprehensive tests for Card.currentDeckId() - Test normal deck scenario (oDid=0 returns did) - Test filtered deck scenario (oDid takes priority) - Test precedence when both IDs are positive - Test real-world filtered deck usage - Test normal deck default behavior - Test edge case where both IDs are same Addresses @NeedsTest annotation on currentDeckId() method Update Card.kt Update CardTest.kt Update Card.kt Update Card.kt Update CardTest.kt Update CardTest.kt Update CardTest.kt Update Card.kt Update CardTest.kt Update CardTest.kt Update CardTest.kt Update tests to verify functionality calling currentDeckId() Update CardTest.kt Update CardTest.kt Update CardTest.kt Update CardTest.kt Update CardTest.kt Revert "added test files for currentdeckid()" This reverts commit 1b3060e. � This is the commit message #2: Update Card.kt � This is the commit message #3: Update CardTest.kt � This is the commit message #4: Update Card.kt � This is the commit message ankidroid#5: Update CardTest.kt � This is the commit message ankidroid#6: Revert "Update Card.kt & Cardtest.kt" This reverts commit 5bc3121. Test files in cardtest.kt & card.kt
965c76b to
4a891b7
Compare
aladdin-afk
pushed a commit
that referenced
this pull request
Dec 22, 2025
� This is the 1st commit message: added test files for currentdeckid() mark test as flaky Issue 19729 fix(deckpicker): Added contentDescription to sync and add card buttons deprecation(libanki): prefer `defaultsForAdding()` over `current()` Deprecates Notetypes.current() in favor of col.defaultsForAdding() Fixes: 19650 Co-authored-by: David Allison <62114487+david-allison@users.noreply.github.com> chore: log 'Activity with no Application' error It's likely that there's another cause other than the backup manager Diagnostics for issue 19050 style: fix dangling top-level KDocs This breaks KtLint 1.8.0 > A dangling toplevel KDoc is not allowed (cannot be auto-corrected) * modify `libs.versions.toml` to use `ktlint = '1.8.0'` * ./gradlew ktLintFormat * revert all changes * manually fix warnings, searching for 'dangling' * manually check fixes ensuring only top-level comments are processed Issue 19614 - updating ktLint docs(github): Explain workflows Quality Checks can be linked to from other pages as an onboarding guide https://github.com/ankidroid/Anki-Android/tree/main/.github/workflows/README.md#quality-checks docs(deps): improve AndroidX lifecycle-process * link changelogs * rename to 'androidxLifecycleProcess' * make location consistent with other libraries Added in 7f7cd37 Disable "Scroll toolbar" if toolbar is not shown In the note editor's overflow menu, disable the "Scroll toolbar" option if the toolbar (for HTML formatting) is not shown. Add comprehensive tests for Card.currentDeckId() - Test normal deck scenario (oDid=0 returns did) - Test filtered deck scenario (oDid takes priority) - Test precedence when both IDs are positive - Test real-world filtered deck usage - Test normal deck default behavior - Test edge case where both IDs are same Addresses @NeedsTest annotation on currentDeckId() method Update Card.kt Update CardTest.kt chore: fix warnings in ExifUtil and UniqueArrayList * Convert var to val in ExifUtil * Fix KDoc references in UniqueArrayList Issue: 13282 Co-authored-by: David Allison <62114487+david-allison@users.noreply.github.com> Add comprehensive tests for Card.currentDeckId() - Test normal deck scenario (oDid=0 returns did) - Test filtered deck scenario (oDid takes priority) - Test precedence when both IDs are positive - Test real-world filtered deck usage - Test normal deck default behavior - Test edge case where both IDs are same Addresses @NeedsTest annotation on currentDeckId() method Update Card.kt Update CardTest.kt Update Card.kt Update Card.kt Update CardTest.kt Update CardTest.kt Update CardTest.kt Update Card.kt Update CardTest.kt Update CardTest.kt Update CardTest.kt Update tests to verify functionality calling currentDeckId() Update CardTest.kt Update CardTest.kt Update CardTest.kt Update CardTest.kt Update CardTest.kt Revert "added test files for currentdeckid()" This reverts commit 1b3060e. � This is the commit message #2: Update Card.kt � This is the commit message #3: Update CardTest.kt � This is the commit message #4: Update Card.kt � This is the commit message ankidroid#5: Update CardTest.kt � This is the commit message ankidroid#6: Revert "Update Card.kt & Cardtest.kt" This reverts commit 5bc3121. Test files in cardtest.kt & card.kt
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
The tests fulfill the request by testing the methods that use currentDeckId() to ensure the correct deck configuration is applied in all scenarios
Fixes
Approach
6 functions tested
1.timelimit() for normal, filtered deck
2.shouldShowTimer()
3.autoplay()
4.replayQuestionAudioOnAnswerSide()
5.timeTaken()
How Has This Been Tested?
did use
./gradlew libanki:test./gradlew ktlintFormatLearning (optional, can help others)
https://youtu.be/9yre-M1XwVw?si=5UwsCUsnT8DDaIqc
can watch this playllist for basics
usually we use 2 standard forms of decks, so 2 deck ids
did,oidabbreviated as deck id, original deck idcurrentDeckId()returns the correct deck ID to use for configuration by prioritizingoDidwhen non-zero, ensuring that deck settings always come from the original deck, not temporary filtered decks.Checklist