diff --git a/src/app/api/dashboard/widgets/route.ts b/src/app/api/dashboard/widgets/route.ts index 341787b3a..5ab6e51d7 100644 --- a/src/app/api/dashboard/widgets/route.ts +++ b/src/app/api/dashboard/widgets/route.ts @@ -70,10 +70,11 @@ const layoutSchema = z.object({ }), ) .min(1) - // v1.7.0 W1 — raised from 20 to 30 so the full 27-id catalogue PUT - // (web 16 + iOS-only 11) fits with headroom; the enum still bounds - // each id to one of the 27. - .max(30), + // v1.11.2 B5 — raised to 40 so the full catalogue PUT (24 writable + + // 11 iOS-only = 35) fits with headroom after the v1.10 additive + // HealthKit signals became pinnable; the enum still bounds each id to + // one of the catalogue ids. + .max(40), // v1.4.16 phase B8 — comparison baseline (Vormonat / Vorjahr) rides // on the layout blob per research §7 Q3 (no Prisma migration). Optional // so v1.4.15 clients that don't know the field can still PUT. diff --git a/src/components/settings/coach-memory-section.tsx b/src/components/settings/coach-memory-section.tsx index 2d52f59f5..81f7a2f1a 100644 --- a/src/components/settings/coach-memory-section.tsx +++ b/src/components/settings/coach-memory-section.tsx @@ -172,7 +172,10 @@ export function CoachMemorySection({ disabled={!isAuthenticated || forgetAll.isPending} > {forgetAll.isPending ? ( - + ) : ( )} diff --git a/src/lib/dashboard/__tests__/snapshot.test.ts b/src/lib/dashboard/__tests__/snapshot.test.ts index a99a5e65b..ff331f27f 100644 --- a/src/lib/dashboard/__tests__/snapshot.test.ts +++ b/src/lib/dashboard/__tests__/snapshot.test.ts @@ -364,17 +364,17 @@ describe("buildDashboardSnapshot — metricStates (iOS cold-launch seed)", () => }); }); -describe("buildDashboardSnapshot — layoutCatalogue (27-id round-trip)", () => { +describe("buildDashboardSnapshot — layoutCatalogue (35-id round-trip)", () => { beforeEach(() => { probeRollupCoverage.mockResolvedValue(new Map()); isFullyCovered.mockReturnValue(false); }); - it("emits all 27 catalogue ids with visibility + order", async () => { + it("emits all 35 catalogue ids with visibility + order", async () => { const snap = await buildDashboardSnapshot(fakePrisma, baseUser()); - expect(snap.layoutCatalogue).toHaveLength(27); + expect(snap.layoutCatalogue).toHaveLength(35); const ids = new Set(snap.layoutCatalogue.map((w) => w.id)); - expect(ids.size).toBe(27); + expect(ids.size).toBe(35); // iOS-only ids appended default-invisible. const hrv = snap.layoutCatalogue.find((w) => w.id === "hrv"); expect(hrv).toBeDefined(); @@ -436,11 +436,11 @@ describe("buildDashboardSnapshot — additive proof", () => { expect(snap).toHaveProperty("layoutCatalogue"); // The web-consumed `layout` block is the resolved per-user layout — - // NOT replaced by the 27-id catalogue. + // NOT replaced by the 35-id catalogue. expect(snap.layout).toHaveProperty("version"); expect(Array.isArray(snap.layout.widgets)).toBe(true); // Resolved layout still carries only server-known widget ids. - expect(snap.layout.widgets.length).toBeLessThanOrEqual(16); + expect(snap.layout.widgets.length).toBeLessThanOrEqual(24); // tiles shape unchanged. expect(snap.tiles).toHaveProperty("summaries"); diff --git a/src/lib/insights/__tests__/graded-series-rollups.test.ts b/src/lib/insights/__tests__/graded-series-rollups.test.ts index 37009d705..ced555190 100644 --- a/src/lib/insights/__tests__/graded-series-rollups.test.ts +++ b/src/lib/insights/__tests__/graded-series-rollups.test.ts @@ -6,6 +6,9 @@ vi.mock("@/lib/db", () => ({ measurement: { findMany: (...args: unknown[]) => findMany(...args), }, + // loadUserSourcePriority lazy-loads the source-priority blob; null + // (default findUnique) falls back to the default ladders. + user: { findUnique: vi.fn() }, }, }));