From 5cd2e9fb883cab6f81050bf558ff708f2fd3300e Mon Sep 17 00:00:00 2001 From: Jason Date: Wed, 26 Nov 2025 12:35:33 +0800 Subject: [PATCH] refactor(provider): unify validation errors to use toast notifications Change template parameter validation from form.setError to toast.error for consistent UX across all required field validations. --- src/components/providers/forms/ProviderForm.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/providers/forms/ProviderForm.tsx b/src/components/providers/forms/ProviderForm.tsx index 2a5a63228..1715880b5 100644 --- a/src/components/providers/forms/ProviderForm.tsx +++ b/src/components/providers/forms/ProviderForm.tsx @@ -389,13 +389,12 @@ export function ProviderForm({ if (appId === "claude" && templateValueEntries.length > 0) { const validation = validateTemplateValues(); if (!validation.isValid && validation.missingField) { - form.setError("settingsConfig", { - type: "manual", - message: t("providerForm.fillParameter", { + toast.error( + t("providerForm.fillParameter", { label: validation.missingField.label, defaultValue: `请填写 ${validation.missingField.label}`, }), - }); + ); return; } }