@@ -23,13 +23,17 @@ import { SearchableSetting } from "./SearchableSetting"
2323interface PromptsSettingsProps {
2424 customSupportPrompts : Record < string , string | undefined >
2525 setCustomSupportPrompts : ( prompts : Record < string , string | undefined > ) => void
26+ customCondensingPrompt ?: string
27+ setCustomCondensingPrompt ?: ( value : string ) => void
2628 includeTaskHistoryInEnhance ?: boolean
2729 setIncludeTaskHistoryInEnhance ?: ( value : boolean ) => void
2830}
2931
3032const PromptsSettings = ( {
3133 customSupportPrompts,
3234 setCustomSupportPrompts,
35+ customCondensingPrompt : propsCustomCondensingPrompt ,
36+ setCustomCondensingPrompt : propsSetCustomCondensingPrompt ,
3337 includeTaskHistoryInEnhance : propsIncludeTaskHistoryInEnhance ,
3438 setIncludeTaskHistoryInEnhance : propsSetIncludeTaskHistoryInEnhance ,
3539} : PromptsSettingsProps ) => {
@@ -40,12 +44,16 @@ const PromptsSettings = ({
4044 setEnhancementApiConfigId,
4145 condensingApiConfigId,
4246 setCondensingApiConfigId,
43- customCondensingPrompt,
44- setCustomCondensingPrompt,
47+ customCondensingPrompt : contextCustomCondensingPrompt ,
48+ setCustomCondensingPrompt : contextSetCustomCondensingPrompt ,
4549 includeTaskHistoryInEnhance : contextIncludeTaskHistoryInEnhance ,
4650 setIncludeTaskHistoryInEnhance : contextSetIncludeTaskHistoryInEnhance ,
4751 } = useExtensionState ( )
4852
53+ // Use props if provided, otherwise fall back to context
54+ const customCondensingPrompt = propsCustomCondensingPrompt ?? contextCustomCondensingPrompt
55+ const setCustomCondensingPrompt = propsSetCustomCondensingPrompt ?? contextSetCustomCondensingPrompt
56+
4957 // Use props if provided, otherwise fall back to context
5058 const includeTaskHistoryInEnhance = propsIncludeTaskHistoryInEnhance ?? contextIncludeTaskHistoryInEnhance ?? true
5159 const setIncludeTaskHistoryInEnhance = propsSetIncludeTaskHistoryInEnhance ?? contextSetIncludeTaskHistoryInEnhance
@@ -76,10 +84,6 @@ const PromptsSettings = ({
7684
7785 if ( type === "CONDENSE" ) {
7886 setCustomCondensingPrompt ( finalValue ?? supportPrompt . default . CONDENSE )
79- vscode . postMessage ( {
80- type : "updateCondensingPrompt" ,
81- text : finalValue ?? supportPrompt . default . CONDENSE ,
82- } )
8387 // Also update the customSupportPrompts to trigger change detection
8488 const updatedPrompts = { ...customSupportPrompts }
8589 if ( finalValue === undefined ) {
@@ -102,10 +106,6 @@ const PromptsSettings = ({
102106 const handleSupportReset = ( type : SupportPromptType ) => {
103107 if ( type === "CONDENSE" ) {
104108 setCustomCondensingPrompt ( supportPrompt . default . CONDENSE )
105- vscode . postMessage ( {
106- type : "updateCondensingPrompt" ,
107- text : supportPrompt . default . CONDENSE ,
108- } )
109109 // Also update the customSupportPrompts to trigger change detection
110110 const updatedPrompts = { ...customSupportPrompts }
111111 delete updatedPrompts [ type ]
0 commit comments