feat(studyset): every menu of a studyset offers all of its options
The library's card offered six options, a topic three, the studyset's own screen all of them. Each now offers the same, from one list: edit, move, study options, import and export content, reset progress, archive or unarchive, delete, more info, and for a copy reporting to its author and its reports and suggestions. Importing runs where the studyset's blocs are, so from the library or a topic it opens the studyset's screen, which asks what to import as it opens. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MMm7usAo6q9ZZRoPkWjoxi Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
b70d8e4ed2
commit
b7e5b695b9
3 changed files with 460 additions and 409 deletions
|
|
@ -393,8 +393,8 @@ void main() {
|
|||
expect(find.text('No studysets match your search'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('the options offer, in this order: Edit, Move, Study options, '
|
||||
'Import from Anki, Archive and Delete', (tester) async {
|
||||
testWidgets("the options are every studyset's, as its screen has them, "
|
||||
'in this order', (tester) async {
|
||||
stored('japanese', 'Japanese');
|
||||
await showLibrary(tester);
|
||||
|
||||
|
|
@ -406,9 +406,12 @@ void main() {
|
|||
'Edit',
|
||||
'Move to…',
|
||||
'Study options',
|
||||
'Import from Anki',
|
||||
'Import content',
|
||||
'Export content',
|
||||
'Reset progress',
|
||||
'Archive',
|
||||
'Delete',
|
||||
'More info',
|
||||
])
|
||||
tester.getTopLeft(find.text(label)).dy,
|
||||
];
|
||||
|
|
@ -437,13 +440,19 @@ void main() {
|
|||
expect(gateway.moves.single.$2, 'languages');
|
||||
});
|
||||
|
||||
testWidgets('imports from Anki into the studyset from its options', (
|
||||
tester,
|
||||
) async {
|
||||
testWidgets('Import content opens the studyset, asking there what to '
|
||||
'import: from Anki, say', (tester) async {
|
||||
stored('japanese', 'Japanese');
|
||||
await showLibrary(tester);
|
||||
|
||||
await choose(tester, 'Japanese', 'Import from Anki');
|
||||
await choose(tester, 'Japanese', 'Import content');
|
||||
await tester.pumpAndSettle();
|
||||
expect(
|
||||
find.descendant(of: find.byType(AppBar), matching: find.text('Japanese')),
|
||||
findsOneWidget,
|
||||
);
|
||||
await tester.tap(find.text('Anki deck'));
|
||||
await tester.pump();
|
||||
await tester.pump();
|
||||
|
||||
expect(files.asked, [
|
||||
|
|
|
|||
|
|
@ -50,13 +50,7 @@ void main() {
|
|||
onOpen: () => calls.add('open'),
|
||||
onStudy: () => calls.add('study'),
|
||||
onToggleStar: () => calls.add('star'),
|
||||
onEdit: () => calls.add('edit'),
|
||||
onMove: () => calls.add('move'),
|
||||
onStudyOptions: () => calls.add('study options'),
|
||||
onImport: () => calls.add('import'),
|
||||
onArchive: () => calls.add('archive'),
|
||||
onUnarchive: () => calls.add('unarchive'),
|
||||
onDelete: () => calls.add('delete'),
|
||||
onOption: (option) => calls.add(option.name),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
@ -237,6 +231,9 @@ void main() {
|
|||
|
||||
for (final (option, call) in [
|
||||
('Edit', 'edit'),
|
||||
('Import content', 'importContent'),
|
||||
('Export content', 'exportContent'),
|
||||
('Reset progress', 'reset'),
|
||||
('Archive', 'archive'),
|
||||
('Delete', 'delete'),
|
||||
]) {
|
||||
|
|
|
|||
|
|
@ -328,8 +328,8 @@ void main() {
|
|||
expect(find.text('All topics'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('a long press on a topic opens its options: edit, reset its '
|
||||
'progress, delete', (tester) async {
|
||||
testWidgets("a long press on a topic opens its options, every "
|
||||
"studyset's", (tester) async {
|
||||
stored('japanese', 'Japanese');
|
||||
stored('kana', 'Kana', parent: 'japanese');
|
||||
await openFromLibrary(tester, 'Japanese');
|
||||
|
|
@ -337,9 +337,19 @@ void main() {
|
|||
await tester.longPress(find.text('Kana'));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.text('Edit'), findsOneWidget);
|
||||
expect(find.text('Reset progress'), findsOneWidget);
|
||||
expect(find.text('Delete'), findsOneWidget);
|
||||
for (final option in [
|
||||
'Edit',
|
||||
'Move to…',
|
||||
'Study options',
|
||||
'Import content',
|
||||
'Export content',
|
||||
'Reset progress',
|
||||
'Archive',
|
||||
'Delete',
|
||||
'More info',
|
||||
]) {
|
||||
expect(find.text(option), findsOneWidget, reason: option);
|
||||
}
|
||||
});
|
||||
|
||||
testWidgets("resetting a topic's progress asks what of it starts afresh, "
|
||||
|
|
|
|||
Loading…
Reference in a new issue