chore: reconcile the catalogue and metric-unit guards

The widget catalogue grew to 42 ids, so the snapshot round-trip count
follows. The mood card's unit key carries "/5" rather than an empty
string — the locale-integrity guard forbids empty values, and the scale
is the honest thing to print next to a 1-to-5 score. It joins the
identical-across-locales allowlist alongside the other unit notations.
This commit is contained in:
Marc-André Bombeck committed 2026-07-19 12:44:23 +02:00
1 parent 4c3cc84daf
commit 30954901ac
9 files changed
+10 -11

No files matched your search

+1 -1
View File
@@ -440,7 +440,7 @@
"totalBodyWater": "kg",
"boneMass": "kg",
"oxygenSaturation": "%",
"mood": "",
"mood": "/5",
"bmi": "kg/m²"
}
}
+1 -1
View File
@@ -440,7 +440,7 @@
"totalBodyWater": "kg",
"boneMass": "kg",
"oxygenSaturation": "%",
"mood": "",
"mood": "/5",
"bmi": "kg/m²"
}
}
+1 -1
View File
@@ -440,7 +440,7 @@
"totalBodyWater": "kg",
"boneMass": "kg",
"oxygenSaturation": "%",
"mood": "",
"mood": "/5",
"bmi": "kg/m²"
}
}
+1 -1
View File
@@ -440,7 +440,7 @@
"totalBodyWater": "kg",
"boneMass": "kg",
"oxygenSaturation": "%",
"mood": "",
"mood": "/5",
"bmi": "kg/m²"
}
}
+1 -1
View File
@@ -440,7 +440,7 @@
"totalBodyWater": "kg",
"boneMass": "kg",
"oxygenSaturation": "%",
"mood": "",
"mood": "/5",
"bmi": "kg/m²"
}
}
+1 -1
View File
@@ -440,7 +440,7 @@
"totalBodyWater": "kg",
"boneMass": "kg",
"oxygenSaturation": "%",
"mood": "",
"mood": "/5",
"bmi": "kg/m²"
}
}
@@ -82,6 +82,7 @@ const LEGIT_IDENTICAL = new Set<string>([
"charts.vo2Max",
"cycle.insights.crosstab.unitGlucose",
"dashboard.metric.unit.bmi",
"dashboard.metric.unit.mood",
"dashboard.metric.unit.glucose",
"dashboard.vo2Max",
"dashboard.vo2MaxShort",
-2
View File
@@ -605,8 +605,6 @@ export const LAYOUT_FIELD_MERGE_DISPOSITION = {
heroRingOrder: "preserve",
} as const satisfies Record<keyof DashboardLayout, "replace" | "preserve">;
export type LayoutFieldMergeDisposition = typeof LAYOUT_FIELD_MERGE_DISPOSITION;
/**
* The top-level layout fields the widgets PUT carries forward from the stored
* layout when the request omits them. Derived from
+3 -3
View File
@@ -752,11 +752,11 @@ describe("buildDashboardSnapshot — layoutCatalogue (35-id round-trip)", () =>
isFullyCovered.mockReturnValue(false);
});
it("emits all 38 catalogue ids with visibility + order", async () => {
it("emits all 42 catalogue ids with visibility + order", async () => {
const snap = await buildDashboardSnapshot(fakePrisma, baseUser());
expect(snap.layoutCatalogue).toHaveLength(38);
expect(snap.layoutCatalogue).toHaveLength(42);
const ids = new Set(snap.layoutCatalogue.map((w) => w.id));
expect(ids.size).toBe(38);
expect(ids.size).toBe(42);
// iOS-only ids appended default-invisible.
const walkingSpeed = snap.layoutCatalogue.find(
(w) => w.id === "walkingSpeed",