mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-13 06:32:03 +00:00
refactor(cycle): wire the phase-correlation card into the insights tab
The cycle insights tab rendered an empty placeholder while the phase-contrast card + its `/api/cycle/insights` feed sat unused. Wire them together: a `useCycleInsights` read drives the headline finding + the luteal-vs-follicular crosstab on the insights tab, matching the mood-factor crosstab styling. Drops the placeholder card + a duplicate disclaimer component in favour of the ones already in use, and removes the unused recency/phase-result/label exports. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
e984ada5f1
commit
55f40df0ac
9 files changed
+33
-213
No files matched your search
@@ -57,15 +57,6 @@ export const HISTORY_WINDOW_N = 12;
|
||||
/** §1 — need ≥2 completed cycles for a real (non-priors) prediction. */
|
||||
export const MIN_CYCLES_TO_PREDICT = 2;
|
||||
|
||||
/** §1 — optional recency half-life (cycles). OFF in MVP (see below). */
|
||||
export const RECENCY_HALF_LIFE = 6;
|
||||
|
||||
/**
|
||||
* §1 — recency weighting is OFF in the v1.15 MVP (plain median) so the TS and
|
||||
* Swift engines stay trivially identical. Flip in lockstep later.
|
||||
*/
|
||||
export const RECENCY_WEIGHTING_ENABLED = false;
|
||||
|
||||
/** §1 — floor on the robust SD so the band is never zero-width (false precision). */
|
||||
export const SIGMA_FLOOR = 1.0;
|
||||
|
||||
@@ -238,11 +229,3 @@ export interface CyclePredictionResult {
|
||||
/** Robust SD of cycle length (days), >= SIGMA_FLOOR. */
|
||||
estimatedCycleSd: number;
|
||||
}
|
||||
|
||||
/** The phase of a single calendar date relative to its containing cycle. */
|
||||
export interface PhaseResult {
|
||||
date: string;
|
||||
phase: CyclePhase | null;
|
||||
/** 1-based day-of-cycle (1 = startDate), or null if the date is outside any cycle. */
|
||||
dayOfCycle: number | null;
|
||||
}
|
||||
@@ -514,6 +514,7 @@ export const queryKeys = {
|
||||
["cycle", "calendar", from, to] as const,
|
||||
cycleHistory: (limit: number) => ["cycle", "history", limit] as const,
|
||||
cycleProfile: () => ["cycle", "profile"] as const,
|
||||
cycleInsights: () => ["cycle", "insights"] as const,
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user