From 809a1fcf846d90135b2ae62d7b6ae6fe2541c86d Mon Sep 17 00:00:00 2001 From: makoMako <48956204+zhu-jl18@users.noreply.github.com> Date: Sun, 1 Feb 2026 11:21:43 +0800 Subject: [PATCH] feat(ui): dynamic endpoint hint based on API format selection (#860) - Add apiHintOAI i18n key for OpenAI Chat Completions format hint - Update ClaudeFormFields to show format-specific endpoint hints - When API format is "openai_chat", show OAI-specific hint - Maintains consistency between hint and selected API format Co-authored-by: Claude Opus 4.5 --- src/components/providers/forms/ClaudeFormFields.tsx | 6 +++++- src/i18n/locales/en.json | 1 + src/i18n/locales/ja.json | 1 + src/i18n/locales/zh.json | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/providers/forms/ClaudeFormFields.tsx b/src/components/providers/forms/ClaudeFormFields.tsx index 75181972f..699f5aa01 100644 --- a/src/components/providers/forms/ClaudeFormFields.tsx +++ b/src/components/providers/forms/ClaudeFormFields.tsx @@ -163,7 +163,11 @@ export function ClaudeFormFields({ value={baseUrl} onChange={onBaseUrlChange} placeholder={t("providerForm.apiEndpointPlaceholder")} - hint={t("providerForm.apiHint")} + hint={ + apiFormat === "openai_chat" + ? t("providerForm.apiHintOAI") + : t("providerForm.apiHint") + } onManageClick={() => onEndpointModalToggle(true)} /> )} diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 78634bb2b..dfa583098 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -458,6 +458,7 @@ "fastModelPlaceholder": "e.g., GLM-4.5-Air", "modelHint": "💡 Leave blank to use provider's default model", "apiHint": "💡 Fill in Claude API compatible service endpoint, avoid trailing slash", + "apiHintOAI": "💡 Fill in OpenAI Chat Completions compatible service endpoint, avoid trailing slash", "codexApiHint": "💡 Fill in service endpoint compatible with OpenAI Response format", "fillSupplierName": "Please fill in provider name", "fillConfigContent": "Please fill in configuration content", diff --git a/src/i18n/locales/ja.json b/src/i18n/locales/ja.json index c3eeb4fc0..a9c4f87e1 100644 --- a/src/i18n/locales/ja.json +++ b/src/i18n/locales/ja.json @@ -458,6 +458,7 @@ "fastModelPlaceholder": "例: GLM-4.5-Air", "modelHint": "💡 空欄ならプロバイダーのデフォルトモデルを使用します", "apiHint": "💡 Claude API 互換サービスのエンドポイントを入力してください。末尾にスラッシュを付けないでください", + "apiHintOAI": "💡 OpenAI Chat Completions 互換サービスのエンドポイントを入力してください。末尾にスラッシュを付けないでください", "codexApiHint": "💡 OpenAI Response 互換のサービスエンドポイントを入力してください", "fillSupplierName": "プロバイダー名を入力してください", "fillConfigContent": "設定内容を入力してください", diff --git a/src/i18n/locales/zh.json b/src/i18n/locales/zh.json index c10cad3fc..819af11f9 100644 --- a/src/i18n/locales/zh.json +++ b/src/i18n/locales/zh.json @@ -458,6 +458,7 @@ "fastModelPlaceholder": "例如: GLM-4.5-Air", "modelHint": "💡 留空将使用供应商的默认模型", "apiHint": "💡 填写兼容 Claude API 的服务端点地址,不要以斜杠结尾", + "apiHintOAI": "💡 填写兼容 OpenAI Chat Completions 的服务端点地址,不要以斜杠结尾", "codexApiHint": "💡 填写兼容 OpenAI Response 格式的服务端点地址", "fillSupplierName": "请填写供应商名称", "fillConfigContent": "请填写配置内容",