Add Progress over time and a targets and reminders setup

Progress gives a Day/Week/Month view of routines held against a weekly
target, compared with the same point of the previous period, with active
time and the daily streak. Targets & reminders sets routines and minutes
per week and schedules a heads-up before each routine. The runner's summary
now shows today's held count and streak. Finished runs are mirrored to a
device run log that feeds both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KhQh614DMeYoQEH9SoMRUw
This commit is contained in:
alvocool
2026-11-08 20:17:58 +03:00
parent 4b71257429
commit add94f621c
26 changed files with 1590 additions and 4 deletions

View File

@@ -17,6 +17,7 @@ import '../../utils/Colors.dart';
import '../../utils/Thresholds.dart';
import '../../utils/Validators.dart';
import '../login/Login.dart';
import '../progress/TargetSetup.dart';
import 'ConnectSettings.dart';
import 'Settings.dart';
import 'ViewSettings.dart';
@@ -58,6 +59,11 @@ class SettingsState extends State<Settings> implements ConnectSettings {
Navigator.pop(context);
}
void _onOpenTargets() {
GroundedNavigation()
.navigateToPageWithData(const TargetSetup(), context);
}
void _onToneSelected(ToneLevel tone) {
_model?.changeTone(tone);
}
@@ -242,6 +248,34 @@ class SettingsState extends State<Settings> implements ConnectSettings {
height: 1.5,
),
const SizedBox(height: 28),
sectionBreak("Targets", caption: "what a good week is"),
card(
onTap: _onOpenTargets,
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
text("Targets & reminders", 16, TextType.Medium,
color: colorPrimaryDark),
const SizedBox(height: 6),
text(
"Routines and active time per week, and a heads-up before each routine.",
12,
TextType.Regular,
color: colorGrey2,
),
],
),
),
Icon(CupertinoIcons.chevron_right,
size: 18, color: colorGrey2),
],
),
),
const SizedBox(height: 28),
sectionBreak("Pause", caption: "sick or travel"),
card(
background: _user.sickMode ? colorStandingGoodBg : colorCard,