feat(learn): an archive's import shows its steps, counts and percent, with Abort

Importing a Halkyon archive showed one bar. It now says which of its three
steps it is in (copying files; writing studysets, flashcards and notes;
bringing over the progress), how many of the step's items are done and the
percent of all of it, and offers Abort (decided 9 Nov 2026).

The copier checks between items, never leaving one half written, and
keeps a trail of what it wrote: the top studyset once made, and the files'
rows it made (not those the person had, found before each file is added).
Aborted, the importer deletes the top studyset for good with everything
inside it, as Delete now does (the reviews, answers and pages read going
with their cards, steps and PDFs), and those rows; the tags it made stay,
as names the person may well use anyway. Once all of it is written, Abort
no longer undoes it.

WorkProgress, WorkStages and AbortSignal (core/work/) and
WorkProgressView (core/widget/) are shared with the Anki import and the
exports, which follow.

Whats-New: Importing an archive shows its steps and how far it has come, and Abort stops it, keeping nothing of it.
Whats-New-De: Der Import eines Archivs zeigt seine Schritte und wie weit er ist, und „Abbrechen“ beendet ihn, ohne etwas davon zu behalten.

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 15:53:31 +01:00
commit 5f7cb70c3c
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64
5 changed files with 901 additions and 53 deletions

View file

@ -2097,5 +2097,22 @@
"assistantAddTitle": "Zu deiner Frage hinzufügen",
"assistantAddCamera": "Kamera",
"assistantAddPhotos": "Fotos",
"assistantAddFiles": "Dateien"
"assistantAddFiles": "Dateien",
"workStep": "Schritt {step} von {steps}: {name}",
"workCount": "{done} von {total}",
"workPercent": "{percent} %",
"workAbort": "Abbrechen",
"workAborting": "Wird abgebrochen …",
"workStageFiles": "Dateien kopieren",
"workStageContent": "Lernsets, Karteikarten und Notizen schreiben",
"workStageProgress": "Deinen Fortschritt übernehmen",
"workStageCards": "Karteikarten schreiben",
"workStageTags": "Tags vergeben",
"workStageReviews": "Den Lernverlauf übernehmen",
"workStageReading": "Inhalte lesen",
"workStageGathering": "Dateien sammeln",
"workStagePacking": "Packen",
"importAborted": "Import abgebrochen: Nichts davon wurde behalten.",
"exportAborted": "Export abgebrochen.",
"exportProgressTitle": "Wird exportiert"
}

View file

@ -2518,5 +2518,39 @@
"assistantAddPhotos": "Photos",
"@assistantAddPhotos": {"description": "Tile in +'s sheet: picks photos from the device."},
"assistantAddFiles": "Files",
"@assistantAddFiles": {"description": "Tile in +'s sheet: picks files (PDFs, texts, images)."}
"@assistantAddFiles": {"description": "Tile in +'s sheet: picks files (PDFs, texts, images)."},
"workStep": "Step {step} of {steps}: {name}",
"@workStep": {"description": "An import's or export's progress: the step it is in, of all, and its name (decided 9 Nov 2026).", "placeholders": {"step": {"type": "int"}, "steps": {"type": "int"}, "name": {"type": "String"}}},
"workCount": "{done} of {total}",
"@workCount": {"description": "An import's or export's progress: how many of the step's items are done, the numbers formatted.", "placeholders": {"done": {"type": "String"}, "total": {"type": "String"}}},
"workPercent": "{percent}%",
"@workPercent": {"description": "An import's or export's progress: how much of all of it is done.", "placeholders": {"percent": {"type": "int"}}},
"workAbort": "Abort",
"@workAbort": {"description": "Stops an import or an export under way; an import's Abort deletes what it made."},
"workAborting": "Aborting…",
"@workAborting": {"description": "An import or export stopping after Abort, an import deleting what it made."},
"workStageFiles": "Copying files",
"@workStageFiles": {"description": "An import's step: the files its content names."},
"workStageContent": "Writing studysets, flashcards and notes",
"@workStageContent": {"description": "An archive import's step: its content."},
"workStageProgress": "Bringing over your progress",
"@workStageProgress": {"description": "An archive import's step: reviews, answers and pages read."},
"workStageCards": "Writing flashcards",
"@workStageCards": {"description": "An Anki import's step: its notes as flashcards."},
"workStageTags": "Tagging",
"@workStageTags": {"description": "An Anki import's step: the flashcards' tags."},
"workStageReviews": "Bringing over the review history",
"@workStageReviews": {"description": "An Anki import's step: its reviews."},
"workStageReading": "Reading the content",
"@workStageReading": {"description": "An export's step: the studysets and what is in them."},
"workStageGathering": "Gathering files",
"@workStageGathering": {"description": "An export's step: the files its content names."},
"workStagePacking": "Packing",
"@workStagePacking": {"description": "An export's step: the zip file made."},
"importAborted": "Import aborted: nothing of it was kept.",
"@importAborted": {"description": "Snack bar after an import's Abort, which deleted what it had made."},
"exportAborted": "Export aborted.",
"@exportAborted": {"description": "Snack bar after an export's Abort."},
"exportProgressTitle": "Exporting",
"@exportProgressTitle": {"description": "The sheet showing an export's progress."}
}

