The web dashboard shows synced activity, but Garmin pairing runs through Garmin Connect and Android Health Connect.
+
+
+
1. Sync your watch in Garmin Connect on Android.
+
2. In Garmin Connect, enable sharing to Health Connect.
+
3. Open Calorie AI on Android and tap Settings -> Sync Health Connect.
+
+
+ {/each}
+
+
+
+
diff --git a/web/src/PlansPage.svelte b/web/src/PlansPage.svelte
index b8081bb..f06cab4 100644
--- a/web/src/PlansPage.svelte
+++ b/web/src/PlansPage.svelte
@@ -14,8 +14,6 @@
export let selectPlan;
export let deletePlan;
- $: selectedPlan = plans.find(plan => plan.id === selectedPlanId) || plans[0];
- $: caloriePlan = calculateCaloriePlan(settings);
let faqOpen = null;
const sexOptions = ['Female', 'Male'];
@@ -28,35 +26,55 @@
const faqs = [
{
- q: 'How does the AI build my plan?',
- a: 'It reads your height, weight, target, activity level, and pace, then looks at your most recent logged meals to understand your actual eating patterns. The result is a calorie range, protein target, and practical habits tailored to you.',
+ q: 'What changes when I generate a new plan?',
+ a: 'A new saved version is created. Your older versions stay in Plan history, so you can switch back later.',
},
{
- q: 'How often should I update my plan?',
- a: 'Update it whenever something changes — a new weigh-in, a shift in activity, or after a few weeks of logging. Use the fine-tune box to tell the AI what changed and it will revise the plan without starting from scratch.',
- },
- {
- q: 'Is this medical or clinical advice?',
- a: 'No. This is an AI-generated nutrition estimate based on self-reported data. It is not a substitute for advice from a registered dietitian or doctor. If you have a medical condition, are pregnant, or have a history of disordered eating, consult a qualified health professional first.',
+ q: 'What should I write in the update box?',
+ a: 'Use short real-world notes: hunger, weight trend, steps, workouts, missed meals, cravings, sleep, schedule changes, or anything that made the plan hard to follow.',
},
{
q: 'Are my fine-tune notes stored?',
- a: 'No. Notes you add in the fine-tune box are sent to the AI to update the plan and then discarded. Only the resulting plan text is saved.',
+ a: 'No. Notes are sent to the AI to create the next plan version, then discarded. Only the resulting plan text is saved.',
},
{
- q: 'Can I go back to an older plan?',
- a: 'Yes. Every version is kept in Plan history. Click any entry there to make it the active plan and it will appear in the Current plan panel.',
+ q: 'Is this medical advice?',
+ a: 'No. It is AI-generated guidance based on your inputs and logs. If you have a medical condition, are pregnant, or have a history of disordered eating, use a clinician or dietitian.',
},
];
const knownHeadings = new Set([
- 'plan', 'personalized weight-loss plan', 'your details', 'daily calorie range',
- 'protein target', 'healthy habits', 'weekly review steps', 'safety notes',
- 'getting started', 'targets', 'habits',
+ 'plan', 'personalized weight-loss plan', 'your details', 'daily calorie target',
+ 'daily calorie range', 'maintenance calories', 'protein target', 'meal logging strategy',
+ 'activity adjustment rules', 'challenge-specific tactics', 'weekly review steps',
+ 'safety notes', 'healthy habits', 'getting started', 'targets', 'habits',
]);
+ $: selectedPlan = plans.find(plan => plan.id === selectedPlanId) || plans[0];
+ $: caloriePlan = calculateCaloriePlan(settings);
+ $: targetCalories = Number(settings.calorieTarget) || caloriePlan?.goalCalories || 0;
+ $: profileMissing = [
+ ['sex', settings.sex],
+ ['age', settings.age],
+ ['height', settings.heightCm],
+ ['current weight', settings.weightKg],
+ ].filter(([, value]) => !value).map(([label]) => label);
+ $: profileReady = profileMissing.length === 0;
+ $: planSections = sections(selectedPlan?.content);
+ $: summaryCards = [
+ { label: 'Daily target', value: targetCalories ? `${targetCalories} kcal` : 'Add profile', note: settings.goal || 'Goal not set' },
+ { label: 'Maintenance', value: caloriePlan ? `${caloriePlan.maintenanceCalories} kcal` : 'Unknown', note: caloriePlan ? `BMR ${caloriePlan.bmr} kcal` : 'Needs basics' },
+ { label: 'Pace', value: settings.pace || 'Not set', note: settings.activityLevel ? `${settings.activityLevel} activity` : 'Activity not set' },
+ ];
+
function cleanLine(line) {
- return line.replace(/^#{1,6}\s*/, '').replace(/^[-*]\s+/, '').replace(/\*\*/g, '').replace(/^---+$/, '').trim();
+ return line
+ .replace(/^#{1,6}\s*/, '')
+ .replace(/^[-*]\s+/, '')
+ .replace(/^\d+\.\s+/, '')
+ .replace(/\*\*/g, '')
+ .replace(/^---+$/, '')
+ .trim();
}
function isHeading(line) {
@@ -74,124 +92,213 @@
for (const line of lines) {
if (isHeading(line)) {
if (current.items.length) output.push(current);
- current = { title: line.replace(/^\d+\.\s+/, '').replace(/:$/, ''), items: [] };
+ current = { title: line.replace(/:$/, ''), items: [] };
} else {
current.items.push(line);
}
}
- output.push(current);
- return output.filter(section => section.items.length || section.title !== 'Plan');
+ if (current.items.length) output.push(current);
+ return output;
+ }
+
+ function formatDate(value) {
+ if (!value) return 'Unknown date';
+ return new Date(value).toLocaleString([], { month: 'short', day: 'numeric', year: 'numeric', hour: 'numeric', minute: '2-digit' });
}
-
-
Your plan is built from your body stats, goal, habits, challenges, and recent meals.
GarminSync Garmin Connect to Android Health Connect, then tap Sync Health Connect in the Android app.
-
Gym machinesUse the machine or gym app to write workouts to Health Connect. Calorie AI imports the workout sessions and daily active calories.
-
PlanningSynced active calories and steps are saved on the server and included when generating or updating plans.
+
+
Garmin and Health Connect
+
Connect Garmin from the Android app
+
The web app cannot pair directly with a Garmin watch. Garmin writes to Android Health Connect, then Calorie AI imports that activity.
+
+
1. Garmin ConnectPair the watch and confirm it syncs in the Garmin Connect Android app.
+
2. Health ConnectIn Garmin Connect, enable sharing to Android Health Connect. Garmin sends steps, calories, and workouts after each device sync.
+
3. Calorie AI AndroidOpen Calorie AI on Android, go to Settings, and tap Sync Health Connect. The web dashboard updates after the server receives the sync.
+
+
Direct Garmin web login is not available because Garmin Health API requires partner approval and API credentials.