Skip to content

feat: Allow card options in notes mode - #19676

Merged
BrayanDSO merged 1 commit into
ankidroid:mainfrom
xenonnn4w:cardOptions
Jan 3, 2026
Merged

BrayanDSO merged 1 commit into
ankidroid:mainfrom
xenonnn4w:cardOptions

Conversation

@xenonnn4w

@xenonnn4w xenonnn4w commented Dec 3, 2025 •

Copy link
Copy Markdown
Contributor

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

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 notes
  • reset 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.

  • 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

@david-allison david-allison left a comment

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.

Tests are excellent, thank you!

Minor nitpick on removing the comment - not necessary if you're happy you tested it


Link the cause of this warning, so people can understand how the feature came to be (likely in the commit message):


Could you add justification for why this works now, but was inconclusive/broken at the time

For example:

Comment thread AnkiDroid/src/main/java/com/ichi2/anki/browser/CardBrowserFragment.kt Outdated
Comment thread AnkiDroid/src/main/java/com/ichi2/anki/browser/CardBrowserFragment.kt Outdated
Comment thread AnkiDroid/src/main/java/com/ichi2/anki/browser/CardBrowserFragment.kt Outdated
@lukstbit lukstbit added Needs Author Reply Waiting for a reply from the original author and removed Needs Review labels Dec 4, 2025
@xenonnn4w xenonnn4w removed the Needs Author Reply Waiting for a reply from the original author label Dec 6, 2025
@david-allison

Copy link
Copy Markdown
Member

This doesn't seem to address:

Could you add justification for why this works now, but was inconclusive/broken at the time

For example:

@david-allison david-allison added the Needs Author Reply Waiting for a reply from the original author label Dec 6, 2025
@xenonnn4w

Copy link
Copy Markdown
Contributor Author

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!

@xenonnn4w xenonnn4w removed the Needs Author Reply Waiting for a reply from the original author label Dec 7, 2025

@david-allison david-allison left a comment •

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.

That's the PR where the restrictions were added, not justification for why they can be removed.

I want this in, so, could you add this to the commit message:


I want to block this from merging on getting the commit message/documentation of the change correct

But, the code is correct. Needs Second Approval Has one approval, one more approval to merge so this can move on, and Needs Author Reply Waiting for a reply from the original author before this is merged

@david-allison

Copy link
Copy Markdown
Member

With link previews

@david-allison david-allison added Needs Author Reply Waiting for a reply from the original author Needs Second Approval Has one approval, one more approval to merge labels Dec 7, 2025
@david-allison david-allison removed the Needs Author Reply Waiting for a reply from the original author label Dec 8, 2025
Fix ankidroid#18307
Relates to ankidroid#15509

- Remove warnUserIfInNotesOnlyMode() method from CardBrowser
- Enable reposition, set due date, and reset progress in notes mode
- Operations now correctly affect all cards of selected notes
- Add verification logging for data integrity
- Remove unused string resource

The Card Browser previously blocked reposition, set due date, and
reset progress operations when in notes mode. This restriction was
added in commit 530bdb4 as a temporary measure after
fixing ankidroid#15509, where operations only affected one card per note.

The underlying infrastructure (queryAllSelectedCardIds) was subsequently
fixed to correctly handle notes mode:

Reschedule: d847d91 (issue 15699)
Reposition: 4db4dfb (issue 17962)
Reset: e3fa840 (issue 17176)

Tests: CardBrowserViewModelTest
@david-allison david-allison changed the title fix: Allow card options in notes mode feat: Allow card options in notes mode Dec 17, 2025
@BrayanDSO
BrayanDSO added this pull request to the merge queue Jan 3, 2026
@BrayanDSO BrayanDSO removed the Needs Second Approval Has one approval, one more approval to merge label Jan 3, 2026
@BrayanDSO BrayanDSO added the Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) label Jan 3, 2026
Merged via the queue into ankidroid:main with commit 8015ed6 Jan 3, 2026
15 checks passed
@github-actions github-actions Bot removed the Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) label Jan 3, 2026
@github-actions github-actions Bot added this to the 2.24 release milestone Jan 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow Options to be Used in Notes Mode

4 participants