feat(learn): confirm the notes and files a release takes

ADR 0044, D8 and D9, its first step: before publishing to Explore, the
person confirms the notes, PDFs and other files that go. Cards and
learning paths always go.

Publish's Continue leads to a step listing them by kind, none ticked at
first but those the latest release held. Each kind is ticked whole, and
an item's menu ticks everything but it or nothing but it. What isn't
ticked goes to the server as publish's leftOut. So does whatever the
sync before publishing brings that the person never saw.

The server leaves those out of the release and its counts, and leaves
out the files only they name. leftOut is optional: released apps send
none and publish everything, as before. publish.releasedMaterial names
the notes and files of the latest release, and none for a studyset not
the caller's, as for one never published.

Whats-New: Before publishing to Explore, you choose which notes and files go with the cards and learning paths.
Whats-New-De: Vor dem Veröffentlichen auf Explore wählst du, welche Notizen und Dateien mit den Karteikarten und Lernpfaden mitgehen.

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 01:54:16 +01:00
commit d664115c46
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -17,8 +17,20 @@ class FakePublishGateway({
/// Refusals to answer the next publishes with, the first first.
final refusals = <PublishRefused>[];
/// What each publish was asked: the studyset, name and notes.
final publishes = <({String studysetId, String slug, String notes})>[];
/// What each publish was asked: the studyset, name, notes and what it
/// left out.
final publishes =
<
({
String studysetId,
String slug,
String notes,
List<String> leftOut,
})
>[];
/// The material of each studyset's latest release, by id.
final released = <String, Set<String>>{};
/// The description for Explore each publish sent, in order.
final descriptions = <RichContent?>[];
@ -60,11 +72,20 @@ class FakePublishGateway({
);
}
@override
Future<Set<String>> releasedMaterial(String studysetId) async {
if (fail case final error?) {
throw error;
}
return released[studysetId] ?? const {};
}
@override
Future<Publication> publish(
String studysetId, {
required String slug,
required String notes,
required List<String> leftOut,
RichContent? description,
Map<String, String>? tagNames,
}) async {
@ -72,7 +93,12 @@ class FakePublishGateway({
if (fail case final error?) {
throw error;
}
publishes.add((studysetId: studysetId, slug: slug, notes: notes));
publishes.add((
studysetId: studysetId,
slug: slug,
notes: notes,
leftOut: leftOut,
));
descriptions.add(description);
if (refusals.isNotEmpty) {
throw refusals.removeAt(0);