debug: Add logging and warnings for Goal System issues
Based on test feedback - 3 issues addressed: 1. Primary Toggle (Frontend Debug): - Add console.log in handleSaveGoal - Shows what data is sent to backend - Helps debug if checkbox state is correct 2. Lean Mass Display (Backend Debug): - Add error handling in lean_mass calculation - Log why calculation fails (missing weight/bf data) - Try-catch for value conversion errors 3. BP/Strength/Flexibility Warning (UI): - Yellow warning box for incomplete goal types - BP: "benötigt 2 Werte (geplant für v2.0)" - Strength/Flexibility: "Keine Datenquelle" - Transparent about limitations Next: User re-tests with debug output to identify root cause. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
14d80fc903
commit
27a8af7008
2 files changed
+31
-4
No files matched your search
@@ -167,6 +167,8 @@ export default function GoalsPage() {
|
||||
description: formData.description || null
|
||||
}
|
||||
|
||||
console.log('[DEBUG] Saving goal:', { editingGoal, data })
|
||||
|
||||
if (editingGoal) {
|
||||
await api.updateGoal(editingGoal, data)
|
||||
showToast('✓ Ziel aktualisiert')
|
||||
@@ -493,6 +495,24 @@ export default function GoalsPage() {
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
|
||||
{/* Warning for incomplete goal types */}
|
||||
{['bp', 'strength', 'flexibility'].includes(formData.goal_type) && (
|
||||
<div style={{
|
||||
marginTop: 8,
|
||||
padding: 8,
|
||||
background: '#FEF3C7',
|
||||
border: '1px solid #F59E0B',
|
||||
borderRadius: 6,
|
||||
fontSize: 12,
|
||||
color: '#92400E'
|
||||
}}>
|
||||
⚠️ Dieser Zieltyp ist aktuell eingeschränkt:
|
||||
{formData.goal_type === 'bp' && ' Blutdruck benötigt 2 Werte (geplant für v2.0)'}
|
||||
{formData.goal_type === 'strength' && ' Keine Datenquelle vorhanden (geplant für v2.0)'}
|
||||
{formData.goal_type === 'flexibility' && ' Keine Datenquelle vorhanden (geplant für v2.0)'}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Name */}
|
||||
|
||||
Reference in new issue
Block a user