fix(learn): Archived and Recently deleted fold during a search

A search opened both sections whatever they were set to, so a tap on
their headers did nothing while one was under way. A search still opens
them, so their matches show, and a tap now folds them until the search
ends, which brings them back as they were left before it.

Whats-New: While searching the library, Archived and Recently deleted fold again when tapped.
Whats-New-De: Beim Suchen in der Bibliothek lassen sich Archiviert und Zuletzt gelöscht wieder einklappen.

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-11 15:44:51 +01:00
commit 3ee29de391
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -683,6 +683,35 @@ void main() {
expect(find.text('Kanji'), findsNothing, reason: 'the archive is closed');
});
testWidgets('a search opens the archive, which a tap folds for the rest '
'of the search', (tester) async {
stored(
'kanji',
'Kanji',
secondaryTitle: 'Japanese',
archivedAt: DateTime.utc(2026, 10),
);
await showLibrary(tester);
await tester.tap(find.byTooltip('Search'));
await tester.pumpAndSettle();
await tester.enterText(find.byType(TextField), 'kan');
await tester.pumpAndSettle();
expect(find.text('Kanji'), findsOneWidget);
await tester.tap(find.text('Archived'));
await tester.pumpAndSettle();
expect(find.text('Kanji'), findsNothing);
await tester.enterText(find.byType(TextField), 'kanj');
await tester.pumpAndSettle();
expect(find.text('Kanji'), findsNothing, reason: 'still folded');
await tester.tap(find.text('Archived'));
await tester.pumpAndSettle();
expect(find.text('Kanji'), findsOneWidget);
});
testWidgets('a search lists titles starting with what is typed first, then '
'those holding it as a word, then secondary titles, whatever was changed '
'last', (tester) async {