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:
parent
a0bb75f1ad
commit
b7b0b937fe
1 changed files with 1668 additions and 1293 deletions
|
|
@ -160,6 +160,11 @@ void main() {
|
|||
FakeInstanceOperatorGateway(),
|
||||
),
|
||||
fileSaver: MemoryFileSaver(),
|
||||
files: FakeFilePicker(),
|
||||
profiles: PublicProfileRepository(
|
||||
FakePublicProfileGateway(),
|
||||
drawAvatar: (picture) async => picture,
|
||||
),
|
||||
appVersion: (version: '0.1.0', build: 7),
|
||||
sourceCodeUrl: () async =>
|
||||
'https://code.halkyon.app/project-halkyon/halkyon',
|
||||
|
|
@ -252,6 +257,14 @@ void main() {
|
|||
await tester.pumpAndSettle();
|
||||
}
|
||||
|
||||
/// Opens Profile's Progress, behind the person's own tab, every Halkyon
|
||||
/// app's first.
|
||||
Future<void> openProgress(WidgetTester tester) async {
|
||||
await goTab(tester, 'Profile');
|
||||
await tester.tap(find.widgetWithText(Tab, 'Progress'));
|
||||
await tester.pumpAndSettle();
|
||||
}
|
||||
|
||||
/// The Record tab's button, saying [label].
|
||||
Finder startFor([String activity = 'Running']) => find.descendant(
|
||||
of: find.ancestor(
|
||||
|
|
@ -356,9 +369,8 @@ void main() {
|
|||
expect(startFor(), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets("a phone's Profile has the tabs Progress and Days (D60)", (
|
||||
tester,
|
||||
) async {
|
||||
testWidgets("a phone's Profile has every Halkyon app's Profile tab "
|
||||
'first, then Progress and Days (D60)', (tester) async {
|
||||
await start(tester, usedBefore: true, recording: phone());
|
||||
|
||||
await goTab(tester, 'Profile');
|
||||
|
|
@ -369,8 +381,10 @@ void main() {
|
|||
);
|
||||
expect(
|
||||
[for (final tab in tester.widgetList<Tab>(profileTabs)) tab.text],
|
||||
['Progress', 'Days'],
|
||||
['Profile', 'Progress', 'Days'],
|
||||
);
|
||||
expect(find.byType(PublicProfileSection), findsOneWidget);
|
||||
await openProgress(tester);
|
||||
expect(find.byType(WeeksCard), findsOneWidget);
|
||||
});
|
||||
|
||||
|
|
@ -697,7 +711,7 @@ void main() {
|
|||
),
|
||||
);
|
||||
await start(tester, usedBefore: true, profile: profile);
|
||||
await goTab(tester, 'Profile');
|
||||
await openProgress(tester);
|
||||
await tester.runAsync(pumpEventQueue);
|
||||
await tester.pump();
|
||||
|
||||
|
|
@ -729,7 +743,7 @@ void main() {
|
|||
tester,
|
||||
) async {
|
||||
await start(tester, usedBefore: true, profile: profile);
|
||||
await goTab(tester, 'Profile');
|
||||
await openProgress(tester);
|
||||
await tester.runAsync(pumpEventQueue);
|
||||
await tester.pump();
|
||||
|
||||
|
|
@ -2442,7 +2456,9 @@ void main() {
|
|||
await start(tester, usedBefore: true, plans: plans);
|
||||
// Without a Record tab, the plans are beside the days in Profile.
|
||||
await goTab(tester, 'Profile');
|
||||
await tester.tap(find.text('Plans'));
|
||||
final tab = find.widgetWithText(Tab, 'Plans');
|
||||
await tester.ensureVisible(tab);
|
||||
await tester.tap(tab);
|
||||
await tester.pumpAndSettle();
|
||||
}
|
||||
|
||||
|
|
@ -3352,7 +3368,7 @@ void main() {
|
|||
await saveRow();
|
||||
await saveRun(DateTime(2026, 9, 3, 18));
|
||||
await startWith(tester);
|
||||
await goTab(tester, 'Profile');
|
||||
await openProgress(tester);
|
||||
|
||||
final weeks = find.byType(WeeksCard);
|
||||
Finder inWeeks(String text) =>
|
||||
|
|
|
|||
Loading…
Reference in a new issue