feat(app)!: no anonymous accounts on the device (ADR 0020, D4, D25)

Every account has a way in, so the apps make no anonymous account any
more. The start screen shows whenever nobody is signed in, a first
start included, and offers SimpleLogin, a password and GitHub for those
who have it, with no start without an account. An instance out of reach
is said so, with Try again, and one offering no way to create an account
too. An anonymous account's session left from before is deleted as the
app starts (D25), falling back to signing out on the device.

What only anonymous accounts needed goes: signing in anonymously, the
signed-out mark, adding GitHub to an account and switching to a GitHub
account from the Profile tab (with its Cancel, the only one), an
anonymous device's own keys, the warning that signing out deletes the
account, and the texts about keeping progress. Settings says on which
instance the account is signed in. Learn's publishing, reports and
suggestions and its learner count no longer ask whether the person has
an identity: everyone signed in has one.

The server still offers anonymous sign-in until the next commit, so
older apps keep working until v0.20.0 raises the minimum build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-10-24 14:50:55 +02:00
commit 5b9df73756
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64
2 changed files with 981 additions and 3339 deletions

View file

@ -2,8 +2,6 @@ import 'dart:async';
import 'package:clock/clock.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:halkyon_app/halkyon_app.dart';
import 'package:halkyon_app/testing.dart';
import 'package:halkyon_learn_flutter/src/core/content/published_ref.dart';
import 'package:halkyon_learn_flutter/src/core/content/rich_content.dart';
import 'package:halkyon_learn_flutter/src/core/router/route_paths.dart';
@ -41,13 +39,11 @@ void main() {
/// How many syncs ran.
var syncs = 0;
/// Shows the library in a window [width] wide; to a person with an
/// identity ([identified]), whose studysets [publishing] publishes and
/// [publishedStore] remembers as published.
/// Shows the library in a window [width] wide, whose studysets
/// [publishing] publishes and [publishedStore] remembers as published.
Future<void> showLibrary(
WidgetTester tester, {
double width = 1200,
bool identified = false,
FakePublishGateway? publishing,
MemoryPublishedStore? publishedStore,
}) async {
@ -58,14 +54,6 @@ void main() {
await pumpApp(
tester,
testDependencies(
authGateway: identified
? FakeAuthGateway(
status: const SignedIn(
authUserId: 'github-person',
isIdentified: true,
),
)
: null,
studysetGateway: gateway,
cardGateway: cardGateway,
files: files,
@ -810,7 +798,6 @@ void main() {
await showLibrary(
tester,
identified: true,
publishing: FakePublishGateway(
publications: {
'japanese': publication(),
@ -850,7 +837,6 @@ void main() {
await showLibrary(
tester,
identified: true,
publishing: FakePublishGateway()..fail = Exception('Offline'),
publishedStore: MemoryPublishedStore({'japanese'}),
);
@ -876,7 +862,7 @@ void main() {
await tester.tap(find.text('Publish…'));
await tester.pumpAndSettle();
expect(
find.text('Sign in to have a public profile and publish.'),
find.text('Not published · only you see it in Learn'),
findsOneWidget,
);
await tester.tapAt(Offset.zero);
@ -912,7 +898,6 @@ void main() {
stored('japanese', 'Japanese');
await showLibrary(
tester,
identified: true,
publishing: FakePublishGateway(
publications: {'japanese': publication()},
),

View file

@ -1870,9 +1870,12 @@ void main() {
expect(find.byType(StudysetScreen), findsNothing);
expect(find.text('Japanese'), findsNothing);
expect(find.text('Signed out'), findsOneWidget);
expect(find.text('Start on learn.example.org:'), findsOneWidget);
await tester.tap(find.text('Start without an account'));
await tester.tap(find.text('Sign in with GitHub'));
await tester.pumpAndSettle();
// A password is offered first (ADR 0017, D2); put off, the app.
await tester.tap(find.text('Later'));
await tester.pumpAndSettle();
expect(find.text('Japanese'), findsNothing);