mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-14 14:40: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
@@ -17,11 +17,7 @@ import { resolve } from "node:path";
|
||||
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
const AUTH_SHELL_PATH = resolve(
|
||||
__dirname,
|
||||
"..",
|
||||
"auth-shell.tsx",
|
||||
);
|
||||
const AUTH_SHELL_PATH = resolve(__dirname, "..", "auth-shell.tsx");
|
||||
const INSIGHTS_LAYOUT_PATH = resolve(
|
||||
__dirname,
|
||||
"..",
|
||||
@@ -35,9 +31,7 @@ const INSIGHTS_LAYOUT_PATH = resolve(
|
||||
describe("v1.4.34 IW-B — CoachLaunchProvider hoist", () => {
|
||||
it("imports the CoachLaunchProvider in the auth-shell", () => {
|
||||
const source = readFileSync(AUTH_SHELL_PATH, "utf8");
|
||||
expect(source).toContain(
|
||||
'from "@/lib/insights/coach-launch-context"',
|
||||
);
|
||||
expect(source).toContain('from "@/lib/insights/coach-launch-context"');
|
||||
expect(source).toContain("CoachLaunchProvider");
|
||||
});
|
||||
|
||||
@@ -62,9 +56,7 @@ describe("v1.4.34 IW-B — CoachLaunchProvider hoist", () => {
|
||||
it("no longer mounts any Coach surface in the routed insights layout", () => {
|
||||
const source = readFileSync(INSIGHTS_LAYOUT_PATH, "utf8");
|
||||
// The provider import drops; the drawer mount lives on the shell.
|
||||
expect(source).not.toContain(
|
||||
'from "@/lib/insights/coach-launch-context"',
|
||||
);
|
||||
expect(source).not.toContain('from "@/lib/insights/coach-launch-context"');
|
||||
expect(source).not.toContain("import { LayoutCoachMount }");
|
||||
// v1.16.8 — the FAB moved to the shell too; the routed layout must
|
||||
// not double-mount it. (The docblock may still narrate the move, so
|
||||
|
||||
@@ -35,12 +35,8 @@ describe("nav-model destination list", () => {
|
||||
it("orders the core spine: dashboard → measurements → mood → medications", () => {
|
||||
const hrefs = NAV_DESTINATIONS.map((d) => d.href);
|
||||
expect(hrefs.indexOf("/")).toBeLessThan(hrefs.indexOf("/measurements"));
|
||||
expect(hrefs.indexOf("/measurements")).toBeLessThan(
|
||||
hrefs.indexOf("/mood"),
|
||||
);
|
||||
expect(hrefs.indexOf("/mood")).toBeLessThan(
|
||||
hrefs.indexOf("/medications"),
|
||||
);
|
||||
expect(hrefs.indexOf("/measurements")).toBeLessThan(hrefs.indexOf("/mood"));
|
||||
expect(hrefs.indexOf("/mood")).toBeLessThan(hrefs.indexOf("/medications"));
|
||||
});
|
||||
|
||||
it("every destination carries an i18n key under the nav namespace", () => {
|
||||
@@ -65,7 +61,6 @@ describe("nav-model destination list", () => {
|
||||
const hrefs = NAV_DESTINATIONS.map((d) => d.href);
|
||||
expect(hrefs).not.toContain("/insights/recovery");
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe("nav-model utility tail (N-1 — one shared list)", () => {
|
||||
@@ -184,9 +179,9 @@ describe("mobileMoreHubDestinations — the F-1 mobile invariant (N-2)", () => {
|
||||
const expectedFeatures = visibleNavDestinations(opts.modules)
|
||||
.map((d) => d.href)
|
||||
.filter((href) => !BOTTOM_NAV_PRIMARY_SLOT_HREFS.includes(href));
|
||||
const expectedTail = visibleUtilityDestinations(
|
||||
opts.bugReportEnabled,
|
||||
).map((d) => d.href);
|
||||
const expectedTail = visibleUtilityDestinations(opts.bugReportEnabled).map(
|
||||
(d) => d.href,
|
||||
);
|
||||
|
||||
expect(hub).toEqual([...expectedFeatures, ...expectedTail]);
|
||||
});
|
||||
|
||||
@@ -257,7 +257,7 @@ export function AuthShell({
|
||||
// wrapper then recentres and the whole column, including the
|
||||
// admin/settings sidebar, shifts a few px sideways on every
|
||||
// toggle. Reserving the gutter holds the layout still.
|
||||
className="flex-1 overflow-y-auto [scrollbar-gutter:stable] pb-[calc(4rem+env(safe-area-inset-bottom,0px))] md:pb-0"
|
||||
className="flex-1 [scrollbar-gutter:stable] overflow-y-auto pb-[calc(4rem+env(safe-area-inset-bottom,0px))] md:pb-0"
|
||||
>
|
||||
{/*
|
||||
v1.4.33 IW9 — container normalised on `max-w-screen-xl`
|
||||
|
||||
@@ -107,7 +107,8 @@ export function BottomNav() {
|
||||
() =>
|
||||
PRIMARY_RIGHT.filter(
|
||||
(item) =>
|
||||
!item.requiresModule || user?.modules?.[item.requiresModule] !== false,
|
||||
!item.requiresModule ||
|
||||
user?.modules?.[item.requiresModule] !== false,
|
||||
),
|
||||
[user?.modules],
|
||||
);
|
||||
@@ -134,7 +135,7 @@ export function BottomNav() {
|
||||
// outer min-h-11 min-w-11 is the actual hit area; the icon
|
||||
// stays visually centered at 20px so the design doesn't shift.
|
||||
className={cn(
|
||||
"relative flex min-h-11 min-w-11 flex-1 items-center justify-center rounded-lg transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:ring-offset-2",
|
||||
"focus-visible:ring-ring/50 relative flex min-h-11 min-w-11 flex-1 items-center justify-center rounded-lg transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",
|
||||
isActive
|
||||
? "text-primary"
|
||||
: "text-muted-foreground hover:text-foreground",
|
||||
@@ -180,7 +181,7 @@ export function BottomNav() {
|
||||
aria-expanded={captureOpen}
|
||||
onClick={() => setCaptureOpen(true)}
|
||||
data-testid="bottom-nav-capture"
|
||||
className="bg-primary text-primary-foreground hover:bg-primary/90 focus-visible:ring-ring/70 ring-card -mt-5 flex h-14 w-14 items-center justify-center rounded-full shadow-lg ring-4 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2"
|
||||
className="bg-primary text-primary-foreground hover:bg-primary/90 focus-visible:ring-ring/70 ring-card -mt-5 flex h-14 w-14 items-center justify-center rounded-full shadow-lg ring-4 transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none"
|
||||
>
|
||||
<Plus className="h-7 w-7" />
|
||||
</button>
|
||||
@@ -196,7 +197,7 @@ export function BottomNav() {
|
||||
aria-current={moreActive ? "page" : undefined}
|
||||
onClick={() => setMoreOpen(true)}
|
||||
className={cn(
|
||||
"relative flex min-h-11 min-w-11 flex-1 items-center justify-center rounded-lg transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:ring-offset-2",
|
||||
"focus-visible:ring-ring/50 relative flex min-h-11 min-w-11 flex-1 items-center justify-center rounded-lg transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",
|
||||
moreActive
|
||||
? "text-primary"
|
||||
: "text-muted-foreground hover:text-foreground",
|
||||
@@ -254,7 +255,7 @@ export function BottomNav() {
|
||||
lets the flex child shrink below its content width,
|
||||
`break-words` introduces a break inside the long word, and
|
||||
the auto-height tile (`min-h-14`) absorbs the second line. */}
|
||||
<span className="min-w-0 break-words text-sm font-medium leading-tight">
|
||||
<span className="min-w-0 text-sm leading-tight font-medium break-words">
|
||||
{t(item.tKey)}
|
||||
</span>
|
||||
</Link>
|
||||
|
||||
@@ -98,14 +98,17 @@ export function CapturePicker({ open, onOpenChange }: CapturePickerProps) {
|
||||
title={t("nav.capture.title")}
|
||||
description={t("nav.capture.description")}
|
||||
>
|
||||
<div className="grid grid-cols-1 gap-2" data-testid="capture-picker-options">
|
||||
<div
|
||||
className="grid grid-cols-1 gap-2"
|
||||
data-testid="capture-picker-options"
|
||||
>
|
||||
{options.map((opt) => (
|
||||
<button
|
||||
key={opt.kind}
|
||||
type="button"
|
||||
data-testid={`capture-picker-${opt.kind}`}
|
||||
onClick={() => chooseKind(opt.kind)}
|
||||
className="border-border hover:bg-accent/40 focus-visible:ring-ring/50 flex min-h-14 items-center gap-3 rounded-lg border px-4 py-3 text-left transition-colors focus-visible:outline-none focus-visible:ring-2"
|
||||
className="border-border hover:bg-accent/40 focus-visible:ring-ring/50 flex min-h-14 items-center gap-3 rounded-lg border px-4 py-3 text-left transition-colors focus-visible:ring-2 focus-visible:outline-none"
|
||||
>
|
||||
<span className="bg-primary/10 text-primary flex h-9 w-9 shrink-0 items-center justify-center rounded-full">
|
||||
<opt.icon className="h-5 w-5" aria-hidden="true" />
|
||||
|
||||
@@ -191,7 +191,12 @@ export interface NavUtilityDestination {
|
||||
}
|
||||
|
||||
export const NAV_UTILITY_DESTINATIONS: ReadonlyArray<NavUtilityDestination> = [
|
||||
{ href: "/bugreport", tKey: "nav.bugreport", icon: Bug, bugReportGated: true },
|
||||
{
|
||||
href: "/bugreport",
|
||||
tKey: "nav.bugreport",
|
||||
icon: Bug,
|
||||
bugReportGated: true,
|
||||
},
|
||||
{ href: "/settings/account", tKey: "nav.settings", icon: Settings },
|
||||
{ href: "/notifications", tKey: "nav.notifications", icon: Bell },
|
||||
];
|
||||
|
||||
@@ -289,12 +289,15 @@ export function SidebarNav() {
|
||||
: pathname === href;
|
||||
}
|
||||
|
||||
function renderUtilityLink(
|
||||
item: { href: string; tKey: string; icon: typeof Settings },
|
||||
) {
|
||||
function renderUtilityLink(item: {
|
||||
href: string;
|
||||
tKey: string;
|
||||
icon: typeof Settings;
|
||||
}) {
|
||||
const Icon = item.icon;
|
||||
const isActive = isUtilityActive(item.href);
|
||||
const tourId = item.href === "/settings/account" ? "nav-settings" : undefined;
|
||||
const tourId =
|
||||
item.href === "/settings/account" ? "nav-settings" : undefined;
|
||||
if (collapsed) {
|
||||
return (
|
||||
<Tooltip key={item.href}>
|
||||
|
||||
Reference in new issue
Block a user