feat(app): one Profile for every app, the person's own tab first, then each app's (ADR 0014)

The public profile was already one per person for every service of an
instance (the register, ADR 0016); its app side was Learn's alone. It
moves into halkyon_app: the model, the repository on the module's
endpoints, the form, the avatar drawn on the device and the sheet with
someone's profile. They take the Public prefix (PublicProfileRepository,
BasePublicProfileGateway), as Train's own ProfileRepository holds the
body's figures. AppDependencies gains profiles and files, the picker the
avatar is chosen with, which moves out of Learn too.

HalkyonProfile is every app's Profile screen: the person's own tab first,
the same in every app (the account and the ways they sign in, the app's
own cards, then the public profile), then the app's own tabs, folding into
the title. Learn adds its inbox and Statistics. Train adds Progress, Days
and, where nothing records, Plans, and so opens on the person's tab, no
longer on Progress. Todo, which has no Profile tab, opens it from a row at
the top of Browse, where Todoist keeps the account.

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-02 09:44:38 +01:00
commit b7b0b937fe
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64
10 changed files with 1668 additions and 1293 deletions

View file

@ -9,6 +9,8 @@
"shellTabToday": "Heute",
"shellTabUpcoming": "Demnächst",
"shellTabInbox": "Eingang",
"browseProfile": "Profil",
"browseProfileHint": "Dein Konto, wie du dich anmeldest, und dein öffentliches Profil",
"shellTabBrowse": "Übersicht",
"settingsTitle": "Einstellungen",
"settingsVersion": "Version {version} (Build {build})",

View file

@ -15,6 +15,8 @@
"shellTabToday": "Today",
"shellTabUpcoming": "Upcoming",
"shellTabInbox": "Inbox",
"browseProfile": "Profile",
"browseProfileHint": "Your account, how you sign in and your public profile",
"shellTabBrowse": "Browse",
"settingsTitle": "Settings",
"settingsVersion": "Version {version} (build {build})",

View file

