mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-17 07:42:23 +00:00
feat(vorsorge): widen the linkable measurement set to the body-comp family
The reminder type allow-list exposed 7 of the full MeasurementType enum. Widen it to the ~15 active-measurement set: vitals (weight, BP, pulse, glucose, SpO2, temperature) plus the body-composition family a scale produces (fat mass, fat-free mass, muscle, lean body mass, bone mass, body water, visceral fat, BMI). One step on the scale satisfies every linked reminder at once. Passive scores, cumulative activity, and device events stay excluded — nudging someone to 'go measure' a passive sample makes no sense. App-layer only: the column is the full enum, so no migration. Group the dropdown (Vitals / Body composition) and add the labels across all six locales.
This commit is contained in:
1 parent
7b57c1d3d8
commit
a0d864db8c
10 files changed
+237
-27
No files matched your search
@@ -38,14 +38,37 @@ import {
|
||||
type MeasurementReminder,
|
||||
} from "@/hooks/use-measurement-reminders";
|
||||
|
||||
const TYPE_OPTIONS = [
|
||||
"WEIGHT",
|
||||
"BLOOD_PRESSURE_SYS",
|
||||
"PULSE",
|
||||
"BLOOD_GLUCOSE",
|
||||
"OXYGEN_SATURATION",
|
||||
"BODY_FAT",
|
||||
"BODY_TEMPERATURE",
|
||||
// v1.18.1 (V3) — the active-measurement set, grouped so the dropdown
|
||||
// doesn't read as a flat 15-item list. Mirrors the Zod allow-list in
|
||||
// `validations/measurement-reminders.ts`; the labels resolve through
|
||||
// `measurementReminders.types.*`, the group headers through
|
||||
// `measurementReminders.typeGroups.*`.
|
||||
const TYPE_GROUPS = [
|
||||
{
|
||||
group: "vitals",
|
||||
types: [
|
||||
"WEIGHT",
|
||||
"BLOOD_PRESSURE_SYS",
|
||||
"PULSE",
|
||||
"BLOOD_GLUCOSE",
|
||||
"OXYGEN_SATURATION",
|
||||
"BODY_TEMPERATURE",
|
||||
],
|
||||
},
|
||||
{
|
||||
group: "bodyComposition",
|
||||
types: [
|
||||
"BODY_FAT",
|
||||
"FAT_MASS",
|
||||
"FAT_FREE_MASS",
|
||||
"MUSCLE_MASS",
|
||||
"LEAN_BODY_MASS",
|
||||
"BONE_MASS",
|
||||
"TOTAL_BODY_WATER",
|
||||
"VISCERAL_FAT",
|
||||
"BODY_MASS_INDEX",
|
||||
],
|
||||
},
|
||||
] as const;
|
||||
|
||||
const INTERVAL_PRESETS = [7, 14, 30, 90, 180, 365] as const;
|
||||
@@ -220,10 +243,17 @@ export function VorsorgeSection({
|
||||
value={measurementType}
|
||||
onChange={(e) => setMeasurementType(e.target.value)}
|
||||
>
|
||||
{TYPE_OPTIONS.map((type) => (
|
||||
<option key={type} value={type}>
|
||||
{t(`measurementReminders.types.${type}`)}
|
||||
</option>
|
||||
{TYPE_GROUPS.map(({ group, types }) => (
|
||||
<optgroup
|
||||
key={group}
|
||||
label={t(`measurementReminders.typeGroups.${group}`)}
|
||||
>
|
||||
{types.map((type) => (
|
||||
<option key={type} value={type}>
|
||||
{t(`measurementReminders.types.${type}`)}
|
||||
</option>
|
||||
))}
|
||||
</optgroup>
|
||||
))}
|
||||
</NativeSelect>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user