Skip to content

fix(annotations): snapshot dueItems to prevent index drift in learning session#3

Merged
TYBLHQY merged 1 commit into
masterfrom
worktree-fix-lsm-session-items
Jul 18, 2026
Merged

fix(annotations): snapshot dueItems to prevent index drift in learning session#3
TYBLHQY merged 1 commit into
masterfrom
worktree-fix-lsm-session-items

Conversation

@TYBLHQY

@TYBLHQY TYBLHQY commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Problem

When rating cards in LearningModal, reviewAnnotation() updates the card's due date. Since dueItems is a useMemo that re-filters by current time, rated cards disappear from the array immediately — shifting remaining indices and causing skipped or wrong cards.

Fix

Snapshot dueItems into a sessionItems state when the learning panel opens, and use sessionItems everywhere inside the session. Clear on close.

Changes

  • src/components/layout/right-panel/annotations-tab.tsx — 16 additions, 4 deletions

🤖 Generated with Claude Code

…g session

When rating cards in LearningModal, reviewAnnotation() updates the card's
due date. dueItems is a useMemo that re-filters by current time, so rated
cards disappear from the array — shifting remaining indices and causing
skipped or wrong cards.

Fix: snapshot dueItems into a sessionItems state when the learning panel
opens, and use sessionItems everywhere inside the session. Clear on close.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@TYBLHQY
TYBLHQY merged commit 136a643 into master Jul 18, 2026
1 check passed
@TYBLHQY
TYBLHQY deleted the worktree-fix-lsm-session-items branch July 18, 2026 22:02
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.

1 participant