@ -154,6 +154,18 @@ abstract class AppLocalizations {
/// **'Inbox'**
String get shellTabInbox;
/// No description provided for @browseProfile.
///
/// In en, this message translates to:
/// **'Profile'**
String get browseProfile;
/// No description provided for @browseProfileHint.
///
/// In en, this message translates to:
/// **'Your account, how you sign in and your public profile'**
String get browseProfileHint;
/// No description provided for @shellTabBrowse.
///
/// In en, this message translates to:

View file

@ -38,6 +38,13 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get shellTabInbox => 'Eingang';
@override
String get browseProfile => 'Profil';
@override
String get browseProfileHint =>
'Dein Konto, wie du dich anmeldest, und dein öffentliches Profil';
@override
String get shellTabBrowse => 'Übersicht';

View file

@ -38,6 +38,13 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get shellTabInbox => 'Inbox';
@override
String get browseProfile => 'Profile';
@override
String get browseProfileHint =>
'Your account, how you sign in and your public profile';
@override
String get shellTabBrowse => 'Browse';

View file

@ -130,6 +130,13 @@ class TodoDependencies({
/// recovery codes).
@override required final FileSaver fileSaver,
/// Lets the person pick a file of the device (their profile's picture).
@override required final FilePicker files,
/// People's public profiles on the instance, the person's own among them:
/// one for every Halkyon app (decided 2026-11-02).
@override required final PublicProfileRepository profiles,
/// Where the source of what the instance runs is, as its basics name it
/// (halkyon_base): both licences ask to offer it, which About does
/// ([sourceCodeUrl]).
@ -232,6 +239,10 @@ class TodoDependencies({
assistants: assistants,
assistantOperators: assistantOperators,
fileSaver: PlatformFileSaver(),
files: FileSelectorFilePicker(),
profiles: PublicProfileRepository(
BasePublicProfileGateway(client.modules.base),
),
appVersion: (version: device.appVersion, build: device.appBuild),
sourceCodeUrl: () async =>
(await client.modules.base.instance.basics()).sourceCodeUrl,

View file

@ -1,5 +1,5 @@
/// The app's locations (ADR 0033, D2): the four tabs, and Settings over
/// them.
/// The app's locations (ADR 0033, D2): the four tabs, and Settings and the
/// Profile over them.
abstract final class TodoPaths() {
/// Today, where the app opens.
static const today = '/';
@ -18,4 +18,8 @@ abstract final class TodoPaths() {
/// Settings, over the tabs.
static const settings = '/settings';
/// The person's Profile, every Halkyon app's, over the tabs, opened from
/// Browse.
static const profile = '/profile';
}

View file

@ -1,4 +1,5 @@
import 'package:go_router/go_router.dart';
import 'package:halkyon_app/halkyon_app.dart';
import 'package:halkyon_todo_flutter/src/app/todo_paths.dart';
import 'package:halkyon_todo_flutter/src/feature/project/widget/project_screen.dart';
import 'package:halkyon_todo_flutter/src/settings/settings_screen.dart';
@ -68,5 +69,11 @@ GoRouter buildTodoRouter() => GoRouter(
path: TodoPaths.settings,
builder: (context, state) => const FramedScreen(child: SettingsScreen()),
),
// Every Halkyon app's Profile (decided 2026-11-02): Todo has no tab of
// its own for it, as Todoist keeps the account behind Browse.
GoRoute(
path: TodoPaths.profile,
builder: (context, state) => const FramedScreen(child: HalkyonProfile()),
),
],
);

View file

@ -14,7 +14,9 @@ import 'package:halkyon_ui/halkyon_ui.dart';
import 'package:lucide_icons_flutter/lucide_icons.dart';
import 'package:material_ui/material_ui.dart';
/// Browse (ADR 0033, D2): the person's projects, each in its colour with
/// Browse (ADR 0033, D2): the person's Profile on top, every Halkyon
/// app's, as Todoist keeps the account there (decided 2026-11-02); the
/// person's projects, each in its colour with
/// how many of its tasks are open, one opening its screen, and one more to
/// add; their labels, to add, rename or delete; the cog to Settings. What
/// doesn't open on this device is counted at the foot.
@ -64,6 +66,17 @@ class const BrowseTab({super.key}) extends StatelessWidget {
24 + FloatingNavigationBar.coverOf(context),
),
children: [
SectionCard(
padding: EdgeInsets.zero,
child: ListTile(
leading: const Icon(LucideIcons.circleUserRound),
title: Text(l10n.browseProfile),
subtitle: Text(l10n.browseProfileHint),
trailing: const Icon(LucideIcons.chevronRight),
onTap: () => context.push(TodoPaths.profile),
),
),
const SizedBox(height: 12),
SectionCard(
padding: const EdgeInsets.only(bottom: 8),
child: Column(

View file

@ -140,6 +140,11 @@ void main() {
FakeInstanceOperatorGateway(),
),
fileSaver: MemoryFileSaver(),
files: FakeFilePicker(),
profiles: PublicProfileRepository(
FakePublicProfileGateway(),
drawAvatar: (picture) async => picture,
),
appVersion: (version: '0.1.0', build: 1),
sourceCodeUrl: () async =>
'https://code.halkyon.app/project-halkyon/halkyon',
@ -303,6 +308,25 @@ void main() {
expect(find.widgetWithText(AppBar, 'Browse'), findsOneWidget);
});
testWidgets("Browse's Profile row opens every Halkyon app's Profile over "
'the tabs: the account, how the person signs in, and the public '
'profile', (tester) async {
await start(tester, usedBefore: true);
await goTab(tester, 'Browse');
await tester.tap(find.text('Profile'));
await tester.pumpAndSettle();
expect(find.byType(HalkyonProfile), findsOneWidget);
expect(find.byType(NavigationBar), findsNothing);
expect(find.text('Ways to sign in'), findsOneWidget);
expect(find.byType(PublicProfileSection), findsOneWidget);
await tester.pageBack();
await tester.pumpAndSettle();
expect(find.widgetWithText(AppBar, 'Browse'), findsOneWidget);
});
testWidgets(
'Settings has Sync first, the account, then About Halkyon Todo last and '
'the version small at the very foot',