From bbdc3fbd00677c5e30c4051a4a36e7e6af558753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 10 May 2026 22:30:53 +0200 Subject: [PATCH] style: prettier on W5 reconcile touchpoints Co-Authored-By: Claude Opus 4.7 (1M context) --- .../proxy-onboarding-redirect.test.ts | 4 +--- src/app/api/insights/chat/route.ts | 4 +--- .../api-token-overview-responsive.test.tsx | 4 +--- src/components/charts/trend-card.tsx | 20 ++++--------------- .../__tests__/message-thread.test.tsx | 15 +++++++++++--- .../insights/coach-panel/message-thread.tsx | 2 +- .../coach/__tests__/keyvalues-parse.test.ts | 9 ++++----- .../ai/coach/__tests__/system-prompt.test.ts | 8 ++++++-- tests/integration/auth-flow.test.ts | 5 ++--- 9 files changed, 32 insertions(+), 39 deletions(-) diff --git a/src/__tests__/proxy-onboarding-redirect.test.ts b/src/__tests__/proxy-onboarding-redirect.test.ts index 3e7a61dc4..412e40a37 100644 --- a/src/__tests__/proxy-onboarding-redirect.test.ts +++ b/src/__tests__/proxy-onboarding-redirect.test.ts @@ -70,9 +70,7 @@ describe("proxy.ts onboarding redirect (v1.4.22 C4)", () => { }); it("does NOT redirect from /auth/login", () => { - const res = proxy( - makeRequest("/auth/login", { hl_onboarding: "pending" }), - ); + const res = proxy(makeRequest("/auth/login", { hl_onboarding: "pending" })); expect(res.status).toBe(200); expect(res.headers.get("location")).toBeNull(); }); diff --git a/src/app/api/insights/chat/route.ts b/src/app/api/insights/chat/route.ts index 64a59e068..e0c5d1693 100644 --- a/src/app/api/insights/chat/route.ts +++ b/src/app/api/insights/chat/route.ts @@ -408,9 +408,7 @@ async function streamRefusal(args: { }); const stream = createSseStream((controller) => { - controller.enqueue( - encodeFrame({ type: "token", token: args.refusalText }), - ); + controller.enqueue(encodeFrame({ type: "token", token: args.refusalText })); controller.enqueue( encodeFrame({ type: "done", diff --git a/src/components/admin/__tests__/api-token-overview-responsive.test.tsx b/src/components/admin/__tests__/api-token-overview-responsive.test.tsx index 5ad1f4558..69aa06562 100644 --- a/src/components/admin/__tests__/api-token-overview-responsive.test.tsx +++ b/src/components/admin/__tests__/api-token-overview-responsive.test.tsx @@ -141,9 +141,7 @@ describe("ApiTokenOverviewSection — responsive", () => { // two date columns (text-right + text-xs is unique to those cells) // and assert none carries whitespace-nowrap. const dateCellMatches = - tableMarkup.match( - /]*\btext-right\b[^>]*\btext-xs\b[^>]*>/g, - ) ?? []; + tableMarkup.match(/]*\btext-right\b[^>]*\btext-xs\b[^>]*>/g) ?? []; expect(dateCellMatches.length).toBeGreaterThanOrEqual(2); for (const cell of dateCellMatches) { expect(cell).not.toContain("whitespace-nowrap"); diff --git a/src/components/charts/trend-card.tsx b/src/components/charts/trend-card.tsx index ea67d6f50..d5283a1f8 100644 --- a/src/components/charts/trend-card.tsx +++ b/src/components/charts/trend-card.tsx @@ -242,10 +242,7 @@ export function TrendCard({ full layout returns at `>=sm`. */} {compareBaseline !== "none" && compareDelta != null && (
+ {t(avgAllTimeLabelKey)}:{" "} {avgAllTime !== null ? formatValue(avgAllTime) : "—"} @@ -360,10 +351,7 @@ export function TrendCard({ {t(avgAllTimeLabelKey)}:{" "} {avgAllTime !== null ? formatValue(avgAllTime) : "—"} diff --git a/src/components/insights/coach-panel/__tests__/message-thread.test.tsx b/src/components/insights/coach-panel/__tests__/message-thread.test.tsx index 9bad6d1b3..d3d062fde 100644 --- a/src/components/insights/coach-panel/__tests__/message-thread.test.tsx +++ b/src/components/insights/coach-panel/__tests__/message-thread.test.tsx @@ -21,7 +21,12 @@ const useAuthMock = vi.fn< isLoading: boolean; } >(() => ({ - user: { id: "test-user", username: "tester", role: "USER", gravatarUrl: null }, + user: { + id: "test-user", + username: "tester", + role: "USER", + gravatarUrl: null, + }, isAuthenticated: true, isLoading: false, })); @@ -335,7 +340,9 @@ describe("", () => { const html = render(); expect(html).toContain("30-day adherence"); // No stray empty unit/window markup. - expect(html).not.toMatch(/30-day adherence:\s*<\/span>\s*]*>\s*\s*]*>\s* { @@ -365,7 +372,9 @@ describe("", () => { expect(html).toMatch( /]+src="https:\/\/www\.gravatar\.com\/avatar\/abc123/, ); - expect(html).toMatch(/data-slot="coach-bubble-user-avatar"[^>]*class="[^"]*size-8/); + expect(html).toMatch( + /data-slot="coach-bubble-user-avatar"[^>]*class="[^"]*size-8/, + ); }); it("falls back to initials when no Gravatar URL is present", () => { diff --git a/src/components/insights/coach-panel/message-thread.tsx b/src/components/insights/coach-panel/message-thread.tsx index e003ddfa2..23ec4c227 100644 --- a/src/components/insights/coach-panel/message-thread.tsx +++ b/src/components/insights/coach-panel/message-thread.tsx @@ -316,7 +316,7 @@ function ChatBubble({ className={cn( "text-muted-foreground hover:text-foreground flex cursor-pointer", "items-center gap-1.5 leading-relaxed", - "[&::-webkit-details-marker]:hidden marker:hidden", + "marker:hidden [&::-webkit-details-marker]:hidden", "focus-visible:ring-ring/50 rounded outline-none focus-visible:ring-2", )} > diff --git a/src/lib/ai/coach/__tests__/keyvalues-parse.test.ts b/src/lib/ai/coach/__tests__/keyvalues-parse.test.ts index 977094827..41f27f7a5 100644 --- a/src/lib/ai/coach/__tests__/keyvalues-parse.test.ts +++ b/src/lib/ai/coach/__tests__/keyvalues-parse.test.ts @@ -1,16 +1,15 @@ import { describe, expect, it } from "vitest"; -import { - parseKeyValueLine, - parseKeyValuesSentinel, -} from "../keyvalues"; +import { parseKeyValueLine, parseKeyValuesSentinel } from "../keyvalues"; /** * v1.4.22 Wave 3 B1+B2 — Coach evidence-block sentinel parser. */ describe("parseKeyValueLine", () => { it("parses a full line with unit + window", () => { - expect(parseKeyValueLine("avg30 systolic: 138 [mmHg] (last30days)")).toEqual({ + expect( + parseKeyValueLine("avg30 systolic: 138 [mmHg] (last30days)"), + ).toEqual({ label: "avg30 systolic", value: "138", unit: "mmHg", diff --git a/src/lib/ai/coach/__tests__/system-prompt.test.ts b/src/lib/ai/coach/__tests__/system-prompt.test.ts index 31c87e949..5d1d96c7c 100644 --- a/src/lib/ai/coach/__tests__/system-prompt.test.ts +++ b/src/lib/ai/coach/__tests__/system-prompt.test.ts @@ -39,7 +39,9 @@ describe("getCoachSystemPrompt — EN", () => { expect(prompt).toMatch(/GROUND RULES/); expect(prompt).toMatch(/1\. Prose-first\./); expect(prompt).toMatch(/2\. Values belong in the evidence block\./); - expect(prompt).toMatch(/3\. Missing data is an invitation, not a refusal\./); + expect(prompt).toMatch( + /3\. Missing data is an invitation, not a refusal\./, + ); expect(prompt).toMatch(/4\. Conservative phrasing\./); expect(prompt).toMatch(/5\. Motivational-interviewing micro-moves\./); expect(prompt).toMatch(/6\. Redirect off-topic input gracefully\./); @@ -104,7 +106,9 @@ describe("getCoachSystemPrompt — DE", () => { expect(prompt).toMatch(/2\. Werte gehören in den Evidenz-Block\./); expect(prompt).toMatch(/3\. Fehlende Daten sind eine Einladung/); expect(prompt).toMatch(/4\. Zurückhaltende Sprache\./); - expect(prompt).toMatch(/5\. Mikro-Moves aus dem Motivational Interviewing\./); + expect(prompt).toMatch( + /5\. Mikro-Moves aus dem Motivational Interviewing\./, + ); expect(prompt).toMatch(/6\. Off-topic-Eingaben elegant umlenken\./); expect(prompt).toMatch(/7\. Verankere jede Zahl im SNAPSHOT\./); }); diff --git a/tests/integration/auth-flow.test.ts b/tests/integration/auth-flow.test.ts index cd18fdf4c..5f269a6d9 100644 --- a/tests/integration/auth-flow.test.ts +++ b/tests/integration/auth-flow.test.ts @@ -133,9 +133,8 @@ describe("session lifecycle (real Postgres)", () => { }); it("destroySession clears the hl_onboarding cookie alongside the session cookie", async () => { - const { createSession, destroySession } = await import( - "@/lib/auth/session" - ); + const { createSession, destroySession } = + await import("@/lib/auth/session"); const user = await getPrismaClient().user.create({ data: { username: "dest", email: "dest@example.test" }, });