From dfcdfbe335b739e90435060c6972ae19717a37d0 Mon Sep 17 00:00:00 2001 From: Lars Date: Fri, 27 Mar 2026 20:40:33 +0100 Subject: [PATCH] fix: restore Goal Mode cards and fix focus areas display - Restored GOAL_MODES constant and selection cards at top - Fixed focusAreas/focusPreferences variable confusion - Legacy 6 focus preferences show correctly in Fokus-Bereiche card - Dynamic 26 focus areas should display in goal form - Goal Mode cards now visible and functional again --- frontend/src/pages/GoalsPage.jsx | 105 +++++++++++++++++++++++++++++-- 1 file changed, 100 insertions(+), 5 deletions(-) diff --git a/frontend/src/pages/GoalsPage.jsx b/frontend/src/pages/GoalsPage.jsx index 43d8b62..2afcb27 100644 --- a/frontend/src/pages/GoalsPage.jsx +++ b/frontend/src/pages/GoalsPage.jsx @@ -5,6 +5,45 @@ import dayjs from 'dayjs' import 'dayjs/locale/de' dayjs.locale('de') +// Goal Mode Definitions +const GOAL_MODES = [ + { + id: 'weight_loss', + icon: '📉', + label: 'Gewichtsreduktion', + description: 'Kaloriendefizit, Fettabbau', + color: '#D85A30' + }, + { + id: 'strength', + icon: '💪', + label: 'Kraftaufbau', + description: 'Muskelwachstum, progressive Belastung', + color: '#378ADD' + }, + { + id: 'endurance', + icon: '🏃', + label: 'Ausdauer', + description: 'VO2Max, aerobe Kapazität', + color: '#1D9E75' + }, + { + id: 'recomposition', + icon: '⚖️', + label: 'Körperkomposition', + description: 'Gleichzeitig Fett ab- & Muskeln aufbauen', + color: '#7B68EE' + }, + { + id: 'health', + icon: '❤️', + label: 'Gesundheit', + description: 'Vitals, Regeneration, Wohlbefinden', + color: '#E67E22' + } +] + // Goal Categories const GOAL_CATEGORIES = { body: { label: 'Körper', icon: '📉', color: '#D85A30', description: 'Gewicht, Körperfett, Muskelmasse' }, @@ -403,15 +442,71 @@ export default function GoalsPage() { )} + {/* Goal Mode Selection - Strategic Layer */} +
+

🎯 Trainingsmodus

+

+ Wähle deinen primären Trainingsmodus. Dies beeinflusst die Gewichtung der Fokus-Bereiche und KI-Analysen. +

+
+ {GOAL_MODES.map(mode => ( +
handleGoalModeChange(mode.id)} + style={{ + padding: 16, + borderRadius: 8, + border: `2px solid ${goalMode === mode.id ? mode.color : 'var(--border)'}`, + background: goalMode === mode.id ? `${mode.color}15` : 'var(--surface)', + cursor: 'pointer', + transition: 'all 0.2s', + position: 'relative' + }} + > +
{mode.icon}
+
+ {mode.label} +
+
+ {mode.description} +
+ {goalMode === mode.id && ( +
+ ✓ +
+ )} +
+ ))} +
+
+ {/* Focus Areas (v2.0) */}

🎯 Fokus-Bereiche

- {!focusEditing && focusAreas && ( + {!focusEditing && focusPreferences && (
- ) : focusAreas && ( + ) : focusPreferences && ( /* Display Mode */
{[ @@ -555,7 +650,7 @@ export default function GoalsPage() { { key: 'endurance_pct', label: 'Ausdauer', icon: '🏃', color: '#1D9E75' }, { key: 'flexibility_pct', label: 'Beweglichkeit', icon: '🤸', color: '#E67E22' }, { key: 'health_pct', label: 'Gesundheit', icon: '❤️', color: '#F59E0B' } - ].filter(area => focusAreas[area.key] > 0).map(area => ( + ].filter(area => focusPreferences[area.key] > 0).map(area => (
{area.icon}
{area.label}
-
{focusAreas[area.key]}%
+
{focusPreferences[area.key]}%
))}