Update the webview when changing settings via the API (#2143)

* Update the webview when changing settings via the API

* Update src/exports/api.ts

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

---------

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
This commit is contained in:
Chris Estreich 2025-03-31 10:40:27 -07:00 committed by GitHub
parent 73fe581868
commit a6ed5ce0ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 6 additions and 34 deletions

View file

@ -0,0 +1,5 @@
---
"roo-cline": patch
---
Update the webview when changing settings via the API

View file

@ -82,16 +82,9 @@ export class API extends EventEmitter<RooCodeEvents> implements RooCodeAPI {
return this.provider.getValues()
}
public getConfigurationValue<K extends keyof RooCodeSettings>(key: K) {
return this.provider.getValue(key)
}
public async setConfiguration(values: RooCodeSettings) {
await this.provider.setValues(values)
}
public async setConfigurationValue<K extends keyof RooCodeSettings>(key: K, value: RooCodeSettings[K]) {
await this.provider.setValue(key, value)
await this.provider.postStateToWebview()
}
public isReady() {

View file

@ -67,26 +67,12 @@ export interface RooCodeAPI extends EventEmitter<RooCodeEvents> {
*/
getConfiguration(): RooCodeSettings
/**
* Returns the value of a configuration key.
* @param key The key of the configuration value to return.
* @returns The value of the configuration key.
*/
getConfigurationValue<K extends keyof RooCodeSettings>(key: K): RooCodeSettings[K]
/**
* Sets the configuration for the current task.
* @param values An object containing key-value pairs to set.
*/
setConfiguration(values: RooCodeSettings): Promise<void>
/**
* Sets the value of a configuration key.
* @param key The key of the configuration value to set.
* @param value The value to set.
*/
setConfigurationValue<K extends keyof RooCodeSettings>(key: K, value: RooCodeSettings[K]): Promise<void>
/**
* Returns true if the API is ready to use.
*/

View file

@ -457,23 +457,11 @@ interface RooCodeAPI extends EventEmitter<RooCodeEvents> {
* @returns The current configuration.
*/
getConfiguration(): RooCodeSettings
/**
* Returns the value of a configuration key.
* @param key The key of the configuration value to return.
* @returns The value of the configuration key.
*/
getConfigurationValue<K extends keyof RooCodeSettings>(key: K): RooCodeSettings[K]
/**
* Sets the configuration for the current task.
* @param values An object containing key-value pairs to set.
*/
setConfiguration(values: RooCodeSettings): Promise<void>
/**
* Sets the value of a configuration key.
* @param key The key of the configuration value to set.
* @param value The value to set.
*/
setConfigurationValue<K extends keyof RooCodeSettings>(key: K, value: RooCodeSettings[K]): Promise<void>
/**
* Returns true if the API is ready to use.
*/