mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-19 08:12:52 +00:00
style: apply prettier across the tree
One-shot prettier pass so the new format:check gate starts from a clean baseline. Formatting only — no behaviour change. Generator-owned and vendored artifacts stay untouched via .prettierignore.
This commit is contained in:
1 parent
b3fea2ef59
commit
1f4ba5939d
1000 files changed
+12130
-8385
No files matched your search
@@ -48,7 +48,11 @@ const BESPOKE_PAGES: ReadonlyArray<{
|
||||
}> = [
|
||||
{ slug: "weight", assessmentTag: "<SlugInsightStatusCard" },
|
||||
{ slug: "bmi", assessmentTag: "<SlugInsightStatusCard" },
|
||||
{ slug: "pulse", assessmentTag: "<SlugInsightStatusCard", assessmentMayTrail: true },
|
||||
{
|
||||
slug: "pulse",
|
||||
assessmentTag: "<SlugInsightStatusCard",
|
||||
assessmentMayTrail: true,
|
||||
},
|
||||
{ slug: "blood-pressure", assessmentTag: "<SlugInsightStatusCard" },
|
||||
{ slug: "mood", assessmentTag: "<SlugInsightStatusCard" },
|
||||
{ slug: "medications", assessmentTag: "<InsightStatusCard" },
|
||||
@@ -57,10 +61,7 @@ const BESPOKE_PAGES: ReadonlyArray<{
|
||||
describe("bespoke metric-detail spine — assessment is the last block", () => {
|
||||
for (const { slug, assessmentTag, assessmentMayTrail } of BESPOKE_PAGES) {
|
||||
it(`renders the assessment card as the last SubPageShell child on /insights/${slug}`, () => {
|
||||
const source = readFileSync(
|
||||
join(PAGES_DIR, slug, "page.tsx"),
|
||||
"utf8",
|
||||
);
|
||||
const source = readFileSync(join(PAGES_DIR, slug, "page.tsx"), "utf8");
|
||||
|
||||
// The render branch that carries the assessment is the final
|
||||
// `<SubPageShell>…</SubPageShell>` in the module (the empty-state
|
||||
@@ -70,7 +71,9 @@ describe("bespoke metric-detail spine — assessment is the last block", () => {
|
||||
-1,
|
||||
);
|
||||
const shellOpen = source.lastIndexOf("<SubPageShell", shellClose);
|
||||
expect(shellOpen, `${slug}: no opening <SubPageShell`).toBeGreaterThan(-1);
|
||||
expect(shellOpen, `${slug}: no opening <SubPageShell`).toBeGreaterThan(
|
||||
-1,
|
||||
);
|
||||
|
||||
const body = source.slice(shellOpen, shellClose);
|
||||
|
||||
|
||||
@@ -135,7 +135,11 @@ function collectSites(): { sites: PropSite[]; dynamic: PropSite[] } {
|
||||
function hasLeaf(obj: unknown, dotted: string): boolean {
|
||||
let cur: unknown = obj;
|
||||
for (const part of dotted.split(".")) {
|
||||
if (cur && typeof cur === "object" && part in (cur as Record<string, unknown>)) {
|
||||
if (
|
||||
cur &&
|
||||
typeof cur === "object" &&
|
||||
part in (cur as Record<string, unknown>)
|
||||
) {
|
||||
cur = (cur as Record<string, unknown>)[part];
|
||||
} else {
|
||||
return false;
|
||||
|
||||
@@ -95,9 +95,7 @@ export default function InsightsBmiPage() {
|
||||
</Button>
|
||||
}
|
||||
/>
|
||||
<CoachLaunchButton
|
||||
prefill="I haven't set my height yet — why does BMI matter, and what should I know before I configure it?"
|
||||
/>
|
||||
<CoachLaunchButton prefill="I haven't set my height yet — why does BMI matter, and what should I know before I configure it?" />
|
||||
</SubPageShell>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -108,7 +108,10 @@ export default function InsightsMedikamentePage() {
|
||||
MED_STATUS_TIMEOUT_MS,
|
||||
);
|
||||
try {
|
||||
return apiGet<MedicationComplianceStatusData>(`/api/insights/medication-compliance-status?locale=${locale}`, { signal: controller.signal });
|
||||
return apiGet<MedicationComplianceStatusData>(
|
||||
`/api/insights/medication-compliance-status?locale=${locale}`,
|
||||
{ signal: controller.signal },
|
||||
);
|
||||
} finally {
|
||||
clearTimeout(timeoutHandle);
|
||||
}
|
||||
@@ -170,9 +173,7 @@ export default function InsightsMedikamentePage() {
|
||||
</Button>
|
||||
}
|
||||
/>
|
||||
<CoachLaunchButton
|
||||
prefill="I haven't added any medications yet — what should I know before I start tracking medication compliance here?"
|
||||
/>
|
||||
<CoachLaunchButton prefill="I haven't added any medications yet — what should I know before I start tracking medication compliance here?" />
|
||||
</SubPageShell>
|
||||
);
|
||||
}
|
||||
@@ -217,7 +218,10 @@ export default function InsightsMedikamentePage() {
|
||||
<span aria-hidden="true">·</span>
|
||||
<span>{categoryLabel}</span>
|
||||
{med.streak > 0 ? (
|
||||
<Badge variant="outline" className="ml-auto shrink-0 text-xs">
|
||||
<Badge
|
||||
variant="outline"
|
||||
className="ml-auto shrink-0 text-xs"
|
||||
>
|
||||
{med.streak === 1
|
||||
? t("insights.dayStreakOne", { count: med.streak })
|
||||
: t("insights.dayStreak", { count: med.streak })}
|
||||
|
||||
@@ -165,7 +165,10 @@ export default function InsightsPulsPage() {
|
||||
{/* v1.12.8 — the Einschätzung (assessment) sits ABOVE the cardio-fitness
|
||||
CTA so the plain-language read of the pulse data leads, and the
|
||||
cross-link to the dedicated VO₂ max page trails it. */}
|
||||
<SlugInsightStatusCard slug="pulse" icon={<Heart className="h-5 w-5" />} />
|
||||
<SlugInsightStatusCard
|
||||
slug="pulse"
|
||||
icon={<Heart className="h-5 w-5" />}
|
||||
/>
|
||||
|
||||
{/* VO₂ max is a cardio-fitness metric (Apple's Health app surfaces it
|
||||
under "Heart"), so the pulse page links across to its dedicated
|
||||
@@ -182,7 +185,10 @@ export default function InsightsPulsPage() {
|
||||
data-slot="vo2-cardio-link"
|
||||
className="bg-card hover:bg-accent/40 focus-visible:ring-ring/50 block space-y-1.5 rounded-xl border p-4 transition-colors focus-visible:ring-2 focus-visible:outline-none"
|
||||
>
|
||||
<TileHeader icon={Gauge} title={t("insights.vo2Max.cardioLinkTitle")} />
|
||||
<TileHeader
|
||||
icon={Gauge}
|
||||
title={t("insights.vo2Max.cardioLinkTitle")}
|
||||
/>
|
||||
<span className="text-muted-foreground block text-xs leading-snug">
|
||||
{t("insights.vo2Max.cardioLinkBody")}
|
||||
</span>
|
||||
|
||||
@@ -19,7 +19,10 @@ describe("sleep empty-state CTA href", () => {
|
||||
"utf8",
|
||||
);
|
||||
const match = source.match(/href="\/settings\/([a-z-]+)"/);
|
||||
expect(match, "expected a /settings/<slug> href in the sleep page").not.toBeNull();
|
||||
expect(
|
||||
match,
|
||||
"expected a /settings/<slug> href in the sleep page",
|
||||
).not.toBeNull();
|
||||
const slug = match![1];
|
||||
expect(slug).toBe("integrations");
|
||||
expect(isSettingsSectionSlug(slug)).toBe(true);
|
||||
|
||||
@@ -125,7 +125,10 @@ export default function InsightsGewichtPage() {
|
||||
off the overview onto its metric page). */}
|
||||
<MetricCorrelationCard slug="weight" />
|
||||
|
||||
<SlugInsightStatusCard slug="weight" icon={<Scale className="h-5 w-5" />} />
|
||||
<SlugInsightStatusCard
|
||||
slug="weight"
|
||||
icon={<Scale className="h-5 w-5" />}
|
||||
/>
|
||||
</SubPageShell>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user