Merge branch 'todo-fb' into integration

This commit is contained in:
Tizian 「ティツィアーン」 2026-11-03 23:13:33 +01:00
commit 82436ad030
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64
3 changed files with 1618 additions and 561 deletions

View file

@ -0,0 +1,19 @@
import 'package:halkyon_ui/halkyon_ui.dart';
import 'package:material_ui/material_ui.dart';
/// A setting's [title] with the question mark that explains it ([help],
/// halkyon_ui's [HelpButton]) beside it, rather than the explanation always
/// below (the developer's review, 3 Nov 2026).
class const TitleWithHelp(
final String title,
final String help, {
super.key,
}) extends StatelessWidget {
@override
Widget build(BuildContext context) => Row(
children: [
Flexible(child: Text(title)),
HelpButton(help, title: title),
],
);
}

View file

@ -1,6 +1,7 @@
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:halkyon_meditate_flutter/l10n/app_localizations.dart';
import 'package:halkyon_meditate_flutter/src/core/privacy/meditate_keys.dart';
import 'package:halkyon_meditate_flutter/src/core/widget/title_with_help.dart';
import 'package:halkyon_meditate_flutter/src/feature/practice/widget/practice_texts.dart';
import 'package:halkyon_meditate_flutter/src/feature/settings/model/meditate_settings.dart';
import 'package:halkyon_meditate_flutter/src/feature/sitting/bloc/practice_cubit.dart';
@ -67,8 +68,7 @@ class const SittingSettingsCard({super.key}) extends StatelessWidget {
),
SwitchListTile(
secondary: const Icon(LucideIcons.sunMedium),
title: Text(l10n.keepScreenOnTitle),
subtitle: Text(l10n.keepScreenOnHint),
title: TitleWithHelp(l10n.keepScreenOnTitle, l10n.keepScreenOnHint),
value: settings.keepScreenOn,
onChanged: (on) =>
_write(context, settings.copyWith(keepScreenOn: on)),
@ -125,8 +125,7 @@ class const PracticeSettingsCard({super.key}) extends StatelessWidget {
children: [
SwitchListTile(
secondary: const Icon(LucideIcons.flame),
title: Text(l10n.showStreakTitle),
subtitle: Text(l10n.showStreakHint),
title: TitleWithHelp(l10n.showStreakTitle, l10n.showStreakHint),
value: settings.showStreak,
onChanged: (on) => _write(context, settings.copyWith(showStreak: on)),
),
@ -149,8 +148,7 @@ class const JournalSettingsCard({super.key}) extends StatelessWidget {
children: [
SwitchListTile(
secondary: const Icon(LucideIcons.sunrise),
title: Text(l10n.dreamPromptTitle),
subtitle: Text(l10n.dreamPromptHint),
title: TitleWithHelp(l10n.dreamPromptTitle, l10n.dreamPromptHint),
value: settings.dreamPrompt,
onChanged: (on) =>
_write(context, settings.copyWith(dreamPrompt: on)),

View file

@ -660,6 +660,23 @@ void main() {
});
group('Settings of sitting (ADR 0038, D11)', () {
testWidgets('what a setting does stays behind its question mark until '
"asked (the developer's review, 3 Nov 2026)", (tester) async {
await start(tester, usedBefore: true);
await openSettings(tester);
expect(find.text('While a sitting runs'), findsNothing);
final help = find.descendant(
of: find.widgetWithText(SwitchListTile, 'Keep the screen on'),
matching: find.byType(HelpButton),
);
await tester.ensureVisible(help);
await tester.pumpAndSettle();
await tester.tap(help);
await tester.pumpAndSettle();
expect(find.text('While a sitting runs'), findsOneWidget);
});
testWidgets('the bell picked, the bells between and the screen are kept '
"in the person's sealed settings", (tester) async {
await start(tester, usedBefore: true);