View file

@ -12367,6 +12367,108 @@ abstract class AppLocalizations {
/// In en, this message translates to:
/// **'Files'**
String get assistantAddFiles;
/// An import's or export's progress: the step it is in, of all, and its name (decided 9 Nov 2026).
///
/// In en, this message translates to:
/// **'Step {step} of {steps}: {name}'**
String workStep(int step, int steps, String name);
/// An import's or export's progress: how many of the step's items are done, the numbers formatted.
///
/// In en, this message translates to:
/// **'{done} of {total}'**
String workCount(String done, String total);
/// An import's or export's progress: how much of all of it is done.
///
/// In en, this message translates to:
/// **'{percent}%'**
String workPercent(int percent);
/// Stops an import or an export under way; an import's Abort deletes what it made.
///
/// In en, this message translates to:
/// **'Abort'**
String get workAbort;
/// An import or export stopping after Abort, an import deleting what it made.
///
/// In en, this message translates to:
/// **'Aborting…'**
String get workAborting;
/// An import's step: the files its content names.
///
/// In en, this message translates to:
/// **'Copying files'**
String get workStageFiles;
/// An archive import's step: its content.
///
/// In en, this message translates to:
/// **'Writing studysets, flashcards and notes'**
String get workStageContent;
/// An archive import's step: reviews, answers and pages read.
///
/// In en, this message translates to:
/// **'Bringing over your progress'**
String get workStageProgress;
/// An Anki import's step: its notes as flashcards.
///
/// In en, this message translates to:
/// **'Writing flashcards'**
String get workStageCards;
/// An Anki import's step: the flashcards' tags.
///
/// In en, this message translates to:
/// **'Tagging'**
String get workStageTags;
/// An Anki import's step: its reviews.
///
/// In en, this message translates to:
/// **'Bringing over the review history'**
String get workStageReviews;
/// An export's step: the studysets and what is in them.
///
/// In en, this message translates to:
/// **'Reading the content'**
String get workStageReading;
/// An export's step: the files its content names.
///
/// In en, this message translates to:
/// **'Gathering files'**
String get workStageGathering;
/// An export's step: the zip file made.
///
/// In en, this message translates to:
/// **'Packing'**
String get workStagePacking;
/// Snack bar after an import's Abort, which deleted what it had made.
///
/// In en, this message translates to:
/// **'Import aborted: nothing of it was kept.'**
String get importAborted;
/// Snack bar after an export's Abort.
///
/// In en, this message translates to:
/// **'Export aborted.'**
String get exportAborted;
/// The sheet showing an export's progress.
///
/// In en, this message translates to:
/// **'Exporting'**
String get exportProgressTitle;
}
class _AppLocalizationsDelegate

View file

@ -7959,4 +7959,62 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get assistantAddFiles => 'Dateien';
@override
String workStep(int step, int steps, String name) {
return 'Schritt $step von $steps: $name';
}
@override
String workCount(String done, String total) {
return '$done von $total';
}
@override
String workPercent(int percent) {
return '$percent %';
}
@override
String get workAbort => 'Abbrechen';
@override
String get workAborting => 'Wird abgebrochen …';
@override
String get workStageFiles => 'Dateien kopieren';
@override
String get workStageContent => 'Lernsets, Karteikarten und Notizen schreiben';
@override
String get workStageProgress => 'Deinen Fortschritt übernehmen';
@override
String get workStageCards => 'Karteikarten schreiben';
@override
String get workStageTags => 'Tags vergeben';
@override
String get workStageReviews => 'Den Lernverlauf übernehmen';
@override
String get workStageReading => 'Inhalte lesen';
@override
String get workStageGathering => 'Dateien sammeln';
@override
String get workStagePacking => 'Packen';
@override
String get importAborted =>
'Import abgebrochen: Nichts davon wurde behalten.';
@override
String get exportAborted => 'Export abgebrochen.';
@override
String get exportProgressTitle => 'Wird exportiert';
}

View file

@ -7887,6 +7887,63 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get assistantAddFiles => 'Files';
@override
String workStep(int step, int steps, String name) {
return 'Step $step of $steps: $name';
}
@override
String workCount(String done, String total) {
return '$done of $total';
}
@override
String workPercent(int percent) {
return '$percent%';
}
@override
String get workAbort => 'Abort';
@override
String get workAborting => 'Aborting…';
@override
String get workStageFiles => 'Copying files';
@override
String get workStageContent => 'Writing studysets, flashcards and notes';
@override
String get workStageProgress => 'Bringing over your progress';
@override
String get workStageCards => 'Writing flashcards';
@override
String get workStageTags => 'Tagging';
@override
String get workStageReviews => 'Bringing over the review history';
@override
String get workStageReading => 'Reading the content';
@override
String get workStageGathering => 'Gathering files';
@override
String get workStagePacking => 'Packing';
@override
String get importAborted => 'Import aborted: nothing of it was kept.';
@override
String get exportAborted => 'Export aborted.';
@override
String get exportProgressTitle => 'Exporting';
}
/// The translations for English, as used in the United Kingdom (`en_GB`).