fix: show context-aware JSON editor hint and hide quick toggles for non-active providers

The hint text and ClaudeQuickToggles were misleading when editing
non-current providers or creating new ones, since the editor only
contains a config snippet rather than the full live settings.json.
This commit is contained in:
Jason
2026-02-26 09:55:09 +08:00
parent 87604b1809
commit 24fa8a18ef
5 changed files with 8 additions and 2 deletions

View File

@@ -192,6 +192,7 @@ export function EditProviderDialog({
onCancel={() => onOpenChange(false)}
initialData={initialData}
showButtons={false}
isCurrent={liveSettings !== null}
/>
</FullScreenPanel>
);

View File

@@ -118,6 +118,7 @@ interface ProviderFormProps {
iconColor?: string;
};
showButtons?: boolean;
isCurrent?: boolean;
}
export function ProviderForm({
@@ -130,6 +131,7 @@ export function ProviderForm({
onManageUniversalProviders,
initialData,
showButtons = true,
isCurrent = false,
}: ProviderFormProps) {
const { t } = useTranslation();
const isEditMode = Boolean(initialData);
@@ -1496,7 +1498,7 @@ export function ProviderForm({
<Label htmlFor="settingsConfig">
{t("claudeConfig.configLabel")}
</Label>
{isEditMode && (
{isEditMode && isCurrent && (
<ClaudeQuickToggles
onPatchApplied={(patch) => {
try {
@@ -1527,7 +1529,7 @@ export function ProviderForm({
language="json"
/>
<p className="text-xs text-muted-foreground">
{t("claudeConfig.fullSettingsHint")}
{t(isCurrent ? "claudeConfig.fullSettingsHint" : "claudeConfig.fragmentSettingsHint")}
</p>
</div>
{settingsConfigErrorField}

View File

@@ -52,6 +52,7 @@
"claudeConfig": {
"configLabel": "Claude Code settings.json (JSON) *",
"fullSettingsHint": "Full Claude Code settings.json content",
"fragmentSettingsHint": "Config snippet for this provider; will be written to settings.json when activated",
"hideAttribution": "Hide AI Attribution",
"alwaysThinking": "Extended Thinking",
"enableTeammates": "Teammates Mode"

View File

@@ -52,6 +52,7 @@
"claudeConfig": {
"configLabel": "Claude Code settings.json (JSON) *",
"fullSettingsHint": "Claude Code の settings.json 全文",
"fragmentSettingsHint": "このプロバイダーの設定スニペット。有効化時に settings.json に書き込まれます",
"hideAttribution": "AI署名を非表示",
"alwaysThinking": "拡張思考",
"enableTeammates": "Teammates モード"

View File

@@ -52,6 +52,7 @@
"claudeConfig": {
"configLabel": "Claude Code 配置 (JSON) *",
"fullSettingsHint": "完整的 Claude Code settings.json 配置内容",
"fragmentSettingsHint": "此供应商的配置片段,激活后将写入 settings.json",
"hideAttribution": "隐藏 AI 署名",
"alwaysThinking": "扩展思考",
"enableTeammates": "Teammates 模式"