mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-10 21:32:18 +00:00
chore(style): repo-wide prettier sweep before v1.4.6 tag
Long-overdue prettier sweep; prettier had drifted vs. checked-in code across ~130 files (mostly long-argument line-break wrapping in TS and table-padding in markdown). Pure formatting — no semantic changes — and required to clear the v1.4.6 release gate's `pnpm format:check`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
67575180b8
commit
02b99553b9
135 files changed
+2159
-1583
No files matched your search
@@ -127,6 +127,10 @@ export function AboutSection() {
|
||||
// Auto-check on mount when the last successful check is older than the
|
||||
// refresh interval (or has never run). Keeps the UI populated without
|
||||
// requiring a click — but won't spam GitHub on every navigation.
|
||||
// The setState inside runCheck() is intentional: the check is the
|
||||
// whole point of the effect, and the staleness gate prevents a
|
||||
// cascading-render loop because the timestamp resets after the run.
|
||||
/* eslint-disable react-hooks/exhaustive-deps, react-hooks/set-state-in-effect */
|
||||
useEffect(() => {
|
||||
if (!version) return;
|
||||
const last = readLastCheckedISO();
|
||||
@@ -136,8 +140,8 @@ export function AboutSection() {
|
||||
if (stale) {
|
||||
void runCheck();
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [version?.version]);
|
||||
/* eslint-enable react-hooks/exhaustive-deps, react-hooks/set-state-in-effect */
|
||||
|
||||
return (
|
||||
<section
|
||||
@@ -176,14 +180,14 @@ export function AboutSection() {
|
||||
) : (
|
||||
<dl className="flex flex-wrap items-baseline gap-x-6 gap-y-3 text-sm">
|
||||
<div className="flex items-baseline gap-2">
|
||||
<dt className="text-muted-foreground text-xs uppercase tracking-wide">
|
||||
<dt className="text-muted-foreground text-xs tracking-wide uppercase">
|
||||
{t("settings.about.version")}
|
||||
</dt>
|
||||
<dd className="font-mono font-medium">v{version.version}</dd>
|
||||
</div>
|
||||
|
||||
<div className="flex items-baseline gap-2">
|
||||
<dt className="text-muted-foreground text-xs uppercase tracking-wide">
|
||||
<dt className="text-muted-foreground text-xs tracking-wide uppercase">
|
||||
{t("settings.about.license")}
|
||||
</dt>
|
||||
<dd className="font-mono">{version.license}</dd>
|
||||
@@ -191,7 +195,7 @@ export function AboutSection() {
|
||||
|
||||
{version.buildSha && (
|
||||
<div className="flex items-baseline gap-2">
|
||||
<dt className="text-muted-foreground text-xs uppercase tracking-wide">
|
||||
<dt className="text-muted-foreground text-xs tracking-wide uppercase">
|
||||
{t("settings.about.gitSha")}
|
||||
</dt>
|
||||
<dd className="font-mono">{version.buildSha.slice(0, 7)}</dd>
|
||||
@@ -200,7 +204,7 @@ export function AboutSection() {
|
||||
|
||||
{version.builtAt && (
|
||||
<div className="flex items-baseline gap-2">
|
||||
<dt className="text-muted-foreground text-xs uppercase tracking-wide">
|
||||
<dt className="text-muted-foreground text-xs tracking-wide uppercase">
|
||||
{t("settings.about.builtAt", { time: "" }).trim() ||
|
||||
t("settings.about.gitSha")}
|
||||
</dt>
|
||||
|
||||
@@ -487,7 +487,9 @@ function UserAIProviderSubsection() {
|
||||
queryClient.invalidateQueries({ queryKey: ["insights"] });
|
||||
},
|
||||
onError: (e) => {
|
||||
setSaveMsg(e instanceof Error ? e.message : t("settings.ai.errorGeneric"));
|
||||
setSaveMsg(
|
||||
e instanceof Error ? e.message : t("settings.ai.errorGeneric"),
|
||||
);
|
||||
setSaveOk(false);
|
||||
},
|
||||
});
|
||||
@@ -522,9 +524,7 @@ function UserAIProviderSubsection() {
|
||||
);
|
||||
setTestOk(true);
|
||||
} catch (e) {
|
||||
setTestMsg(
|
||||
e instanceof Error ? e.message : t("settings.ai.testFailed"),
|
||||
);
|
||||
setTestMsg(e instanceof Error ? e.message : t("settings.ai.testFailed"));
|
||||
setTestOk(false);
|
||||
} finally {
|
||||
setTesting(false);
|
||||
@@ -556,11 +556,15 @@ function UserAIProviderSubsection() {
|
||||
className="bg-background border-input mt-1 h-9 w-full rounded-md border px-2 text-sm"
|
||||
>
|
||||
<option value="">{t("settings.ai.providerOptionDefault")}</option>
|
||||
<option value="OPENAI">{t("settings.ai.providerOptionOpenai")}</option>
|
||||
<option value="OPENAI">
|
||||
{t("settings.ai.providerOptionOpenai")}
|
||||
</option>
|
||||
<option value="ANTHROPIC">
|
||||
{t("settings.ai.providerOptionAnthropic")}
|
||||
</option>
|
||||
<option value="LOCAL">{t("settings.ai.providerOptionLocal")}</option>
|
||||
<option value="LOCAL">
|
||||
{t("settings.ai.providerOptionLocal")}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -3,7 +3,12 @@
|
||||
import { useState } from "react";
|
||||
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import { toast } from "sonner";
|
||||
import { SlidersHorizontal, RotateCcw, Loader2, AlertTriangle } from "lucide-react";
|
||||
import {
|
||||
SlidersHorizontal,
|
||||
RotateCcw,
|
||||
Loader2,
|
||||
AlertTriangle,
|
||||
} from "lucide-react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Label } from "@/components/ui/label";
|
||||
@@ -91,7 +96,9 @@ export function ThresholdsSection({ id }: { id: string }) {
|
||||
toast.success(t("thresholds.saveSuccess"));
|
||||
},
|
||||
onError: (err) =>
|
||||
toast.error(err instanceof Error ? err.message : t("thresholds.saveError")),
|
||||
toast.error(
|
||||
err instanceof Error ? err.message : t("thresholds.saveError"),
|
||||
),
|
||||
});
|
||||
|
||||
const resetMutation = useMutation({
|
||||
@@ -114,7 +121,7 @@ export function ThresholdsSection({ id }: { id: string }) {
|
||||
return (
|
||||
<div
|
||||
id={id}
|
||||
className="bg-card border-border scroll-mt-28 rounded-xl border p-6 space-y-5"
|
||||
className="bg-card border-border scroll-mt-28 space-y-5 rounded-xl border p-6"
|
||||
>
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="flex items-center gap-2">
|
||||
@@ -138,7 +145,7 @@ export function ThresholdsSection({ id }: { id: string }) {
|
||||
</p>
|
||||
|
||||
{isLoading || !data ? (
|
||||
<div className="flex items-center gap-2 text-sm text-muted-foreground">
|
||||
<div className="text-muted-foreground flex items-center gap-2 text-sm">
|
||||
<Loader2 className="h-4 w-4 animate-spin" />
|
||||
{t("common.loading")}
|
||||
</div>
|
||||
@@ -202,7 +209,7 @@ function MetricRow({
|
||||
const defaultRange = effective?.default;
|
||||
|
||||
return (
|
||||
<div className="rounded-lg border border-border p-4 space-y-3">
|
||||
<div className="border-border space-y-3 rounded-lg border p-4">
|
||||
<div className="flex items-center justify-between gap-3">
|
||||
<div className="min-w-0">
|
||||
<p className="text-sm font-medium">{t(METRIC_LABEL_KEYS[metric])}</p>
|
||||
@@ -212,7 +219,7 @@ function MetricRow({
|
||||
: t("thresholds.unsetExplanation")}
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex items-center gap-2 shrink-0">
|
||||
<div className="flex shrink-0 items-center gap-2">
|
||||
<Label htmlFor={`override-${metric}`} className="text-xs">
|
||||
{overrideMode
|
||||
? t("thresholds.overrideModeLabel")
|
||||
@@ -300,8 +307,8 @@ function MetricRow({
|
||||
defaultRange &&
|
||||
(override!.min < defaultRange.greenMin * 0.7 ||
|
||||
override!.max > defaultRange.greenMax * 1.3) && (
|
||||
<div className="flex items-start gap-2 rounded-md border-l-2 border-dracula-orange/50 bg-dracula-orange/5 p-2 text-xs">
|
||||
<AlertTriangle className="mt-0.5 h-3 w-3 shrink-0 text-dracula-orange" />
|
||||
<div className="border-dracula-orange/50 bg-dracula-orange/5 flex items-start gap-2 rounded-md border-l-2 p-2 text-xs">
|
||||
<AlertTriangle className="text-dracula-orange mt-0.5 h-3 w-3 shrink-0" />
|
||||
<span>{t("thresholds.overrideWarning")}</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user