fix: show goal type label when name is empty
All checks were successful
Deploy Development / deploy (push) Successful in 49s
Build Test / lint-backend (push) Successful in 1s
Build Test / build-frontend (push) Successful in 13s

Enhanced fallback chain for goal display:
1. goal.name (custom name if set)
2. goal.label_de (from backend JOIN)
3. typeInfo.label_de (from goalTypesMap)
4. goal.goal_type (raw key as last resort)

Also use goal.icon from backend if available.

Fixes: Empty goal names showing blank in list

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Lars 2026-03-27 12:51:24 +01:00
parent 9e95fd8416
commit 498ad7a47f

View File

@ -515,9 +515,9 @@ export default function GoalsPage() {
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', gap: 16 }}>
<div style={{ flex: 1 }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 8, marginBottom: 8, flexWrap: 'wrap' }}>
<span style={{ fontSize: 20 }}>{typeInfo.icon}</span>
<span style={{ fontSize: 20 }}>{goal.icon || typeInfo.icon}</span>
<span style={{ fontWeight: 600, fontSize: 16 }}>
{goal.name || typeInfo.label_de}
{goal.name || goal.label_de || typeInfo.label_de || goal.goal_type}
</span>
<span style={{ fontSize: 16 }} title={priorityInfo.label}>
{priorityInfo.stars}