feat(learn): Add material no longer offers flashcards from a text (ADR 0021, D56 amended)

The developer's review of 4 Nov 2026. The entry goes from a studyset's
Add material, and with it the sheet for pasting a text
(proposeCardsFromText, _TextSheet), its three texts and proposeCards'
fromStudyset, which only it set to false. A note's and a PDF page's
flashcards stay; their tests now drive the proposals sheet from a note.

Whats-New: Add material no longer offers Flashcards from a text; a note's or a PDF page's flashcards stay.
Whats-New-De: Material hinzufügen bietet keine Karteikarten aus einem Text mehr an; die aus einer Notiz oder einer PDF-Seite bleiben.

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-04 21:19:30 +01:00
commit bda09a2959
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -144,27 +144,28 @@ void main() {
];
}
testWidgets('Add material proposes flashcards from a text pasted: every '
'one chosen, changed or left out, and those chosen added', (
tester,
) async {
await showApp(tester, RoutePaths.studyset('japanese'));
/// Shows a note of Japanese's holding [text], for its flashcards.
Future<void> showNote(WidgetTester tester, String text) async {
final notes = NoteRepository(noteGateway);
addTearDown(notes.dispose);
final (:noteId, revisionId: _) = await notes.create(
'japanese',
NoteContent(title: 'Verbs', body: RichContent.plain(text)),
);
await showApp(tester, RoutePaths.note('japanese', noteId));
}
testWidgets("a note's proposed flashcards: every one chosen, changed or "
'left out, and those chosen added', (tester) async {
await showNote(tester, '食べる means to eat.');
assistants.answers.add(
_proposes([('食べる', 'to eat'), ('飲む', 'to drink'), ('見る', 'to see')]),
);
await tester.tap(find.text('Add material'));
await tester.pumpAndSettle();
await tapAndSettle(tester, find.text('Flashcards from a text'));
await tester.enterText(
find.byType(TextField).last,
'食べる means to eat.',
);
await tester.pump();
await tapAndSettle(tester, find.text('Propose flashcards'));
await tapAndSettle(tester, find.byTooltip('Flashcards from this note'));
expect(find.text('Flashcards by Claude'), findsOneWidget);
expect(_sent(assistants.asked.single.$2), '食べる means to eat.');
expect(_sent(assistants.asked.single.$2), 'Verbs\n\n食べる means to eat.');
expect(find.text('Add 3 flashcards'), findsOneWidget);
await tester.tap(find.text('飲む'));
@ -196,7 +197,7 @@ void main() {
testWidgets('none proposed says so, and Try again asks once more', (
tester,
) async {
await showApp(tester, RoutePaths.studyset('japanese'));
await showNote(tester, 'Some text.');
assistants.answers
..add([
LlmFinished(
@ -206,12 +207,7 @@ void main() {
),
])
..add(_proposes([('Q', 'A')]));
await tester.tap(find.text('Add material'));
await tester.pumpAndSettle();
await tapAndSettle(tester, find.text('Flashcards from a text'));
await tester.enterText(find.byType(TextField).last, 'Some text.');
await tester.pump();
await tapAndSettle(tester, find.text('Propose flashcards'));
await tapAndSettle(tester, find.byTooltip('Flashcards from this note'));
expect(find.text('Claude proposed no flashcards.'), findsOneWidget);
await tapAndSettle(tester, find.text('Try again'));
@ -282,6 +278,16 @@ void main() {
);
});
testWidgets('Add material offers no flashcards from a text (the '
"developer's review of 4 Nov 2026): a note's, a page's are enough", (
tester,
) async {
await showApp(tester, RoutePaths.studyset('japanese'));
await tester.tap(find.text('Add material'));
await tester.pumpAndSettle();
expect(find.text('Flashcards from a text'), findsNothing);
});
testWidgets('nothing offers flashcards without an assistant', (
tester,
) async {
@ -292,13 +298,6 @@ void main() {
'japanese',
NoteContent(title: 'Kana', body: RichContent.plain('あ is a.')),
);
await showApp(tester, RoutePaths.studyset('japanese'));
await tester.tap(find.text('Add material'));
await tester.pumpAndSettle();
expect(find.text('Flashcards from a text'), findsNothing);
await tester.tapAt(Offset.zero);
await tester.pumpAndSettle();
await showApp(tester, RoutePaths.note('japanese', noteId));
expect(find.byTooltip('Flashcards from this note'), findsNothing);
});