mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-14 06:40:50 +00:00
fix(insights): leave mood out of the trends row when its module is off
The tab strip already hides the Mood pill when the mood module is off, but the trends row still charted mood, both from a briefing finding and in its blood pressure / weight / mood fallback. selectTrendCharts now takes the metrics to leave out, and the overview passes mood when the module is off. Refs #975
This commit is contained in:
1 parent
c7f7a2925f
commit
2b512501db
4 files changed
+46
-3
No files matched your search
@@ -74,6 +74,9 @@ function BlockSkeleton({
|
||||
);
|
||||
}
|
||||
|
||||
/** Stable reference so the trends row does not re-select on every render. */
|
||||
const HIDDEN_MOOD = ["mood"] as const;
|
||||
|
||||
const DailyBriefing = dynamic(
|
||||
() =>
|
||||
import("@/components/insights/daily-briefing").then((mod) => ({
|
||||
@@ -513,6 +516,9 @@ export default function InsightsPageClient() {
|
||||
trends: (
|
||||
<TrendsRow
|
||||
briefing={briefingPayload}
|
||||
// Same module gate the tab strip applies to the Mood pill: with
|
||||
// the mood module off, the trends row does not chart mood either.
|
||||
hiddenMetrics={user?.modules?.mood === false ? HIDDEN_MOOD : undefined}
|
||||
annotations={advisor.payload?.trendAnnotations ?? null}
|
||||
loading={advisor.isLoading || advisor.isRegenerating}
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user