feat(app): reviews know how a card was studied; progress can start afresh
Each review records its mode (ADR 0004, rule 3): front to back, back to front with a schedule of its own, or crammed outside the schedule. A card's schedule replays only the reviews of one mode. Resetting progress appends a 'reset' entry per card, no migration (the column is text): schedules replay what follows it, and the history stays for the streak and the heatmap. Reviews are inserted in batches. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
8cf7749ed6
commit
baace1b6e9
1 changed files with 214 additions and 69 deletions
|
|
@ -14,19 +14,17 @@ class FakeReviewGateway() implements ReviewGateway {
|
|||
];
|
||||
|
||||
@override
|
||||
Future<void> insert({
|
||||
required String cardId,
|
||||
required int rating,
|
||||
required DateTime reviewedAt,
|
||||
required int durationMs,
|
||||
}) async {
|
||||
rows.add((
|
||||
id: 'review-${(_nextId++).toString().padLeft(4, '0')}',
|
||||
cardId: cardId,
|
||||
rating: rating,
|
||||
reviewedAt: reviewedAt,
|
||||
durationMs: durationMs,
|
||||
));
|
||||
Future<void> insert(Iterable<ReviewRow> reviews) async {
|
||||
for (final review in reviews) {
|
||||
rows.add((
|
||||
id: 'review-${(_nextId++).toString().padLeft(4, '0')}',
|
||||
cardId: review.cardId,
|
||||
rating: review.rating,
|
||||
reviewedAt: review.reviewedAt,
|
||||
durationMs: review.durationMs,
|
||||
mode: review.mode,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
|||
Loading…
Reference in a new issue