Skip to content

Commit 7eae039

Browse files
committed
fix: ensure change detection triggers for all prompt types
- Update CONDENSE prompt handling to also call setCustomSupportPrompts - This ensures the parent SettingsView component detects changes - Fixes issue where Save button remained disabled when editing prompts
1 parent f913f9c commit 7eae039

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

webview-ui/src/components/settings/PromptsSettings.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ const PromptsSettings = ({ customSupportPrompts, setCustomSupportPrompts }: Prom
6262
type: "updateCondensingPrompt",
6363
text: value || supportPrompt.default.CONDENSE,
6464
})
65+
// Also update the customSupportPrompts to trigger change detection
66+
const updatedPrompts = { ...customSupportPrompts, [type]: value }
67+
setCustomSupportPrompts(updatedPrompts)
6568
} else {
6669
const updatedPrompts = { ...customSupportPrompts, [type]: value }
6770
setCustomSupportPrompts(updatedPrompts)
@@ -75,6 +78,10 @@ const PromptsSettings = ({ customSupportPrompts, setCustomSupportPrompts }: Prom
7578
type: "updateCondensingPrompt",
7679
text: supportPrompt.default.CONDENSE,
7780
})
81+
// Also update the customSupportPrompts to trigger change detection
82+
const updatedPrompts = { ...customSupportPrompts }
83+
delete updatedPrompts[type]
84+
setCustomSupportPrompts(updatedPrompts)
7885
} else {
7986
const updatedPrompts = { ...customSupportPrompts }
8087
delete updatedPrompts[type]

0 commit comments

Comments
 (0)