fix: Allow card options in notes mode
Purpose / Description
Card Browser previously blocked reposition, set due date, and reset progress operations in notes mode with an error message. Desktop Anki allows these operations via the Cards submenu.
Fixes
- Fixes #18307
Approach
Removed warnUserIfInNotesOnlyMode() blocking method from CardBrowser.kt and its checks from three operations in CardBrowserFragment.kt:
rescheduleSelectedCards()repositionSelectedCards()onResetProgress()
Added verification logging for data integrity. The existing queryAllSelectedCardIds() already handles both modes correctly ; querying all card IDs for selected notes when in notes mode.
How Has This Been Tested?
By unit tests and manual testing ;
Added 2 tests in CardBrowserViewModelTest.kt:
reposition in notes mode affects all cards 18307- Verifies repositioning affects all cards of selected notesreset progress in notes mode affects all cards 18307- Verifies reset affects all cards of selected notes
Run: ./gradlew :AnkiDroid:testPlayDebugUnitTest --tests "*18307"
Both tests will pass.
Checklist
Please, go through these checks before submitting the PR.
- [x] You have a descriptive commit message with a short title (first line, max 50 chars).
- [x] You have commented your code, particularly in hard-to-understand areas
- [x] 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
This doesn't seem to address:
Could you add justification for why this works now, but was inconclusive/broken at the time
For example:
- https://github.com/ankidroid/Anki-Android/pull/17962 fixed reposition
ah my bad i was on the airport just got some time there so i resolved the comments; missed the original message. Updated the commit message now!
With link previews
- Reschedule: #15699: d847d91041d47e5fb2f9918375425f872a9aba81
- Reposition: #17962 4db4dfb15c18aa39edf70bab0414d391d5e39702
- Reset: #17176 e3fa8405b31a8d17fc829d2468ca7d3871eef3c9