fix(mood-chart): make chartKey opt-in and don't leak overlay state across pages

The MoodChart component defaulted chartKey to "mood", which meant
every consumer that omitted the prop — including /insights and the
recommendation-card mini chart — picked up the dashboard's persisted
overlay prefs and rendered the settings cog. Toggling Trend on
/insights would silently flip the dashboard mood chart on next paint
because both reads shared the same persistence key.

Drop the default; the dashboard now passes chartKey="mood" explicitly
and ad-hoc surfaces stay clean (no cog, default overlays). Also wraps
the title row's right-side container with flex-wrap + justify-end so
the 4 range tabs + cog don't push the card horizontally on Pixel-5
when the comparison caption is also in the row.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Marc-André BombeckandClaude Opus 4.7 committed 2026-05-10 11:02:27 +02:00
1 parent 720e6c89b9
commit fbf14fceb8
2 files changed
+19 -9

No files matched your search

+5 -1
View File
@@ -979,7 +979,11 @@ export default function DashboardPage() {
order: widgetOrder("mood"),
count: moodSummary?.count ?? 0,
node: (
<MoodChart key="mood-chart" compareBaseline={compareBaseline} />
<MoodChart
key="mood-chart"
compareBaseline={compareBaseline}
chartKey="mood"
/>
),
});
}