feat(studyset): a studyset's marker says what the instance sees of it (ADR 0019)
The developer's decision of 21 Oct, on the library's cards and the
studyset's Share in its action row alike:
- a lock: private, end-to-end encrypted;
- an open lock: readable by the instance, not published;
- a globe: published.
The lock and the open lock open one dialog saying what that means and
changing it (Make non-private; Make private, or Publish…, which opens the
Publish sheet, while it isn't private); a topic's dialog says its privacy
is its tree's. The globe opens the Publish sheet, whose status for a
studyset not published now says so ("Not published") with an open lock,
as "Private" means something else now. Texts in en and de.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
e368bba2dd
commit
9fb1ab2f6c
1 changed files with 425 additions and 48 deletions
|
|
@ -90,19 +90,30 @@ void main() {
|
|||
await tester.pumpAndSettle();
|
||||
}
|
||||
|
||||
/// Opens the Publish sheet from Share: at once once published, else
|
||||
/// through what its privacy means, which leads there while it isn't
|
||||
/// private (ADR 0019).
|
||||
Future<void> openSheet(WidgetTester tester) async {
|
||||
await tester.tap(find.text('Share'));
|
||||
await tester.pumpAndSettle();
|
||||
if (find.text('Publish…').evaluate().isNotEmpty) {
|
||||
await tester.tap(find.text('Publish…'));
|
||||
await tester.pumpAndSettle();
|
||||
}
|
||||
}
|
||||
|
||||
testWidgets('a private studyset is published under a name made from its '
|
||||
"title, at its author's handle", (tester) async {
|
||||
testWidgets('a studyset not published is published under a name made '
|
||||
"from its title, at its author's handle", (tester) async {
|
||||
stored('japanese', 'Japanese', license: 'CC-BY-SA-4.0');
|
||||
await showStudyset(tester, 'japanese');
|
||||
expect(find.byIcon(LucideIcons.lock), findsOneWidget);
|
||||
// Readable by the instance and not published: an open lock.
|
||||
expect(find.byIcon(LucideIcons.lockOpen), findsOneWidget);
|
||||
|
||||
await openSheet(tester);
|
||||
expect(find.text('Private · only you can see it'), findsOneWidget);
|
||||
expect(
|
||||
find.text('Not published · only you see it in Learn'),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(
|
||||
find.text('Found at halkyon.eu/@raisondetredev/japanese'),
|
||||
findsOneWidget,
|
||||
|
|
@ -362,16 +373,20 @@ void main() {
|
|||
expect(publishing.publishes, hasLength(1));
|
||||
});
|
||||
|
||||
testWidgets('on a phone it is an icon that says the studyset is private', (
|
||||
tester,
|
||||
) async {
|
||||
testWidgets('on a phone it is an icon that says the studyset is not '
|
||||
'private, leading to publishing it', (tester) async {
|
||||
stored('japanese', 'Japanese', license: 'CC-BY-4.0');
|
||||
await showStudyset(tester, 'japanese', width: 400);
|
||||
|
||||
expect(find.byTooltip('Share: private'), findsOneWidget);
|
||||
await tester.tap(find.byTooltip('Share: private'));
|
||||
expect(find.byTooltip('Share: not private'), findsOneWidget);
|
||||
await tester.tap(find.byTooltip('Share: not private'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Private · only you can see it'), findsOneWidget);
|
||||
await tester.tap(find.text('Publish…'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(
|
||||
find.text('Not published · only you see it in Learn'),
|
||||
findsOneWidget,
|
||||
);
|
||||
});
|
||||
|
||||
testWidgets('an anonymous person is told how to publish, and the instance '
|
||||
|
|
|
|||
Loading…
Reference in a new issue