feat(settings): a time-format preference and one home for insight pills

The clock format followed the UI language with no way out — an English
interface forced AM/PM everywhere. A new profile preference (automatic,
24-hour, 12-hour) feeds every formatter through the shared locale
context, persists on the user row and rides the profile endpoints. The
insight pill list in settings gains the same eye toggle the overview
tiles have, so ordering and visibility live in one place; the page-side
'manage detail pages' block folds into a link there. Includes the
locale bundles for both features and the regenerated API contract.
This commit is contained in:
Marc-André Bombeck committed 2026-06-10 13:34:46 +02:00
1 parent 3cf48fa0f1
commit aabc7915cb
28 files changed
+1137 -462

No files matched your search

@@ -0,0 +1,38 @@
/**
* v1.15.20 — pins the shared schedule select for compliance call sites.
*
* Every surface that loads schedules for a compliance computation routes
* through `SCHEDULE_COMPLIANCE_SELECT`. The constant must keep selecting
* every field the engine consumes — most importantly `doseWindows`, whose
* absence silently degrades a user-configured on-time band back to the
* symmetric default on that surface (the v1.15.20 audit gap: only 2 of 8
* call sites selected it).
*/
import { describe, expect, it } from "vitest";
import { SCHEDULE_COMPLIANCE_SELECT } from "../compliance";
describe("SCHEDULE_COMPLIANCE_SELECT", () => {
it("selects every schedule field the compliance engine consumes", () => {
expect(SCHEDULE_COMPLIANCE_SELECT).toEqual({
id: true,
windowStart: true,
windowEnd: true,
daysOfWeek: true,
timesOfDay: true,
reminderGraceMinutes: true,
rrule: true,
rollingIntervalDays: true,
scheduleType: true,
cyclicOnWeeks: true,
cyclicOffWeeks: true,
doseWindows: true,
});
});
it("keeps the configured per-dose windows on the wire", () => {
// The one field whose loss is silent: the engine falls back to the
// ±1 h default and every number still "looks" right.
expect(SCHEDULE_COMPLIANCE_SELECT.doseWindows).toBe(true);
});
});