@@ -137,10 +137,6 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone, t
137137 browserToolEnabled,
138138 browserViewportSize,
139139 enableCheckpoints,
140- diffViewAutoFocus,
141- autoCloseRooTabs,
142- autoCloseAllRooTabs,
143- diffEnabled,
144140 experiments,
145141 fuzzyMatchThreshold,
146142 maxOpenTabsContext,
@@ -215,25 +211,8 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone, t
215211 return prevState
216212 }
217213
218- const newState : ExtensionStateContextType = {
219- ...prevState ,
220- apiConfiguration : { ...prevState . apiConfiguration , [ field ] : value } ,
221- }
222- // Update the field in root state for sync
223- if ( field === "diffEnabled" ) {
224- newState . diffEnabled = value as boolean // type is boolean
225- } else if ( field === "diffViewAutoFocus" ) {
226- newState . diffViewAutoFocus = value as boolean // type is boolean
227- } else if ( field === "autoCloseRooTabs" ) {
228- newState . autoCloseRooTabs = value as boolean // type is boolean
229- } else if ( field === "autoCloseAllRooTabs" ) {
230- newState . autoCloseAllRooTabs = value as boolean // type is boolean
231- } else if ( field === "fuzzyMatchThreshold" ) {
232- newState . fuzzyMatchThreshold = value as number // type is number
233- }
234-
235214 setChangeDetected ( true )
236- return newState
215+ return { ... prevState , apiConfiguration : { ... prevState . apiConfiguration , [ field ] : value } }
237216 } )
238217 } ,
239218 [ ] ,
@@ -285,10 +264,10 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone, t
285264 vscode . postMessage ( { type : "ttsEnabled" , bool : ttsEnabled } )
286265 vscode . postMessage ( { type : "ttsSpeed" , value : ttsSpeed } )
287266 vscode . postMessage ( { type : "soundVolume" , value : soundVolume } )
288- vscode . postMessage ( { type : "diffEnabled" , bool : diffEnabled } )
289- vscode . postMessage ( { type : "diffViewAutoFocus" , bool : diffViewAutoFocus } )
290- vscode . postMessage ( { type : "autoCloseRooTabs" , bool : autoCloseRooTabs } )
291- vscode . postMessage ( { type : "autoCloseAllRooTabs" , bool : autoCloseAllRooTabs } )
267+ vscode . postMessage ( { type : "diffEnabled" , bool : apiConfiguration . diffEnabled } )
268+ vscode . postMessage ( { type : "diffViewAutoFocus" , bool : apiConfiguration . diffViewAutoFocus } )
269+ vscode . postMessage ( { type : "autoCloseRooTabs" , bool : apiConfiguration . autoCloseRooTabs } )
270+ vscode . postMessage ( { type : "autoCloseAllRooTabs" , bool : apiConfiguration . autoCloseAllRooTabs } )
292271 vscode . postMessage ( { type : "enableCheckpoints" , bool : enableCheckpoints } )
293272 vscode . postMessage ( { type : "browserViewportSize" , text : browserViewportSize } )
294273 vscode . postMessage ( { type : "remoteBrowserHost" , text : remoteBrowserHost } )
0 commit comments