mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-19 00:12:18 +00:00
refactor(insights, settings): unify the Heart group and add settings sidebar groups
The insights tab strip's "Cardiovascular" popover held only three rare Withings markers while pulse, resting heart rate, HRV, and cardio recovery sat scattered across a flat pill and the unrelated Vitals group. Cardiovascular is now Heart and gathers all six; bmi and workouts — flat only by historical accident — collapse into their correct Body / Activity groups, and breathing disturbances moves out of Vitals into the Sleep manager bucket instead of vanishing whenever the sleep module is off. Blood pressure, weight, sleep, mood, and medications stay pinned as flat top-level pills — now a documented `PINNED_SUB_PAGE_SLUGS` set instead of an unexplained "predates v1.4.32" carve-out. Active energy moves from Vitals to Activity to match its own tab-strip section comment. All changes are grouping / presentation data only — no slug, route, or redirect changed. The Settings sidebar's 19 entries rendered as one flat list with no visual structure. They now cluster under seven group headers (Account, Your data, Display, Health profile, AI, Connectivity, System), reordered to match; the desktop sidebar gets a non-interactive text header per group, the mobile chip strip a quiet divider. Presentation only — no route changed. Reference: 2026-07-17 UX/IA audit, H2 + M1 + M2 + M3 + M6.
This commit is contained in:
1 parent
4c436d7dfc
commit
e7802701ba
13 files changed
+504
-233
No files matched your search
@@ -69,7 +69,7 @@ export const CATALOG_GROUP_HEADER_KEYS: Record<ManagerGroup, string> = {
|
||||
body: "insights.tabStrip.bodyParent.header",
|
||||
activity: "insights.tabStrip.activityParent.header",
|
||||
sleep: "insights.editMode.groupSleep",
|
||||
cardiovascular: "insights.tabStrip.cardiovascularParent.header",
|
||||
heart: "insights.tabStrip.heartParent.header",
|
||||
hearing: "insights.tabStrip.hearingParent.header",
|
||||
environment: "insights.tabStrip.environmentParent.header",
|
||||
metabolic: "insights.tabStrip.metabolicParent.header",
|
||||
@@ -198,7 +198,7 @@ function buildMetricEntries(): CatalogEntry[] {
|
||||
*/
|
||||
const ECG_ENTRY: CatalogEntry = {
|
||||
id: "ecg",
|
||||
group: "cardiovascular",
|
||||
group: "heart",
|
||||
nameKey: "insights.ecg.sectionTitle",
|
||||
sourceKey: "metricCatalog.ecg.source",
|
||||
kind: "metric",
|
||||
@@ -217,7 +217,7 @@ const ECG_ENTRY: CatalogEntry = {
|
||||
*/
|
||||
const WATCHDOG_ENTRY: CatalogEntry = {
|
||||
id: "watchdog",
|
||||
group: "cardiovascular",
|
||||
group: "heart",
|
||||
nameKey: "metricCatalog.watchdog.title",
|
||||
sourceKey: "metricCatalog.watchdog.description",
|
||||
kind: "info",
|
||||
|
||||
@@ -41,10 +41,16 @@
|
||||
// so the five pills collapse behind one "Vitalwerte" / "Vitals" parent
|
||||
// pill with a popover sub-list. The `group: "vitals"` field below
|
||||
// drives that grouping; the canonical order inside the popover follows
|
||||
// the strip order. The earlier inline pills (`pulse`, `blood-pressure`,
|
||||
// `weight`, `bmi`, `sleep`, `mood`, `medications`, `workouts`) stay
|
||||
// flat — they predate v1.4.32 and the maintainer's audit kept them as
|
||||
// direct entries.
|
||||
// the strip order.
|
||||
//
|
||||
// 2026-07-17 UX/IA audit (H2, M1, M2, M3) — the inline pills that used to
|
||||
// stay flat "because they predate v1.4.32" are now flat by deliberate
|
||||
// design or not at all: `blood-pressure`, `weight`, `sleep`, `medications`
|
||||
// and `mood` are PINNED (see `PINNED_SUB_PAGE_SLUGS` below) because they
|
||||
// are the account's highest-traffic pages, not because grouping them was
|
||||
// never considered. `pulse`, `bmi` and `workouts` were flat by historical
|
||||
// accident only — they now collapse into their correct group (`heart`,
|
||||
// `body`, `activity`) like every sibling metric.
|
||||
const SUB_PAGE_METRIC = {
|
||||
// ── vitals ──
|
||||
"blood-pressure": ["BLOOD_PRESSURE_SYS", "BLOOD_PRESSURE_DIA", "PULSE"],
|
||||
@@ -156,27 +162,43 @@ export const SUB_PAGE_SLUGS = Object.keys(SUB_PAGE_METRIC) as SubPageSlug[];
|
||||
* `insights.tabStrip.<group>Parent.*` in every locale.
|
||||
*/
|
||||
// v1.7.0 — the new metric clusters each collapse behind a parent pill
|
||||
// so the strip stays scannable as the sub-page count grows. The flat
|
||||
// pills (pulse, blood-pressure, weight, bmi, sleep, mood, medications,
|
||||
// workouts) stay direct entries as before.
|
||||
// so the strip stays scannable as the sub-page count grows. Only the
|
||||
// `PINNED_SUB_PAGE_SLUGS` (blood-pressure, weight, sleep, mood,
|
||||
// medications) stay direct entries.
|
||||
export type SubPageGroup =
|
||||
| "vitals"
|
||||
| "body"
|
||||
| "activity"
|
||||
| "cardiovascular"
|
||||
| "heart"
|
||||
| "hearing"
|
||||
| "environment"
|
||||
| "metabolic";
|
||||
|
||||
/**
|
||||
* 2026-07-17 UX/IA audit (H2) — slugs pinned as flat, always-top-level
|
||||
* pills regardless of any `SUB_PAGE_GROUP` entry they carry. This is the
|
||||
* account's short list of highest-traffic pages (per the audit's
|
||||
* "Pinned flat pills" proposal); everything else renders through its
|
||||
* group. A pinned slug is excluded from its group's popover children in
|
||||
* the tab strip (it already has its own pill) but still counts toward
|
||||
* its `SUB_PAGE_MANAGER_GROUP` for the "Detailseiten verwalten" manager
|
||||
* and the metric catalog.
|
||||
*/
|
||||
export const PINNED_SUB_PAGE_SLUGS: ReadonlySet<SubPageSlug> = new Set([
|
||||
"blood-pressure",
|
||||
"weight",
|
||||
"sleep",
|
||||
"medications",
|
||||
"mood",
|
||||
]);
|
||||
|
||||
export const SUB_PAGE_GROUP: Partial<Record<SubPageSlug, SubPageGroup>> = {
|
||||
// vitals
|
||||
hrv: "vitals",
|
||||
"resting-pulse": "vitals",
|
||||
oxygen: "vitals",
|
||||
"body-temperature": "vitals",
|
||||
"active-energy": "vitals",
|
||||
"respiratory-rate": "vitals",
|
||||
// body composition (v1.7.0)
|
||||
bmi: "body",
|
||||
"body-water": "body",
|
||||
"bone-mass": "body",
|
||||
"fat-free-mass": "body",
|
||||
@@ -186,6 +208,8 @@ export const SUB_PAGE_GROUP: Partial<Record<SubPageSlug, SubPageGroup>> = {
|
||||
"lean-body-mass": "body",
|
||||
// activity / mobility (v1.7.0)
|
||||
steps: "activity",
|
||||
"active-energy": "activity",
|
||||
workouts: "activity",
|
||||
"flights-climbed": "activity",
|
||||
"walking-distance": "activity",
|
||||
"walking-steadiness": "activity",
|
||||
@@ -194,9 +218,17 @@ export const SUB_PAGE_GROUP: Partial<Record<SubPageSlug, SubPageGroup>> = {
|
||||
"double-support-time": "activity",
|
||||
"step-length": "activity",
|
||||
"walking-speed": "activity",
|
||||
// cardiovascular (v1.7.0)
|
||||
"pulse-wave-velocity": "cardiovascular",
|
||||
"vascular-age": "cardiovascular",
|
||||
// heart (2026-07-17 UX/IA audit H2) — pulse, resting HR, HRV, cardio
|
||||
// recovery and the Withings vascular markers now share one coherent
|
||||
// "Heart" popover instead of pulse/resting-HR/HRV being scattered
|
||||
// across Vitals and a "Cardiovascular" group that only ever held the
|
||||
// three rarest markers.
|
||||
pulse: "heart",
|
||||
"resting-pulse": "heart",
|
||||
hrv: "heart",
|
||||
"pulse-wave-velocity": "heart",
|
||||
"vascular-age": "heart",
|
||||
"cardio-recovery": "heart",
|
||||
// hearing (v1.7.0)
|
||||
"environmental-audio": "hearing",
|
||||
"headphone-audio": "hearing",
|
||||
@@ -213,10 +245,6 @@ export const SUB_PAGE_GROUP: Partial<Record<SubPageSlug, SubPageGroup>> = {
|
||||
"six-minute-walk": "activity",
|
||||
"stair-ascent-speed": "activity",
|
||||
"stair-descent-speed": "activity",
|
||||
// vitals cluster (breathing sits with respiratory rate)
|
||||
"breathing-disturbances": "vitals",
|
||||
// cardiovascular cluster
|
||||
"cardio-recovery": "cardiovascular",
|
||||
// metabolic cluster (overnight wrist reading)
|
||||
"wrist-temperature": "metabolic",
|
||||
// ── v1.25 — physical / clinical signals ──
|
||||
@@ -242,9 +270,7 @@ export const SUB_PAGE_GROUP_ORDER: Record<
|
||||
activity: SUB_PAGE_SLUGS.filter(
|
||||
(slug) => SUB_PAGE_GROUP[slug] === "activity",
|
||||
),
|
||||
cardiovascular: SUB_PAGE_SLUGS.filter(
|
||||
(slug) => SUB_PAGE_GROUP[slug] === "cardiovascular",
|
||||
),
|
||||
heart: SUB_PAGE_SLUGS.filter((slug) => SUB_PAGE_GROUP[slug] === "heart"),
|
||||
hearing: SUB_PAGE_SLUGS.filter((slug) => SUB_PAGE_GROUP[slug] === "hearing"),
|
||||
environment: SUB_PAGE_SLUGS.filter(
|
||||
(slug) => SUB_PAGE_GROUP[slug] === "environment",
|
||||
@@ -258,24 +284,25 @@ export const SUB_PAGE_GROUP_ORDER: Record<
|
||||
* v1.15.14 W2 — manager grouping for the "Anpassen" → "Detailseiten
|
||||
* verwalten" surface.
|
||||
*
|
||||
* The tab strip only assigns a `SUB_PAGE_GROUP` to the long-tail metrics
|
||||
* that collapse behind a popover parent pill; the eight legacy flat pills
|
||||
* (blood-pressure, pulse, weight, bmi, sleep, mood, medications, workouts)
|
||||
* render as direct entries and carry NO `SUB_PAGE_GROUP`. The sub-page
|
||||
* MANAGER, by contrast, lists EVERY slug grouped under a category header,
|
||||
* so it needs a total slug → group mapping that covers the flat pills too
|
||||
* and adds the three categories the tab strip never groups (`sleep`,
|
||||
* `mood`, `events`). This map is that total assignment; it is a superset
|
||||
* of `SUB_PAGE_GROUP` (every `SUB_PAGE_GROUP` entry agrees with it) plus a
|
||||
* fallback for the flat slugs. Single source of truth for the manager —
|
||||
* the tab-strip nav grouping stays `SUB_PAGE_GROUP` exactly as before.
|
||||
* The tab strip only assigns a `SUB_PAGE_GROUP` to the metrics that
|
||||
* collapse behind a popover parent pill; the pinned flat pills
|
||||
* (blood-pressure, weight, sleep, mood, medications —
|
||||
* `PINNED_SUB_PAGE_SLUGS`) render as direct entries and carry NO
|
||||
* `SUB_PAGE_GROUP`. The sub-page MANAGER, by contrast, lists EVERY slug
|
||||
* grouped under a category header, so it needs a total slug → group
|
||||
* mapping that covers the pinned slugs too and adds the three categories
|
||||
* the tab strip never groups (`sleep`, `mood`, `events`). This map is
|
||||
* that total assignment; it is a superset of `SUB_PAGE_GROUP` (every
|
||||
* `SUB_PAGE_GROUP` entry agrees with it) plus a fallback for the pinned
|
||||
* slugs. Single source of truth for the manager — the tab-strip nav
|
||||
* grouping stays `SUB_PAGE_GROUP` exactly as before.
|
||||
*/
|
||||
export type ManagerGroup =
|
||||
| "vitals"
|
||||
| "body"
|
||||
| "activity"
|
||||
| "sleep"
|
||||
| "cardiovascular"
|
||||
| "heart"
|
||||
| "hearing"
|
||||
| "environment"
|
||||
| "metabolic"
|
||||
@@ -285,7 +312,7 @@ export type ManagerGroup =
|
||||
/**
|
||||
* Render order of the manager's category sections — mirrors the
|
||||
* MeasurementCategory overlay the rest of insights follows
|
||||
* (vitals → body → activity → sleep → cardiovascular → hearing →
|
||||
* (vitals → body → activity → sleep → heart → hearing →
|
||||
* environment → metabolic → mood → events).
|
||||
*/
|
||||
export const MANAGER_GROUP_ORDER: readonly ManagerGroup[] = [
|
||||
@@ -293,7 +320,7 @@ export const MANAGER_GROUP_ORDER: readonly ManagerGroup[] = [
|
||||
"body",
|
||||
"activity",
|
||||
"sleep",
|
||||
"cardiovascular",
|
||||
"heart",
|
||||
"hearing",
|
||||
"environment",
|
||||
"metabolic",
|
||||
@@ -304,13 +331,15 @@ export const MANAGER_GROUP_ORDER: readonly ManagerGroup[] = [
|
||||
/** Explicit group for the flat tab-strip slugs (those `SUB_PAGE_GROUP` omits). */
|
||||
const FLAT_SLUG_MANAGER_GROUP: Partial<Record<SubPageSlug, ManagerGroup>> = {
|
||||
"blood-pressure": "vitals",
|
||||
pulse: "vitals",
|
||||
weight: "body",
|
||||
bmi: "body",
|
||||
workouts: "activity",
|
||||
sleep: "sleep",
|
||||
mood: "mood",
|
||||
medications: "events",
|
||||
// 2026-07-17 UX/IA audit (M3) — breathing disturbances stays a flat,
|
||||
// ungrouped tab-strip pill (see `SUB_PAGE_GROUP`) but files under the
|
||||
// Sleep section in the manager, not the foreign Vitals popover it used
|
||||
// to disappear from whenever the sleep module was off.
|
||||
"breathing-disturbances": "sleep",
|
||||
// v1.29 — nutrient intake filed with the metabolic cluster (alongside
|
||||
// blood glucose / skin / wrist temperature).
|
||||
nutrients: "metabolic",
|
||||
|
||||
Reference in new issue
Block a user