feat: enhance KPI tiles with contextual hints and improve chart legends
Deploy Development / deploy (push) Successful in 54s
Build Test / pytest-backend (push) Successful in 4s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 17s

- Added contextual hints to KPI tiles in the nutrition interpretation to provide users with actionable insights regarding protein intake and weight assessment.
- Updated the KpiTilesOverview component to display these hints, improving user understanding of nutrition metrics.
- Introduced a new KcalVsWeightLegend component to clarify chart data representation, enhancing the overall user experience in the history visualization.
This commit is contained in:
Lars committed 2026-04-19 17:36:45 +02:00
1 parent 31fbf33031
commit fc816da335
3 files changed
+100 -6

No files matched your search

@@ -28,6 +28,7 @@ export function buildKpiTileTitleString(t) {
* - `value` (ReactNode) — Hauptwert
* - `status` — für Farbstreifen: `good` | `warn` | `bad`
* - optional: `icon`, `sublabel`, `verdict`, `valueColor`, `hoverTop`, `hoverBody`, `keys`
* - optional: `hint` — Kurz-Hinweis/Warnung direkt auf der Kachel (z. B. Ernährung bei warn/bad)
*/
export default function KpiTilesOverview({
tiles,
@@ -82,6 +83,7 @@ export default function KpiTilesOverview({
{tiles.map(t => {
const accent = getStatusColor(t.status)
const tip = buildKpiTileTitleString(t)
const cardHint = t.hint ? String(t.hint) : null
return (
<div
key={t.key}
@@ -119,6 +121,23 @@ export default function KpiTilesOverview({
</div>
) : null}
</div>
{cardHint ? (
<div
className="kpi-tiles-card__hint"
style={{
marginTop: 10,
padding: '8px 10px',
borderRadius: 8,
fontSize: 10,
lineHeight: 1.45,
color: 'var(--text2)',
background: 'var(--surface2)',
borderLeft: `3px solid ${accent}`,
}}
>
{cardHint}
</div>
) : null}
</div>
)
})}