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
2 changed files with 1668 additions and 1293 deletions

View file

@ -193,6 +193,13 @@ class TrainDependencies({
/// 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]).
@ -295,6 +302,10 @@ class TrainDependencies({
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

@ -9,28 +9,26 @@ import 'package:halkyon_train_flutter/src/settings/settings_screen.dart';
import 'package:halkyon_ui/halkyon_ui.dart';
import 'package:material_ui/material_ui.dart';
/// Profile (ADR 0030, D60) in tabs folding into the title as Strava's
/// ([FoldingTabs]): Progress, with *Your body* ([BodyCard]), the last 12
/// weeks ([WeeksCard]) and this year ([YearCard]); the person's days from
/// the Loop (D37); and, where the device doesn't record and so has no Record
/// Profile (ADR 0030, D60): every Halkyon app's ([HalkyonProfile], decided
/// 2026-11-02), the person's own tab first (their account, how they sign
/// in, their public profile), then Train's in tabs folding into the title
/// as Strava's: Progress, with *Your body* ([BodyCard]), the last 12 weeks
/// ([WeeksCard]) and this year ([YearCard]); the person's days from the
/// Loop (D37); and, where the device doesn't record and so has no Record
/// tab, the interval plans (D42). The cog leads to Settings.
class const ProfileTab({super.key}) extends StatelessWidget {
@override
Widget build(BuildContext context) {
final l10n = AppLocalizations.of(context);
final records = PersonScope.of<TrainPerson>(context).recording != null;
return TopGradient(
background: Theme.of(context).colorScheme.surface,
child: FoldingTabs(
title: l10n.shellTabProfile,
actions: const [SettingsButton()],
tabs: [
FoldingTab(label: l10n.profileTabProgress, body: const _Progress()),
FoldingTab(label: l10n.homeDays, body: const DaysList()),
if (!records)
FoldingTab(label: l10n.homePlans, body: const PlansList()),
],
),
return HalkyonProfile(
actions: const [SettingsButton()],
tabs: [
FoldingTab(label: l10n.profileTabProgress, body: const _Progress()),
FoldingTab(label: l10n.homeDays, body: const DaysList()),
if (!records)
FoldingTab(label: l10n.homePlans, body: const PlansList()),
],
);
}
}