Skip to content

Offline gym log for Android. No account, no ads, no internet.

Revise report export based on maintainer feedback

Alexander Petrov1a50b6793ff8
diff --cc lib/l10n/app_en.arb
index 30d9e55,69c0723..b276861
--- a/lib/l10n/app_en.arb
+++ b/lib/l10n/app_en.arb
@@@ -2195,13 -2198,6 +2198,9 @@@
"@reportFoodLine": {"placeholders": {"kcal": {"type": "String"}, "protein": {"type": "int"}, "days": {"type": "int"}}},
"reportSharePdf": "Share PDF",
"reportShareCsv": "Export CSV",
- "reportExportZip": "Export report ZIP",
- "reportSummaryEmpty": "No workouts, food, or weigh-ins to summarize for these dates.",
- "reportZipHint": "Choose what to include. Missing steps or synced sleep are left blank.",
++ "reportChooseCsv": "Choose which CSV files to share.",
+ "reportWeighIns": "Weigh-ins",
- "reportSyncedSleep": "Synced sleep",
+ "reportSessionDetails": "Workout session details",
- "reportZipFailed": "Could not export the report ZIP.",
"reportShareCsvBoth": "Export CSV (workouts and nutrition)",
"fastMinutes": "{n} min",
"@fastMinutes": {"placeholders": {"n": {"type": "int"}}},
diff --cc lib/l10n/app_es.arb
index 681aad7,b1133f9..f83bd06
--- a/lib/l10n/app_es.arb
+++ b/lib/l10n/app_es.arb
@@@ -1895,13 -1895,6 +1895,9 @@@
"reportFoodLine": "{kcal} y {protein} g de proteína al día · {days} días apuntados",
"reportSharePdf": "Compartir PDF",
"reportShareCsv": "Exportar CSV",
- "reportExportZip": "Exportar informe ZIP",
- "reportSummaryEmpty": "No hay entrenamientos, comidas ni pesajes que resumir en estas fechas.",
- "reportZipHint": "Elige qué incluir. Si faltan pasos o datos de sueño sincronizados, se dejan en blanco.",
++ "reportChooseCsv": "Elige qué archivos CSV compartir.",
+ "reportWeighIns": "Registros de peso",
- "reportSyncedSleep": "Sueño sincronizado",
+ "reportSessionDetails": "Detalles de las sesiones",
- "reportZipFailed": "No se pudo exportar el informe ZIP.",
"reportShareCsvBoth": "Exportar CSV (entrenos y nutrición)",
"fastMinutes": "{n} min",
"fastHours": "{n} h",
diff --cc lib/l10n/app_localizations.dart
index f115057,b4673af..b7c5c43
--- a/lib/l10n/app_localizations.dart
+++ b/lib/l10n/app_localizations.dart
@@@ -11360,48 -11378,6 +11378,24 @@@ abstract class AppLocalizations
/// **'Export CSV'**
String get reportShareCsv;
- /// No description provided for @reportExportZip.
++ /// No description provided for @reportChooseCsv.
+ ///
+ /// In en, this message translates to:
- /// **'Export report ZIP'**
- String get reportExportZip;
-
- /// No description provided for @reportSummaryEmpty.
- ///
- /// In en, this message translates to:
- /// **'No workouts, food, or weigh-ins to summarize for these dates.'**
- String get reportSummaryEmpty;
-
- /// No description provided for @reportZipHint.
- ///
- /// In en, this message translates to:
- /// **'Choose what to include. Missing steps or synced sleep are left blank.'**
- String get reportZipHint;
++ /// **'Choose which CSV files to share.'**
++ String get reportChooseCsv;
+
+ /// No description provided for @reportWeighIns.
+ ///
+ /// In en, this message translates to:
+ /// **'Weigh-ins'**
+ String get reportWeighIns;
+
- /// No description provided for @reportSyncedSleep.
- ///
- /// In en, this message translates to:
- /// **'Synced sleep'**
- String get reportSyncedSleep;
-
+ /// No description provided for @reportSessionDetails.
+ ///
+ /// In en, this message translates to:
+ /// **'Workout session details'**
+ String get reportSessionDetails;
+
- /// No description provided for @reportZipFailed.
- ///
- /// In en, this message translates to:
- /// **'Could not export the report ZIP.'**
- String get reportZipFailed;
-
/// No description provided for @reportShareCsvBoth.
///
/// In en, this message translates to:
diff --cc lib/l10n/app_localizations_ar.dart
index 523a59f,defcb5d..259ac9a
--- a/lib/l10n/app_localizations_ar.dart
+++ b/lib/l10n/app_localizations_ar.dart
@@@ -6450,27 -6459,6 +6459,15 @@@ class AppLocalizationsAr extends AppLoc
@override
String get reportShareCsv => 'تصدير CSV';
+ @override
- String get reportExportZip => 'Export report ZIP';
-
- @override
- String get reportSummaryEmpty => 'No workouts, food, or weigh-ins to summarize for these dates.';
-
- @override
- String get reportZipHint => 'Choose what to include. Missing steps or synced sleep are left blank.';
++ String get reportChooseCsv => 'Choose which CSV files to share.';
+
+ @override
+ String get reportWeighIns => 'Weigh-ins';
+
- @override
- String get reportSyncedSleep => 'Synced sleep';
-
+ @override
+ String get reportSessionDetails => 'Workout session details';
+
- @override
- String get reportZipFailed => 'Could not export the report ZIP.';
-
@override
String get reportShareCsvBoth => 'تصدير CSV (التمارين والتغذية)';
diff --cc lib/l10n/app_localizations_bn.dart
index 7b5133a,7deaa17..587a17b
--- a/lib/l10n/app_localizations_bn.dart
+++ b/lib/l10n/app_localizations_bn.dart
@@@ -6412,27 -6421,6 +6421,15 @@@ class AppLocalizationsBn extends AppLoc
@override
String get reportShareCsv => 'CSV এক্সপোর্ট করো';
+ @override
- String get reportExportZip => 'Export report ZIP';
-
- @override
- String get reportSummaryEmpty => 'No workouts, food, or weigh-ins to summarize for these dates.';
-
- @override
- String get reportZipHint => 'Choose what to include. Missing steps or synced sleep are left blank.';
++ String get reportChooseCsv => 'Choose which CSV files to share.';
+
+ @override
+ String get reportWeighIns => 'Weigh-ins';
+
- @override
- String get reportSyncedSleep => 'Synced sleep';
-
+ @override
+ String get reportSessionDetails => 'Workout session details';
+
- @override
- String get reportZipFailed => 'Could not export the report ZIP.';
-
@override
String get reportShareCsvBoth => 'CSV এক্সপোর্ট করো (ওয়ার্কআউট আর পুষ্টি)';
diff --cc lib/l10n/app_localizations_de.dart
index d1d4fcc,06c8add..405d181
--- a/lib/l10n/app_localizations_de.dart
+++ b/lib/l10n/app_localizations_de.dart
@@@ -6443,27 -6452,6 +6452,15 @@@ class AppLocalizationsDe extends AppLoc
@override
String get reportShareCsv => 'CSV exportieren';
+ @override
- String get reportExportZip => 'Export report ZIP';
-
- @override
- String get reportSummaryEmpty => 'No workouts, food, or weigh-ins to summarize for these dates.';
-
- @override
- String get reportZipHint => 'Choose what to include. Missing steps or synced sleep are left blank.';
++ String get reportChooseCsv => 'Choose which CSV files to share.';
+
+ @override
+ String get reportWeighIns => 'Weigh-ins';
+
- @override
- String get reportSyncedSleep => 'Synced sleep';
-
+ @override
+ String get reportSessionDetails => 'Workout session details';
+
- @override
- String get reportZipFailed => 'Could not export the report ZIP.';
-
@override
String get reportShareCsvBoth => 'CSV exportieren (Trainings und Ernährung)';
diff --cc lib/l10n/app_localizations_en.dart
index 4233119,8bcf143..4fd0776
--- a/lib/l10n/app_localizations_en.dart
+++ b/lib/l10n/app_localizations_en.dart
@@@ -6391,27 -6400,6 +6400,15 @@@ class AppLocalizationsEn extends AppLoc
@override
String get reportShareCsv => 'Export CSV';
+ @override
- String get reportExportZip => 'Export report ZIP';
-
- @override
- String get reportSummaryEmpty => 'No workouts, food, or weigh-ins to summarize for these dates.';
-
- @override
- String get reportZipHint => 'Choose what to include. Missing steps or synced sleep are left blank.';
++ String get reportChooseCsv => 'Choose which CSV files to share.';
+
+ @override
+ String get reportWeighIns => 'Weigh-ins';
+
- @override
- String get reportSyncedSleep => 'Synced sleep';
-
+ @override
+ String get reportSessionDetails => 'Workout session details';
+
- @override
- String get reportZipFailed => 'Could not export the report ZIP.';
-
@override
String get reportShareCsvBoth => 'Export CSV (workouts and nutrition)';
diff --cc lib/l10n/app_localizations_es.dart
index 3a9fc07,11d199d..9f5475e
--- a/lib/l10n/app_localizations_es.dart
+++ b/lib/l10n/app_localizations_es.dart
@@@ -6432,28 -6441,6 +6441,15 @@@ class AppLocalizationsEs extends AppLoc
@override
String get reportShareCsv => 'Exportar CSV';
+ @override
- String get reportExportZip => 'Exportar informe ZIP';
-
- @override
- String get reportSummaryEmpty => 'No hay entrenamientos, comidas ni pesajes que resumir en estas fechas.';
-
- @override
- String get reportZipHint =>
- 'Elige qué incluir. Si faltan pasos o datos de sueño sincronizados, se dejan en blanco.';
++ String get reportChooseCsv => 'Elige qué archivos CSV compartir.';
+
+ @override
+ String get reportWeighIns => 'Registros de peso';
+
- @override
- String get reportSyncedSleep => 'Sueño sincronizado';
-
+ @override
+ String get reportSessionDetails => 'Detalles de las sesiones';
+
- @override
- String get reportZipFailed => 'No se pudo exportar el informe ZIP.';
-
@override
String get reportShareCsvBoth => 'Exportar CSV (entrenos y nutrición)';
diff --cc lib/l10n/app_localizations_fa.dart
index 7b1c778,2d2e062..70be6da
--- a/lib/l10n/app_localizations_fa.dart
+++ b/lib/l10n/app_localizations_fa.dart
@@@ -6351,27 -6360,6 +6360,15 @@@ class AppLocalizationsFa extends AppLoc
@override
String get reportShareCsv => 'خروجی CSV';
+ @override
- String get reportExportZip => 'Export report ZIP';
-
- @override
- String get reportSummaryEmpty => 'No workouts, food, or weigh-ins to summarize for these dates.';
-
- @override
- String get reportZipHint => 'Choose what to include. Missing steps or synced sleep are left blank.';
++ String get reportChooseCsv => 'Choose which CSV files to share.';
+
+ @override
+ String get reportWeighIns => 'Weigh-ins';
+
- @override
- String get reportSyncedSleep => 'Synced sleep';
-
+ @override
+ String get reportSessionDetails => 'Workout session details';
+
- @override
- String get reportZipFailed => 'Could not export the report ZIP.';
-
@override
String get reportShareCsvBoth => 'خروجی CSV (تمرین‌ها و تغذیه)';
diff --cc lib/l10n/app_localizations_fr.dart
index 64c09a1,aff4cf2..a13819f
--- a/lib/l10n/app_localizations_fr.dart
+++ b/lib/l10n/app_localizations_fr.dart
@@@ -6446,27 -6455,6 +6455,15 @@@ class AppLocalizationsFr extends AppLoc
@override
String get reportShareCsv => 'Exporter le CSV';
+ @override
- String get reportExportZip => 'Export report ZIP';
-
- @override
- String get reportSummaryEmpty => 'No workouts, food, or weigh-ins to summarize for these dates.';
-
- @override
- String get reportZipHint => 'Choose what to include. Missing steps or synced sleep are left blank.';
++ String get reportChooseCsv => 'Choose which CSV files to share.';
+
+ @override
+ String get reportWeighIns => 'Weigh-ins';
+
- @override
- String get reportSyncedSleep => 'Synced sleep';
-
+ @override
+ String get reportSessionDetails => 'Workout session details';
+
- @override
- String get reportZipFailed => 'Could not export the report ZIP.';
-
@override
String get reportShareCsvBoth => 'Exporter le CSV (séances et nutrition)';
diff --cc lib/l10n/app_localizations_hi.dart
index d0c604a,0ca4a16..6087b49
--- a/lib/l10n/app_localizations_hi.dart
+++ b/lib/l10n/app_localizations_hi.dart
@@@ -6391,27 -6400,6 +6400,15 @@@ class AppLocalizationsHi extends AppLoc
@override
String get reportShareCsv => 'CSV एक्सपोर्ट करें';
+ @override
- String get reportExportZip => 'Export report ZIP';
-
- @override
- String get reportSummaryEmpty => 'No workouts, food, or weigh-ins to summarize for these dates.';
-
- @override
- String get reportZipHint => 'Choose what to include. Missing steps or synced sleep are left blank.';
++ String get reportChooseCsv => 'Choose which CSV files to share.';
+
+ @override
+ String get reportWeighIns => 'Weigh-ins';
+
- @override
- String get reportSyncedSleep => 'Synced sleep';
-
+ @override
+ String get reportSessionDetails => 'Workout session details';
+
- @override
- String get reportZipFailed => 'Could not export the report ZIP.';
-
@override
String get reportShareCsvBoth => 'CSV एक्सपोर्ट करें (वर्कआउट और न्यूट्रिशन)';
diff --cc lib/l10n/app_localizations_id.dart
index f34ee37,44a24d1..6638e44
--- a/lib/l10n/app_localizations_id.dart
+++ b/lib/l10n/app_localizations_id.dart
@@@ -6282,27 -6291,6 +6291,15 @@@ class AppLocalizationsId extends AppLoc
@override
String get reportShareCsv => 'Ekspor CSV';
+ @override
- String get reportExportZip => 'Export report ZIP';
-
- @override
- String get reportSummaryEmpty => 'No workouts, food, or weigh-ins to summarize for these dates.';
-
- @override
- String get reportZipHint => 'Choose what to include. Missing steps or synced sleep are left blank.';
++ String get reportChooseCsv => 'Choose which CSV files to share.';
+
+ @override
+ String get reportWeighIns => 'Weigh-ins';
+
- @override
- String get reportSyncedSleep => 'Synced sleep';
-
+ @override
+ String get reportSessionDetails => 'Workout session details';
+
- @override
- String get reportZipFailed => 'Could not export the report ZIP.';
-
@override
String get reportShareCsvBoth => 'Ekspor CSV (latihan dan nutrisi)';
diff --cc lib/l10n/app_localizations_it.dart
index afb07a7,6507a6b..ef8c5b2
--- a/lib/l10n/app_localizations_it.dart
+++ b/lib/l10n/app_localizations_it.dart
@@@ -6428,27 -6437,6 +6437,15 @@@ class AppLocalizationsIt extends AppLoc
@override
String get reportShareCsv => 'Esporta CSV';
+ @override
- String get reportExportZip => 'Export report ZIP';
-
- @override
- String get reportSummaryEmpty => 'No workouts, food, or weigh-ins to summarize for these dates.';
-
- @override
- String get reportZipHint => 'Choose what to include. Missing steps or synced sleep are left blank.';
++ String get reportChooseCsv => 'Choose which CSV files to share.';
+
+ @override
+ String get reportWeighIns => 'Weigh-ins';
+
- @override
- String get reportSyncedSleep => 'Synced sleep';
-
+ @override
+ String get reportSessionDetails => 'Workout session details';
+
- @override
- String get reportZipFailed => 'Could not export the report ZIP.';
-
@override
String get reportShareCsvBoth => 'Esporta CSV (allenamenti e nutrizione)';
diff --cc lib/l10n/app_localizations_ja.dart
index 92a8cdd,35b6487..709aeca
--- a/lib/l10n/app_localizations_ja.dart
+++ b/lib/l10n/app_localizations_ja.dart
@@@ -6208,27 -6217,6 +6217,15 @@@ class AppLocalizationsJa extends AppLoc
@override
String get reportShareCsv => 'CSVを書き出す';
+ @override
- String get reportExportZip => 'Export report ZIP';
-
- @override
- String get reportSummaryEmpty => 'No workouts, food, or weigh-ins to summarize for these dates.';
-
- @override
- String get reportZipHint => 'Choose what to include. Missing steps or synced sleep are left blank.';
++ String get reportChooseCsv => 'Choose which CSV files to share.';
+
+ @override
+ String get reportWeighIns => 'Weigh-ins';
+
- @override
- String get reportSyncedSleep => 'Synced sleep';
-
+ @override
+ String get reportSessionDetails => 'Workout session details';
+
- @override
- String get reportZipFailed => 'Could not export the report ZIP.';
-
@override
String get reportShareCsvBoth => 'CSVを書き出す(トレーニングと栄養)';
diff --cc lib/l10n/app_localizations_ko.dart
index 675accf,3553ca4..b1949de
--- a/lib/l10n/app_localizations_ko.dart
+++ b/lib/l10n/app_localizations_ko.dart
@@@ -6219,27 -6228,6 +6228,15 @@@ class AppLocalizationsKo extends AppLoc
@override
String get reportShareCsv => 'CSV 내보내기';
+ @override
- String get reportExportZip => 'Export report ZIP';
-
- @override
- String get reportSummaryEmpty => 'No workouts, food, or weigh-ins to summarize for these dates.';
-
- @override
- String get reportZipHint => 'Choose what to include. Missing steps or synced sleep are left blank.';
++ String get reportChooseCsv => 'Choose which CSV files to share.';
+
+ @override
+ String get reportWeighIns => 'Weigh-ins';
+
- @override
- String get reportSyncedSleep => 'Synced sleep';
-
+ @override
+ String get reportSessionDetails => 'Workout session details';
+
- @override
- String get reportZipFailed => 'Could not export the report ZIP.';
-
@override
String get reportShareCsvBoth => 'CSV 내보내기 (운동과 영양)';
diff --cc lib/l10n/app_localizations_nl.dart
index a67fc6a,41cf983..4f32d9c
--- a/lib/l10n/app_localizations_nl.dart
+++ b/lib/l10n/app_localizations_nl.dart
@@@ -6433,27 -6442,6 +6442,15 @@@ class AppLocalizationsNl extends AppLoc
@override
String get reportShareCsv => 'CSV exporteren';
+ @override
- String get reportExportZip => 'Export report ZIP';
-
- @override
- String get reportSummaryEmpty => 'No workouts, food, or weigh-ins to summarize for these dates.';
-
- @override
- String get reportZipHint => 'Choose what to include. Missing steps or synced sleep are left blank.';
++ String get reportChooseCsv => 'Choose which CSV files to share.';
+
+ @override
+ String get reportWeighIns => 'Weigh-ins';
+
- @override
- String get reportSyncedSleep => 'Synced sleep';
-
+ @override
+ String get reportSessionDetails => 'Workout session details';
+
- @override
- String get reportZipFailed => 'Could not export the report ZIP.';
-
@override
String get reportShareCsvBoth => 'CSV exporteren (trainingen en voeding)';
diff --cc lib/l10n/app_localizations_pl.dart
index dfeec00,e3baaac..bd710f7
--- a/lib/l10n/app_localizations_pl.dart
+++ b/lib/l10n/app_localizations_pl.dart
@@@ -6521,27 -6530,6 +6530,15 @@@ class AppLocalizationsPl extends AppLoc
@override
String get reportShareCsv => 'Eksportuj CSV';
+ @override
- String get reportExportZip => 'Export report ZIP';
-
- @override
- String get reportSummaryEmpty => 'No workouts, food, or weigh-ins to summarize for these dates.';
-
- @override
- String get reportZipHint => 'Choose what to include. Missing steps or synced sleep are left blank.';
++ String get reportChooseCsv => 'Choose which CSV files to share.';
+
+ @override
+ String get reportWeighIns => 'Weigh-ins';
+
- @override
- String get reportSyncedSleep => 'Synced sleep';
-
+ @override
+ String get reportSessionDetails => 'Workout session details';
+
- @override
- String get reportZipFailed => 'Could not export the report ZIP.';
-
@override
String get reportShareCsvBoth => 'Eksportuj CSV (treningi i odżywianie)';
diff --cc lib/l10n/app_localizations_pt.dart
index 2a13533,179e133..74f340f
--- a/lib/l10n/app_localizations_pt.dart
+++ b/lib/l10n/app_localizations_pt.dart
@@@ -6425,27 -6434,6 +6434,15 @@@ class AppLocalizationsPt extends AppLoc
@override
String get reportShareCsv => 'Exportar CSV';
+ @override
- String get reportExportZip => 'Export report ZIP';
-
- @override
- String get reportSummaryEmpty => 'No workouts, food, or weigh-ins to summarize for these dates.';
-
- @override
- String get reportZipHint => 'Choose what to include. Missing steps or synced sleep are left blank.';
++ String get reportChooseCsv => 'Choose which CSV files to share.';
+
+ @override
+ String get reportWeighIns => 'Weigh-ins';
+
- @override
- String get reportSyncedSleep => 'Synced sleep';
-
+ @override
+ String get reportSessionDetails => 'Workout session details';
+
- @override
- String get reportZipFailed => 'Could not export the report ZIP.';
-
@override
String get reportShareCsvBoth => 'Exportar CSV (treinos e nutrição)';
diff --cc lib/l10n/app_localizations_ru.dart
index f6dcc6e,5e5aaf8..cf7d146
--- a/lib/l10n/app_localizations_ru.dart
+++ b/lib/l10n/app_localizations_ru.dart
@@@ -6622,27 -6631,6 +6631,15 @@@ class AppLocalizationsRu extends AppLoc
@override
String get reportShareCsv => 'Экспорт CSV';
+ @override
- String get reportExportZip => 'Export report ZIP';
-
- @override
- String get reportSummaryEmpty => 'No workouts, food, or weigh-ins to summarize for these dates.';
-
- @override
- String get reportZipHint => 'Choose what to include. Missing steps or synced sleep are left blank.';
++ String get reportChooseCsv => 'Choose which CSV files to share.';
+
+ @override
+ String get reportWeighIns => 'Weigh-ins';
+
- @override
- String get reportSyncedSleep => 'Synced sleep';
-
+ @override
+ String get reportSessionDetails => 'Workout session details';
+
- @override
- String get reportZipFailed => 'Could not export the report ZIP.';
-
@override
String get reportShareCsvBoth => 'Экспорт CSV (тренировки и питание)';
diff --cc lib/l10n/app_localizations_tr.dart
index b738995,565f221..6390805
--- a/lib/l10n/app_localizations_tr.dart
+++ b/lib/l10n/app_localizations_tr.dart
@@@ -6412,27 -6421,6 +6421,15 @@@ class AppLocalizationsTr extends AppLoc
@override
String get reportShareCsv => 'CSV dışa aktar';
+ @override
- String get reportExportZip => 'Export report ZIP';
-
- @override
- String get reportSummaryEmpty => 'No workouts, food, or weigh-ins to summarize for these dates.';
-
- @override
- String get reportZipHint => 'Choose what to include. Missing steps or synced sleep are left blank.';
++ String get reportChooseCsv => 'Choose which CSV files to share.';
+
+ @override
+ String get reportWeighIns => 'Weigh-ins';
+
- @override
- String get reportSyncedSleep => 'Synced sleep';
-
+ @override
+ String get reportSessionDetails => 'Workout session details';
+
- @override
- String get reportZipFailed => 'Could not export the report ZIP.';
-
@override
String get reportShareCsvBoth => 'CSV dışa aktar (antrenmanlar ve beslenme)';
diff --cc lib/l10n/app_localizations_uk.dart
index 6d0d920,7a9db11..2a502b5
--- a/lib/l10n/app_localizations_uk.dart
+++ b/lib/l10n/app_localizations_uk.dart
@@@ -6514,27 -6523,6 +6523,15 @@@ class AppLocalizationsUk extends AppLoc
@override
String get reportShareCsv => 'Експорт CSV';
+ @override
- String get reportExportZip => 'Export report ZIP';
-
- @override
- String get reportSummaryEmpty => 'No workouts, food, or weigh-ins to summarize for these dates.';
-
- @override
- String get reportZipHint => 'Choose what to include. Missing steps or synced sleep are left blank.';
++ String get reportChooseCsv => 'Choose which CSV files to share.';
+
+ @override
+ String get reportWeighIns => 'Weigh-ins';
+
- @override
- String get reportSyncedSleep => 'Synced sleep';
-
+ @override
+ String get reportSessionDetails => 'Workout session details';
+
- @override
- String get reportZipFailed => 'Could not export the report ZIP.';
-
@override
String get reportShareCsvBoth => 'Експорт CSV (тренування й харчування)';
diff --cc lib/l10n/app_localizations_ur.dart
index 5a56284,903a3f0..d14415e
--- a/lib/l10n/app_localizations_ur.dart
+++ b/lib/l10n/app_localizations_ur.dart
@@@ -6356,27 -6365,6 +6365,15 @@@ class AppLocalizationsUr extends AppLoc
@override
String get reportShareCsv => 'CSV ایکسپورٹ کرو';
+ @override
- String get reportExportZip => 'Export report ZIP';
-
- @override
- String get reportSummaryEmpty => 'No workouts, food, or weigh-ins to summarize for these dates.';
-
- @override
- String get reportZipHint => 'Choose what to include. Missing steps or synced sleep are left blank.';
++ String get reportChooseCsv => 'Choose which CSV files to share.';
+
+ @override
+ String get reportWeighIns => 'Weigh-ins';
+
- @override
- String get reportSyncedSleep => 'Synced sleep';
-
+ @override
+ String get reportSessionDetails => 'Workout session details';
+
- @override
- String get reportZipFailed => 'Could not export the report ZIP.';
-
@override
String get reportShareCsvBoth => 'CSV ایکسپورٹ کرو (ورزشیں اور غذائیت)';
diff --cc lib/l10n/app_localizations_vi.dart
index acbd2c5,be4d4bf..4fb5f38
--- a/lib/l10n/app_localizations_vi.dart
+++ b/lib/l10n/app_localizations_vi.dart
@@@ -6287,27 -6296,6 +6296,15 @@@ class AppLocalizationsVi extends AppLoc
@override
String get reportShareCsv => 'Xuất CSV';
+ @override
- String get reportExportZip => 'Export report ZIP';
-
- @override
- String get reportSummaryEmpty => 'No workouts, food, or weigh-ins to summarize for these dates.';
-
- @override
- String get reportZipHint => 'Choose what to include. Missing steps or synced sleep are left blank.';
++ String get reportChooseCsv => 'Choose which CSV files to share.';
+
+ @override
+ String get reportWeighIns => 'Weigh-ins';
+
- @override
- String get reportSyncedSleep => 'Synced sleep';
-
+ @override
+ String get reportSessionDetails => 'Workout session details';
+
- @override
- String get reportZipFailed => 'Could not export the report ZIP.';
-
@override
String get reportShareCsvBoth => 'Xuất CSV (buổi tập và dinh dưỡng)';
diff --cc lib/l10n/app_localizations_zh.dart
index ba44ccd,5f0ed15..c568aa2
--- a/lib/l10n/app_localizations_zh.dart
+++ b/lib/l10n/app_localizations_zh.dart
@@@ -6152,27 -6161,6 +6161,15 @@@ class AppLocalizationsZh extends AppLoc
@override
String get reportShareCsv => '导出 CSV';
+ @override
- String get reportExportZip => 'Export report ZIP';
-
- @override
- String get reportSummaryEmpty => 'No workouts, food, or weigh-ins to summarize for these dates.';
-
- @override
- String get reportZipHint => 'Choose what to include. Missing steps or synced sleep are left blank.';
++ String get reportChooseCsv => 'Choose which CSV files to share.';
+
+ @override
+ String get reportWeighIns => 'Weigh-ins';
+
- @override
- String get reportSyncedSleep => 'Synced sleep';
-
+ @override
+ String get reportSessionDetails => 'Workout session details';
+
- @override
- String get reportZipFailed => 'Could not export the report ZIP.';
-
@override
String get reportShareCsvBoth => '导出 CSV(训练与营养)';
diff --cc lib/services/report_pdf.dart
index ec850a7,ec850a7..684698b
--- a/lib/services/report_pdf.dart
+++ b/lib/services/report_pdf.dart
@@@ -14,15 -14,15 +14,17 @@@ Future<Uint8List> buildReportPdf(RangeR
kicker: t.reportKicker);
}
--Future<void> shareReport(RangeReport r, {required bool pdf, required bool csv}) async {
++Future<void> shareReport(RangeReport r, {bool pdf = false, Set<ReportSection> csv = const {}}) async {
try {
final stamp = '${_isoDay(r.from)}_${_isoDay(r.to)}';
final files = <ShareItem>[
if (pdf) ShareItem('gymmane-report-$stamp.pdf', await buildReportPdf(r), mime: 'application/pdf'),
-- if (csv && r.sessions > 0)
-- ShareItem('gymmane-workouts-$stamp.csv', utf8Bytes(fit.reportWorkoutsCsv(r)), mime: 'text/csv'),
-- if (csv && r.food != null)
-- ShareItem('gymmane-nutrition-$stamp.csv', utf8Bytes(fit.reportNutritionCsv(r)), mime: 'text/csv'),
++ for (final section in csv)
++ ShareItem(
++ 'gymmane-${section == ReportSection.weighIns ? 'weigh-ins' : section.name}-$stamp.csv',
++ utf8Bytes(fit.reportSectionCsv(r, section)),
++ mime: 'text/csv',
++ ),
];
await shareFiles(files, subject: '${sentenceCase(t.reportKicker)} · ${reportRangeLabel(r)}');
} catch (_) {}
diff --cc lib/state/report_state.dart
index 92bd6aa,694e08f..68c2663
--- a/lib/state/report_state.dart
+++ b/lib/state/report_state.dart
@@@ -4,8 -4,6 +4,8 @@@ typedef ReportLift = ({String id, Strin
typedef ReportRecord = ({String id, String name, double kg, DateTime date});
typedef ReportFood = ({int days, double kcal, double protein, double carbs, double fat, int waterMl});
- enum ReportSection { workouts, nutrition, steps, supplements, weighIns, sleep, sessions }
++enum ReportSection { workouts, nutrition, supplements, weighIns, sessions }
+
class RangeReport {
RangeReport({
required this.from,
@@@ -184,98 -172,9 +174,105 @@@ mixin ReportState on FitCore, ToolsStat
}
String reportWorkoutsCsv(RangeReport r) {
+ return Store.instance.exportCsv(_reportSessions(r).toList());
+ }
+
+ bool _inReport(RangeReport r, DateTime date) {
+ final day = _dayKey(date);
+ return !day.isBefore(r.from) && !day.isAfter(r.to);
+ }
+
+ Iterable<LoggedSession> _reportSessions(RangeReport r) {
final end = shiftDays(r.to, 1);
- return Store.instance
- .exportCsv([for (final s in sessions) if (!s.day.isBefore(r.from) && s.day.isBefore(end)) s]);
+ return sessions.where((s) => !s.day.isBefore(r.from) && s.day.isBefore(end));
+ }
+
+ Iterable<DateTime> _reportDates(RangeReport r) sync* {
+ for (var d = r.from; !d.isAfter(r.to); d = shiftDays(d, 1)) {
+ yield d;
+ }
+ }
+
++ Set<ReportSection> reportCsvSections(RangeReport r) {
++ final names = _supplementNames;
++ return {
++ if (_reportSessions(r).any((s) => s.exercises.any((e) => e.sets.isNotEmpty))) ReportSection.workouts,
++ if (nutritionBeta && (r.food != null || _reportDates(r).any((d) => waterOn(d) != 0)))
++ ReportSection.nutrition,
++ if (_reportDates(r).any((d) => takenOn(d).any(names.containsKey))) ReportSection.supplements,
++ if (r.weightFrom != null) ReportSection.weighIns,
++ if (r.sessions > 0) ReportSection.sessions,
++ };
++ }
++
+ String reportSectionCsv(RangeReport r, ReportSection section) => switch (section) {
+ ReportSection.workouts => reportWorkoutsCsv(r),
+ ReportSection.nutrition => reportNutritionCsv(r),
- ReportSection.steps => _reportCsv('date,steps', [
- for (final day in _reportDates(r)) [HealthMetrics.dayKey(day), stepsByDay[HealthMetrics.dayKey(day)]],
- ]),
+ ReportSection.supplements => _reportSupplementsCsv(r),
+ ReportSection.weighIns => _reportWeighInsCsv(r),
- ReportSection.sleep => _reportCsv('date,sleep_minutes', [
- for (final day in _reportDates(r))
- [HealthMetrics.dayKey(day), healthOnDay(HealthMetric.sleep, day)?.firstOrNull],
- ]),
+ ReportSection.sessions => _reportSessionsCsv(r),
+ };
+
++ Map<String, String> get _supplementNames => {for (final s in supplements) s.id: s.name};
++
+ String _reportSupplementsCsv(RangeReport r) {
- final names = {for (final s in supplements) s.id: s.name};
++ final names = _supplementNames;
+ return _reportCsv('date,supplement', [
+ for (final day in _reportDates(r))
+ for (final id in takenOn(day))
- if (names[id] case final name?) [HealthMetrics.dayKey(day), name],
++ if (names[id] case final name?) [NutritionState._dk(day), name],
+ ]);
+ }
+
+ String _reportWeighInsCsv(RangeReport r) {
+ final weights = bodyweight.where((w) => _inReport(r, w.date)).toList()
+ ..sort((a, b) => a.date.compareTo(b.date));
+ return _reportCsv('date,recorded_at,weight_kg', [
- for (final w in weights) [HealthMetrics.dayKey(w.date), w.date.toIso8601String(), w.kg],
++ for (final w in weights) [NutritionState._dk(w.date), w.date.toIso8601String(), w.kg],
+ ]);
+ }
+
+ String _reportSessionsCsv(RangeReport r) {
+ final picked = _reportSessions(r).toList()..sort((a, b) => a.date.compareTo(b.date));
+ return _reportCsv(
+ 'date,started_at,ended_at,name,duration_s,exercises,working_sets,volume_kg,'
+ 'hr_avg_bpm,hr_max_bpm,sleep_rating_1_5,energy_rating_1_5,deload',
+ [
+ for (final s in picked)
+ [
- HealthMetrics.dayKey(s.day),
++ NutritionState._dk(s.day),
+ s.day.toIso8601String(),
+ s.date.toIso8601String(),
+ sessionTitle(s),
+ s.durationSec,
+ s.exercises.length,
+ s.setCount,
+ s.volume,
+ s.hrAvg,
+ s.hrMax,
+ s.sleep,
+ s.energy,
+ s.deload,
+ ],
+ ],
+ );
+ }
+
+ static final _csvFormula = RegExp(r'^\s*[=+@-]|^[\t\r\n]');
+ static final _csvQuoted = RegExp(r'[",\r\n]');
+
+ static String _reportCsv(String header, Iterable<List<Object?>> rows) {
+ String cell(Object? value) {
+ var text = value?.toString() ?? '';
+ if (value is String && _csvFormula.hasMatch(text)) text = "'$text";
+ return _csvQuoted.hasMatch(text) ? '"${text.replaceAll('"', '""')}"' : text;
+ }
+
+ final csv = StringBuffer()..writeln(header);
+ for (final row in rows) {
+ csv.writeln(row.map(cell).join(','));
+ }
+ return csv.toString();
}
String reportNutritionCsv(RangeReport r) {
diff --cc lib/widgets/report_sheet.dart
index 76b4d21,0d94adb..a738975
--- a/lib/widgets/report_sheet.dart
+++ b/lib/widgets/report_sheet.dart
@@@ -63,31 -61,12 +61,24 @@@ class _ReportSheetState extends State<R
});
}
-- Future<void> _share({required bool pdf}) async {
- if (_busy) return;
- setState(() => _busy = true);
- HapticFeedback.mediumImpact();
- await shareReport(fit.rangeReport(_range.start, _range.end), pdf: pdf, csv: !pdf);
- if (mounted) setState(() => _busy = false);
- }
-
- Future<void> _shareZip(RangeReport report) async {
++ Future<void> _share(RangeReport report, {bool pdf = false, Set<ReportSection> csv = const {}}) async {
if (_busy) return;
setState(() => _busy = true);
- HapticFeedback.mediumImpact();
- await shareReport(fit.rangeReport(_range.start, _range.end), pdf: pdf, csv: !pdf);
- if (mounted) setState(() => _busy = false);
+ try {
- final sections = await showAppSheet<Set<ReportSection>>(
- context: context,
- isScrollControlled: true,
- backgroundColor: Colors.transparent,
- builder: (_) => _ReportZipSheet(report: report),
- );
- if (!mounted || sections == null) return;
- await shareReportZip(report, sections);
- } catch (_) {
- if (mounted) showNotchToast(context, t.reportZipFailed);
++ HapticFeedback.mediumImpact();
++ final selected = !pdf && csv.length > 1
++ ? await showAppSheet<Set<ReportSection>>(
++ context: context,
++ isScrollControlled: true,
++ backgroundColor: Colors.transparent,
++ builder: (_) => _ReportCsvSheet(report: report, sections: csv),
++ )
++ : csv;
++ if (!mounted || selected == null) return;
++ await shareReport(report, pdf: pdf, csv: selected);
+ } finally {
+ if (mounted) setState(() => _busy = false);
+ }
}
@override
@@@ -119,6 -98,6 +110,7 @@@
]),
);
final food = r.food;
++ final sections = fit.reportCsvSections(r);
return Container(
padding: sheetPad(context),
constraints: BoxConstraints(maxHeight: MediaQuery.sizeOf(context).height * 0.88),
@@@ -165,13 -144,13 +157,13 @@@
),
),
const SizedBox(height: 12),
-- if (r.empty)
++ if (r.empty && sections.isEmpty)
Padding(
padding: const EdgeInsets.symmetric(vertical: 18),
- child: Text(t.reportSummaryEmpty,
+ child: Text(t.reportEmpty,
textAlign: TextAlign.center, style: AppTheme.s(13, color: gc.textSecondary, height: 1.4)),
)
-- else ...[
++ else if (!r.empty) ...[
Row(children: [
stat(t.reportWorkouts, '${r.sessions}'),
const SizedBox(width: 8),
@@@ -195,101 -174,18 +187,78 @@@
AnimatedOpacity(
duration: const Duration(milliseconds: 160),
opacity: _busy ? 0.5 : 1,
-- child: PrimaryButton(label: t.reportSharePdf, height: 52, onTap: () => _share(pdf: true)),
++ child: PrimaryButton(label: t.reportSharePdf, height: 52, onTap: () => _share(r, pdf: true)),
),
++ ],
++ if (sections.isNotEmpty) ...[
const SizedBox(height: 10),
GhostButton(
-- label: food != null && r.sessions > 0 ? t.reportShareCsvBoth : t.reportShareCsv,
++ label: t.reportShareCsv,
icon: PhosphorIconsRegular.fileCsv,
-- onTap: () => _share(pdf: false),
++ onTap: () => _share(r, csv: sections),
),
],
- const SizedBox(height: 10),
- GhostButton(
- label: t.reportExportZip,
- icon: PhosphorIconsRegular.fileZip,
- onTap: () => _shareZip(r),
- ),
const SizedBox(height: 4),
]),
),
);
}
}
+
- class _ReportZipSheet extends StatefulWidget {
- const _ReportZipSheet({required this.report});
++class _ReportCsvSheet extends StatefulWidget {
++ const _ReportCsvSheet({required this.report, required this.sections});
+
+ final RangeReport report;
++ final Set<ReportSection> sections;
+
+ @override
- State<_ReportZipSheet> createState() => _ReportZipSheetState();
++ State<_ReportCsvSheet> createState() => _ReportCsvSheetState();
+}
+
- class _ReportZipSheetState extends State<_ReportZipSheet> {
- final _sections = {ReportSection.workouts, ReportSection.nutrition};
++class _ReportCsvSheetState extends State<_ReportCsvSheet> {
++ late final _selected = widget.sections.intersection({ReportSection.workouts, ReportSection.nutrition});
+
+ String _label(ReportSection section) => switch (section) {
+ ReportSection.workouts => titleCase(t.reportWorkouts),
+ ReportSection.nutrition => t.nutrition,
- ReportSection.steps => t.homeCardSteps,
+ ReportSection.supplements => titleCase(t.supplementsLabel),
+ ReportSection.weighIns => t.reportWeighIns,
- ReportSection.sleep => t.reportSyncedSleep,
+ ReportSection.sessions => t.reportSessionDetails,
+ };
+
+ @override
+ Widget build(BuildContext context) {
+ final gc = context.gc;
- return Container(
- padding: sheetPad(context),
- constraints: BoxConstraints(maxHeight: MediaQuery.sizeOf(context).height * 0.88),
- decoration: sheetDecoration(gc),
- child: Column(
- mainAxisSize: MainAxisSize.min,
- crossAxisAlignment: CrossAxisAlignment.stretch,
- children: [
- Flexible(
- child: SingleChildScrollView(
- child: Material(
- type: MaterialType.transparency,
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.stretch,
- children: [
- const SheetHandle(),
- const SizedBox(height: 16),
- SheetTitle(t.reportExportZip, subtitle: reportRangeLabel(widget.report)),
- const SizedBox(height: 8),
- Text(t.reportZipHint, style: AppTheme.f(13, color: gc.textSecondary, height: 1.4)),
- const SizedBox(height: 8),
- for (final section in ReportSection.values)
- CheckboxListTile(
- dense: true,
- contentPadding: EdgeInsets.zero,
- controlAffinity: ListTileControlAffinity.leading,
- title: Text(_label(section)),
- value: _sections.contains(section),
- onChanged: (on) => setState(() {
- if (on == true) {
- _sections.add(section);
- } else {
- _sections.remove(section);
- }
- }),
- ),
- ],
- ),
++ return AppSheet(
++ children: [
++ SheetTitle(t.reportShareCsv, subtitle: reportRangeLabel(widget.report)),
++ const SizedBox(height: 10),
++ Text(t.reportChooseCsv, style: AppTheme.f(13, color: gc.textSecondary, height: 1.4)),
++ const SizedBox(height: 12),
++ OptionGroup([
++ for (final section in widget.sections)
++ OptionItem(
++ _label(section),
++ trailing: Semantics(
++ toggled: _selected.contains(section),
++ child: TinySwitch(on: _selected.contains(section)),
+ ),
++ onTap: () {
++ HapticFeedback.selectionClick();
++ setState(() {
++ if (!_selected.remove(section)) _selected.add(section);
++ });
++ },
+ ),
- ),
- const SizedBox(height: 12),
- FilledButton(
- onPressed: _sections.isEmpty ? null : () => Navigator.of(context).pop(_sections),
- child: Text(t.reportExportZip),
- ),
- ],
- ),
++ ]),
++ const SizedBox(height: 16),
++ PrimaryButton(
++ label: t.reportShareCsv,
++ bg: _selected.isEmpty ? gc.bgRaised2 : null,
++ fg: _selected.isEmpty ? gc.textTertiary : null,
++ onTap: _selected.isEmpty ? null : () => Navigator.of(context).pop(_selected),
++ ),
++ ],
+ );
+ }
+}
diff --cc lib/widgets/ui_kit.dart
index 0317b7a,0317b7a..95820de
--- a/lib/widgets/ui_kit.dart
+++ b/lib/widgets/ui_kit.dart
@@@ -1086,7 -1086,7 +1086,7 @@@ class PrimaryButton extends StatelessWi
this.icon,
});
final String label;
-- final VoidCallback onTap;
++ final VoidCallback? onTap;
final Color? bg;
final Color? fg;
final double height;
diff --cc test/pending_translation_keys.txt
index ed2ee71,0b261e0..5f7f160
--- a/test/pending_translation_keys.txt
+++ b/test/pending_translation_keys.txt
@@@ -12,10 -12,6 +12,9 @@@ sidesRep
progSchemeTitle
groupMoveUp
groupMoveDown
- reportExportZip
- reportSummaryEmpty
- reportZipHint
+ routineExerciseNote
+ importRoutineNotes
+ routineNotesAdded
++reportChooseCsv
+reportWeighIns
- reportSyncedSleep
+reportSessionDetails
- reportZipFailed
diff --cc test/report_csv_test.dart
index 0000000,0000000..8aee47a
new file mode 100644
--- /dev/null
+++ b/test/report_csv_test.dart
@@@ -1,0 -1,0 +1,242 @@@
++import 'dart:async';
++import 'dart:io';
++
++import 'package:flutter/material.dart';
++import 'package:flutter_test/flutter_test.dart';
++import 'package:gymmane/l10n/l10n.dart';
++import 'package:gymmane/models/nutrition.dart';
++import 'package:gymmane/models/workout.dart';
++import 'package:gymmane/services/local_store.dart';
++import 'package:gymmane/services/plan_pdf.dart';
++import 'package:gymmane/state/fit_state.dart';
++import 'package:gymmane/theme/app_theme.dart';
++import 'package:gymmane/widgets/report_sheet.dart';
++import 'package:gymmane/widgets/ui_kit.dart';
++// ignore: depend_on_referenced_packages
++import 'package:path_provider_platform_interface/path_provider_platform_interface.dart';
++// ignore: depend_on_referenced_packages
++import 'package:share_plus_platform_interface/share_plus_platform_interface.dart';
++import 'package:shared_preferences/shared_preferences.dart';
++
++class _TestPathProvider extends PathProviderPlatform {
++ _TestPathProvider(this.path);
++
++ final String path;
++
++ @override
++ Future<String?> getTemporaryPath() async => path;
++}
++
++class _TestShare extends SharePlatform {
++ Completer<List<String>>? pending;
++
++ @override
++ Future<ShareResult> share(ShareParams params) async {
++ final files = params.files!;
++ expect(files.map((file) => file.mimeType), everyElement('text/csv'));
++ expect(files.every((file) => File(file.path).existsSync()), isTrue);
++ pending!.complete(files.map((file) => File(file.path).uri.pathSegments.last).toList());
++ return const ShareResult('', ShareResultStatus.dismissed);
++ }
++}
++
++void main() {
++ TestWidgetsFlutterBinding.ensureInitialized();
++ final share = _TestShare();
++ final originalShare = SharePlatform.instance;
++ setUpAll(() => SharePlatform.instance = share);
++ tearDownAll(() => SharePlatform.instance = originalShare);
++
++ setUp(() async {
++ SharedPreferences.setMockInitialValues({});
++ await Store.instance.init();
++ fit.resetAllData();
++ setAppLanguage('en');
++ });
++
++ Future<List<String>> captureSharedFiles(Future<void> Function() triggerShare) async {
++ final directory = Directory.systemTemp.createTempSync('gymmane_report_csv');
++ final shared = Completer<List<String>>();
++ final originalPaths = PathProviderPlatform.instance;
++ PathProviderPlatform.instance = _TestPathProvider(directory.path);
++ share.pending = shared;
++ addTearDown(() {
++ PathProviderPlatform.instance = originalPaths;
++ share.pending = null;
++ directory.deleteSync(recursive: true);
++ });
++ await triggerShare();
++ expect(shared.isCompleted, isTrue);
++ return shared.future;
++ }
++
++ Future<void> showReport(WidgetTester tester) async {
++ tester.view.devicePixelRatio = 1;
++ tester.view.physicalSize = const Size(390, 844);
++ addTearDown(tester.view.reset);
++ await tester.pumpWidget(
++ MaterialApp(
++ theme: AppTheme.dark,
++ home: const Scaffold(body: ReportSheet()),
++ ),
++ );
++ }
++
++ test('only offers sections with exportable data in the date range', () {
++ final start = DateTime(2026, 11, 9);
++ final end = DateTime(2026, 11, 11);
++ fit.supplements.add(const Supplement(id: 's', name: 'Vitamin D', dose: '10 mcg'));
++ fit.supplementsTaken.addAll({
++ '2026-11-08': {'s'},
++ '2026-11-10': {'unknown'},
++ '2026-11-12': {'s'},
++ });
++ fit.bodyweight.add(BodyweightEntry(DateTime(2026, 11, 8), 89.9));
++ fit.sessions.add(LoggedSession(start, 1800, []));
++ expect(fit.reportCsvSections(fit.rangeReport(start, end)), isEmpty);
++
++ fit.sessions.add(LoggedSession(DateTime(2026, 11, 9, 8), 1800, []));
++ fit.waterLog.add(WaterSip(end, 250));
++ expect(fit.reportCsvSections(fit.rangeReport(start, end)), {
++ ReportSection.nutrition,
++ ReportSection.sessions,
++ });
++ });
++
++ test('exports supplement check-offs and individual weigh-ins within inclusive dates', () {
++ final start = DateTime(2026, 11, 9);
++ final end = DateTime(2026, 11, 11);
++ fit.supplements.add(const Supplement(id: 's', name: 'Vitamin, "D"', dose: '10 mcg'));
++ fit.supplementsTaken.addAll({
++ '2026-11-08': {'s'},
++ '2026-11-09': {'s'},
++ '2026-11-11': {'s'},
++ '2026-11-12': {'s'},
++ });
++ fit.bodyweight.addAll([
++ BodyweightEntry(DateTime(2026, 11, 8, 23), 89.9),
++ BodyweightEntry(DateTime(2026, 11, 11, 19), 89.1, note: 'Private note'),
++ BodyweightEntry(DateTime(2026, 11, 9, 7), 89.2),
++ BodyweightEntry(DateTime(2026, 11, 9, 9), 89.3),
++ BodyweightEntry(DateTime(2026, 11, 12), 88.8),
++ ]);
++
++ final r = fit.rangeReport(start, end);
++ expect(fit.reportCsvSections(r), {ReportSection.supplements, ReportSection.weighIns});
++ expect(
++ fit.reportSectionCsv(r, ReportSection.supplements),
++ 'date,supplement\n2026-11-09,"Vitamin, ""D"""\n2026-11-11,"Vitamin, ""D"""\n',
++ );
++ expect(
++ fit.reportSectionCsv(r, ReportSection.weighIns),
++ 'date,recorded_at,weight_kg\n'
++ '2026-11-09,2026-11-09T07:00:00.000,89.2\n'
++ '2026-11-09,2026-11-09T09:00:00.000,89.3\n'
++ '2026-11-11,2026-11-11T19:00:00.000,89.1\n',
++ );
++ });
++
++ test('preserves the existing formats and exports sessions by their start date', () {
++ final day = DateTime(2026, 11, 9);
++ final session = LoggedSession(
++ DateTime(2026, 11, 10, 0, 15),
++ 1800,
++ [
++ LoggedExercise('EIeI8Vf', 'Barbell Bench Press', 'chest', [LoggedSet(8, 50)]),
++ ],
++ name: 'Upper, "A"',
++ hrAvg: 108,
++ sleep: 4,
++ energy: 3,
++ );
++ fit.sessions.add(session);
++ fit.sessions.add(LoggedSession(DateTime(2026, 11, 10, 1), 300, [], name: 'Outside the range'));
++ fit.foodLog.add(
++ FoodEntry(
++ id: 'f',
++ at: day,
++ meal: Meal.breakfast,
++ name: 'Food',
++ per: const Macros(kcal: 200, protein: 20),
++ ),
++ );
++ final r = fit.rangeReport(day, day);
++ expect(fit.reportCsvSections(r), {
++ ReportSection.workouts,
++ ReportSection.nutrition,
++ ReportSection.sessions,
++ });
++ expect(fit.reportSectionCsv(r, ReportSection.workouts), Store.instance.exportCsv([session]));
++ expect(
++ fit.reportSectionCsv(r, ReportSection.nutrition),
++ 'date,kcal,protein_g,carbs_g,fat_g,fiber_g,water_ml,foods\n2026-11-09,200,20,0,0,0,0,1\n',
++ );
++ expect(fit.reportSectionCsv(r, ReportSection.sessions).split('\n').skip(1), [
++ '2026-11-09,2026-11-09T23:45:00.000,2026-11-10T00:15:00.000,"Upper, ""A""",1800,1,1,400.0,108,,4,3,false',
++ '',
++ ]);
++ });
++
++ test('the share service writes only selected CSV attachments', () async {
++ final day = DateTime(2026, 11, 9);
++ final report = fit.rangeReport(day, day);
++ final paths = await captureSharedFiles(
++ () => shareReport(report, csv: {ReportSection.weighIns, ReportSection.sessions}),
++ );
++ expect(paths, [
++ 'gymmane-weigh-ins-2026-11-09_2026-11-09.csv',
++ 'gymmane-sessions-2026-11-09_2026-11-09.csv',
++ ]);
++ });
++
++ testWidgets('the CSV picker defaults to workouts and nutrition and can toggle each option', (tester) async {
++ final today = DateTime.now();
++ fit.sessions.add(
++ LoggedSession(DateTime(today.year, today.month, today.day, 12), 600, [
++ LoggedExercise('EIeI8Vf', 'Barbell Bench Press', 'chest', [LoggedSet(8, 50)]),
++ ]),
++ );
++ fit.bodyweight.add(BodyweightEntry(today, 89.2));
++ fit.foodLog.add(
++ FoodEntry(id: 'f', at: today, meal: Meal.breakfast, name: 'Food', per: const Macros(kcal: 200)),
++ );
++ await showReport(tester);
++ await tester.tap(find.byType(GhostButton));
++ await tester.pumpAndSettle();
++ final picker = find.byType(AppSheet);
++ final rows = find.descendant(of: picker, matching: find.byType(TinySwitch));
++ expect(tester.widgetList<TinySwitch>(rows).map((w) => w.on), [true, true, false, false]);
++ expect(find.text(titleCase(t.supplementsLabel)), findsNothing);
++
++ await tester.tap(find.text(titleCase(t.reportWorkouts)));
++ await tester.tap(find.text(t.nutrition));
++ await tester.pumpAndSettle();
++ final action = find.descendant(of: picker, matching: find.byType(PrimaryButton));
++ expect(tester.widget<PrimaryButton>(action).onTap, isNull);
++ await tester.tap(find.text(t.reportWeighIns));
++ await tester.tap(find.text(t.reportSessionDetails));
++ await tester.pumpAndSettle();
++ expect(tester.widgetList<TinySwitch>(rows).map((w) => w.on), [false, false, true, true]);
++ expect(tester.widget<PrimaryButton>(action).onTap, isNotNull);
++ Navigator.of(tester.element(picker)).pop();
++ await tester.pumpAndSettle();
++ });
++
++ testWidgets('a supplement-only report shares directly', (tester) async {
++ final today = DateTime.now();
++ fit.supplements.add(const Supplement(id: 's', name: 'Vitamin D', dose: '10 mcg'));
++ fit.supplementsTaken[today.toIso8601String().split('T').first] = {'s'};
++ await showReport(tester);
++ expect(find.text(t.reportEmpty), findsNothing);
++ final export = tester.widget<GhostButton>(find.byType(GhostButton));
++ final paths = await tester.runAsync(
++ () => captureSharedFiles(() async {
++ export.onTap();
++ await share.pending!.future.timeout(const Duration(seconds: 5));
++ }),
++ );
++ expect(find.byType(OptionGroup), findsNothing);
++ expect(paths!.single, startsWith('gymmane-supplements-'));
++ await tester.pumpAndSettle();
++ });
++}