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
@@ -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}