feat(learn): the library on shelves by recency, narrowed to a subject (ADR 0041, D8)

The library as Vaia's (the developer's decisions of 10 Nov 2026): the
starred on a shelf of their own, then those studied or changed in the
last 7 days, the last month and before, each under its heading, the
archive last. Recent is the later of a card's last rating
(StudyProgress.lastStudied) and the studyset's own last change. A
dropdown narrows the library to one of the subjects in use, kept on the
device (DeviceSettings.librarySubject). A card names its subject under
its title, with its icon, and a language course its language beside.

Whats-New: The library groups your studysets by when you last used them, and narrows them to one subject.
Whats-New-De: Die Bibliothek ordnet deine Lernsets danach, wann du sie zuletzt genutzt hast, und zeigt auf Wunsch nur ein Fach.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-11-10 19:08:02 +01:00
commit a3b124ddcb
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -39,6 +39,46 @@ void main() {
expect(progress.mastery, 0.25);
});
test('names when a card among them was last rated, for the library to '
"shelve by (the developer's decision of 10 Nov 2026)", () {
CardSchedule ratedAt(DateTime at) => CardSchedule(
reviewCount: 1,
due: now.add(const Duration(days: 2)),
firstReviewedAt: at,
lastReviewedAt: at,
);
final progress = studyProgress(
groups: [
['old', 'new'],
['recent'],
],
schedules: {
'old': ratedAt(DateTime.utc(2026, 9)),
'new': fresh,
'recent': ratedAt(DateTime.utc(2026, 10, 4)),
},
now: now,
startOfToday: startOfToday,
);
expect(progress.lastStudied, DateTime.utc(2026, 10, 4));
expect(
progress.withContent(notes: 1, paths: 0, files: 0).lastStudied,
DateTime.utc(2026, 10, 4),
);
expect(
studyProgress(
groups: [
['new'],
],
schedules: {'new': fresh},
now: now,
startOfToday: startOfToday,
).lastStudied,
isNull,
);
});
test('counts only as many new cards as today still starts', () {
final order = [for (var i = 0; i < 30; i++) 'n$i'];