mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-16 23:33:29 +00:00
release: v1.32.0 — hardening and scalability (#580)
* release: prepare v1.32.0 * test: stabilize water capture re-entry
This commit is contained in:
1 parent
b01822be48
commit
62eb431d66
372 files changed
+25178
-8561
No files matched your search
@@ -4,7 +4,7 @@
|
||||
* Anthropic form — API key + model dropdown.
|
||||
* ──────────────────────────────────────────────────────────────── */
|
||||
|
||||
import { useState } from "react";
|
||||
import { useRef, useState, type FormEvent } from "react";
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||
import { Loader2, Save } from "lucide-react";
|
||||
|
||||
@@ -37,6 +37,7 @@ export function AnthropicProviderForm({
|
||||
const [customModel, setCustomModel] = useState("");
|
||||
const [msg, setMsg] = useState<string | null>(null);
|
||||
const [ok, setOk] = useState(false);
|
||||
const submitInFlightRef = useRef(false);
|
||||
|
||||
const seededKey =
|
||||
userProvider != null
|
||||
@@ -85,10 +86,25 @@ export function AnthropicProviderForm({
|
||||
setOk(false);
|
||||
setMsg(e instanceof Error ? e.message : t("settings.ai.errorGeneric"));
|
||||
},
|
||||
onSettled: () => {
|
||||
submitInFlightRef.current = false;
|
||||
},
|
||||
});
|
||||
|
||||
function submit(event: FormEvent<HTMLFormElement>) {
|
||||
event.preventDefault();
|
||||
if (submitInFlightRef.current || saveMutation.isPending) return;
|
||||
submitInFlightRef.current = true;
|
||||
saveMutation.mutate();
|
||||
}
|
||||
|
||||
return (
|
||||
<div data-testid="ai-provider-config-anthropic" className="space-y-4">
|
||||
<form
|
||||
data-testid="ai-provider-config-anthropic"
|
||||
className="space-y-4"
|
||||
onSubmit={submit}
|
||||
noValidate
|
||||
>
|
||||
<div>
|
||||
<Label htmlFor="ai-anthropic-key">
|
||||
{t("settings.ai.anthropicKeyLabel")}
|
||||
@@ -148,9 +164,10 @@ export function AnthropicProviderForm({
|
||||
|
||||
<div>
|
||||
<Button
|
||||
type="submit"
|
||||
size="sm"
|
||||
className="min-h-11 sm:min-h-9"
|
||||
onClick={() => saveMutation.mutate()}
|
||||
aria-busy={saveMutation.isPending || undefined}
|
||||
disabled={saveMutation.isPending}
|
||||
>
|
||||
{saveMutation.isPending ? (
|
||||
@@ -167,6 +184,6 @@ export function AnthropicProviderForm({
|
||||
{msg}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</form>
|
||||
);
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
* Local (OpenAI-compatible) form — base URL + optional key + model.
|
||||
* ──────────────────────────────────────────────────────────────── */
|
||||
|
||||
import { useState } from "react";
|
||||
import { useRef, useState, type FormEvent } from "react";
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||
import { Loader2, Save } from "lucide-react";
|
||||
|
||||
@@ -38,6 +38,7 @@ export function LocalProviderForm({
|
||||
const [customModel, setCustomModel] = useState("");
|
||||
const [msg, setMsg] = useState<string | null>(null);
|
||||
const [ok, setOk] = useState(false);
|
||||
const submitInFlightRef = useRef(false);
|
||||
|
||||
const seededKey =
|
||||
userProvider != null
|
||||
@@ -85,10 +86,25 @@ export function LocalProviderForm({
|
||||
setOk(false);
|
||||
setMsg(e instanceof Error ? e.message : t("settings.ai.errorGeneric"));
|
||||
},
|
||||
onSettled: () => {
|
||||
submitInFlightRef.current = false;
|
||||
},
|
||||
});
|
||||
|
||||
function submit(event: FormEvent<HTMLFormElement>) {
|
||||
event.preventDefault();
|
||||
if (submitInFlightRef.current || saveMutation.isPending) return;
|
||||
submitInFlightRef.current = true;
|
||||
saveMutation.mutate();
|
||||
}
|
||||
|
||||
return (
|
||||
<div data-testid="ai-provider-config-local" className="space-y-4">
|
||||
<form
|
||||
data-testid="ai-provider-config-local"
|
||||
className="space-y-4"
|
||||
onSubmit={submit}
|
||||
noValidate
|
||||
>
|
||||
{/* v1.28.28 (#470) — name the gateway path explicitly. The Local
|
||||
provider is the ONE user-level custom-URL provider, so it is also
|
||||
the documented way to reach LiteLLM / OpenRouter / vLLM and any
|
||||
@@ -156,9 +172,10 @@ export function LocalProviderForm({
|
||||
|
||||
<div>
|
||||
<Button
|
||||
type="submit"
|
||||
size="sm"
|
||||
className="min-h-11 sm:min-h-9"
|
||||
onClick={() => saveMutation.mutate()}
|
||||
aria-busy={saveMutation.isPending || undefined}
|
||||
disabled={saveMutation.isPending}
|
||||
>
|
||||
{saveMutation.isPending ? (
|
||||
@@ -175,6 +192,6 @@ export function LocalProviderForm({
|
||||
{msg}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</form>
|
||||
);
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
* pick is visible to every code path that reads the row.
|
||||
* ──────────────────────────────────────────────────────────────── */
|
||||
|
||||
import { useState } from "react";
|
||||
import { useRef, useState, type FormEvent } from "react";
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||
import { Loader2, Save } from "lucide-react";
|
||||
|
||||
@@ -42,6 +42,7 @@ export function OpenAIProviderForm({
|
||||
const [showAdvanced, setShowAdvanced] = useState(false);
|
||||
const [msg, setMsg] = useState<string | null>(null);
|
||||
const [ok, setOk] = useState(false);
|
||||
const submitInFlightRef = useRef(false);
|
||||
|
||||
const seededKey =
|
||||
userProvider != null
|
||||
@@ -92,10 +93,25 @@ export function OpenAIProviderForm({
|
||||
setOk(false);
|
||||
setMsg(e instanceof Error ? e.message : t("settings.ai.errorGeneric"));
|
||||
},
|
||||
onSettled: () => {
|
||||
submitInFlightRef.current = false;
|
||||
},
|
||||
});
|
||||
|
||||
function submit(event: FormEvent<HTMLFormElement>) {
|
||||
event.preventDefault();
|
||||
if (submitInFlightRef.current || saveMutation.isPending) return;
|
||||
submitInFlightRef.current = true;
|
||||
saveMutation.mutate();
|
||||
}
|
||||
|
||||
return (
|
||||
<div data-testid="ai-provider-config-openai" className="space-y-4">
|
||||
<form
|
||||
data-testid="ai-provider-config-openai"
|
||||
className="space-y-4"
|
||||
onSubmit={submit}
|
||||
noValidate
|
||||
>
|
||||
<div>
|
||||
<Label htmlFor="ai-openai-key">
|
||||
{t("settings.ai.openai.apiKey")}
|
||||
@@ -185,9 +201,10 @@ export function OpenAIProviderForm({
|
||||
|
||||
<div className="flex flex-wrap gap-2">
|
||||
<Button
|
||||
type="submit"
|
||||
size="sm"
|
||||
className="min-h-11 sm:min-h-9"
|
||||
onClick={() => saveMutation.mutate()}
|
||||
aria-busy={saveMutation.isPending || undefined}
|
||||
disabled={saveMutation.isPending}
|
||||
>
|
||||
{saveMutation.isPending ? (
|
||||
@@ -204,6 +221,6 @@ export function OpenAIProviderForm({
|
||||
{msg}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</form>
|
||||
);
|
||||
}
|
||||
@@ -11,7 +11,7 @@
|
||||
* (~120 s, `AI_BUDGETS.comprehensive.timeoutMs`).
|
||||
* ──────────────────────────────────────────────────────────────── */
|
||||
|
||||
import { useState } from "react";
|
||||
import { useRef, useState, type FormEvent } from "react";
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||
import { Loader2, Save } from "lucide-react";
|
||||
|
||||
@@ -35,6 +35,7 @@ export function ResponseTimeoutCard({
|
||||
const [value, setValue] = useState("");
|
||||
const [msg, setMsg] = useState<string | null>(null);
|
||||
const [ok, setOk] = useState(false);
|
||||
const submitInFlightRef = useRef(false);
|
||||
|
||||
// Seed from the persisted value once it arrives (seed-on-data pattern).
|
||||
const seededKey =
|
||||
@@ -74,10 +75,24 @@ export function ResponseTimeoutCard({
|
||||
setOk(false);
|
||||
setMsg(e instanceof Error ? e.message : t("settings.ai.errorGeneric"));
|
||||
},
|
||||
onSettled: () => {
|
||||
submitInFlightRef.current = false;
|
||||
},
|
||||
});
|
||||
|
||||
function submit(event: FormEvent<HTMLFormElement>) {
|
||||
event.preventDefault();
|
||||
if (submitInFlightRef.current || saveMutation.isPending) return;
|
||||
submitInFlightRef.current = true;
|
||||
saveMutation.mutate();
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="bg-muted/50 space-y-3 rounded-lg p-4">
|
||||
<form
|
||||
className="bg-muted/50 space-y-3 rounded-lg p-4"
|
||||
onSubmit={submit}
|
||||
noValidate
|
||||
>
|
||||
<div>
|
||||
<p className="text-sm font-medium">
|
||||
{t("settings.ai.responseTimeoutHeading")}
|
||||
@@ -104,9 +119,10 @@ export function ResponseTimeoutCard({
|
||||
</div>
|
||||
<div>
|
||||
<Button
|
||||
type="submit"
|
||||
size="sm"
|
||||
className="min-h-11 sm:min-h-9"
|
||||
onClick={() => saveMutation.mutate()}
|
||||
aria-busy={saveMutation.isPending || undefined}
|
||||
disabled={saveMutation.isPending}
|
||||
>
|
||||
{saveMutation.isPending ? (
|
||||
@@ -122,6 +138,6 @@ export function ResponseTimeoutCard({
|
||||
{msg}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</form>
|
||||
);
|
||||
}
|
||||
@@ -202,6 +202,7 @@ export function RuntimeActionsRow({
|
||||
<div className="space-y-3">
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
<Button
|
||||
type="button"
|
||||
size="sm"
|
||||
variant="outline"
|
||||
className="min-h-11 sm:min-h-9"
|
||||
|
||||
Reference in new issue
Block a user