Skip to content

Fix: Newly due learning cards incorrectly shown as buried in deck overview#4752

Open
user1823 wants to merge 2 commits intoankitects:mainfrom
user1823:counts
Open

Fix: Newly due learning cards incorrectly shown as buried in deck overview#4752
user1823 wants to merge 2 commits intoankitects:mainfrom
user1823:counts

Conversation

@user1823
Copy link
Copy Markdown
Contributor

Linked issue (required)

Fixes #4263
Supersedes #4271

Summary / motivation (required)

Anki caches the learning cutoff to prevent a newly-due learning card from appearing instead of the current card when the user edits a card from the reviewer and then returns to study. (Ref: #4271 (comment))

This is a problem because counts() uses this cached cutoff to calculate the learning card counts, causing a mismatch between deck_node.learn_count (which always uses the up-to-date cut-off) and counts[1] (which uses the cached cutoff). This mismatch causes the deck overview to incorrectly show these newly due learning cards as buried.

This PR adds a newly_due_learning_count() helper that counts intraday learning cards that have become due since the last cutoff update. counts() now includes these cards in the returned learning count without advancing the current_learning_cutoff, so the order in which cards are shown during a study session is unaffected.

Steps to reproduce (required, use N/A if not applicable)

  1. Study some new cards. Do not complete the reviews. Exit the reviewer.
  2. Wait for the newly introduced cards to reach their next learning step (become due again).
  3. Click on the deck. The overview shows the newly due learning cards as buried (grey), but they are not.

How to test (required)

  1. With this PR, repeat the above steps.
  2. The newly due learning cards are now shown as red rather than grey.

Checklist (minimum)

  • I ran ./ninja check or an equivalent relevant check locally.
  • I added or updated tests when the change is non-trivial or behavior changed.

Details

Before / after behavior (optional)

Risk / compatibility / migration (optional)

UI evidence (required for visual changes; otherwise N/A)

Scope

  • This PR is focused on one change (no unrelated edits).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Learning cards are shown as buried cards on deck overview page

1 participant