From 3f8429646c5072447f95c2605477bdf7cafa850b Mon Sep 17 00:00:00 2001 From: Chris Estreich Date: Mon, 31 Mar 2025 10:40:27 -0700 Subject: [PATCH] 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> --- .changeset/grumpy-pets-run.md | 5 +++++ src/exports/api.ts | 9 +-------- src/exports/interface.ts | 14 -------------- src/exports/roo-code.d.ts | 12 ------------ 4 files changed, 6 insertions(+), 34 deletions(-) create mode 100644 .changeset/grumpy-pets-run.md diff --git a/.changeset/grumpy-pets-run.md b/.changeset/grumpy-pets-run.md new file mode 100644 index 0000000000..271f580fc6 --- /dev/null +++ b/.changeset/grumpy-pets-run.md @@ -0,0 +1,5 @@ +--- +"roo-cline": patch +--- + +Update the webview when changing settings via the API diff --git a/src/exports/api.ts b/src/exports/api.ts index 61dd34cc63..19d679b2ee 100644 --- a/src/exports/api.ts +++ b/src/exports/api.ts @@ -193,16 +193,9 @@ export class API extends EventEmitter implements RooCodeAPI { return this.sidebarProvider.getValues() } - public getConfigurationValue(key: K) { - return this.sidebarProvider.getValue(key) - } - public async setConfiguration(values: RooCodeSettings) { await this.sidebarProvider.setValues(values) - } - - public async setConfigurationValue(key: K, value: RooCodeSettings[K]) { - await this.sidebarProvider.setValue(key, value) + await this.sidebarProvider.postStateToWebview() } public isReady() { diff --git a/src/exports/interface.ts b/src/exports/interface.ts index af0277f541..9b2c619409 100644 --- a/src/exports/interface.ts +++ b/src/exports/interface.ts @@ -66,26 +66,12 @@ export interface RooCodeAPI extends EventEmitter { */ 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(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 - /** - * Sets the value of a configuration key. - * @param key The key of the configuration value to set. - * @param value The value to set. - */ - setConfigurationValue(key: K, value: RooCodeSettings[K]): Promise - /** * Returns true if the API is ready to use. */ diff --git a/src/exports/roo-code.d.ts b/src/exports/roo-code.d.ts index 3149a0b1b3..2db5b90768 100644 --- a/src/exports/roo-code.d.ts +++ b/src/exports/roo-code.d.ts @@ -566,23 +566,11 @@ interface RooCodeAPI extends EventEmitter { * @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(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 - /** - * Sets the value of a configuration key. - * @param key The key of the configuration value to set. - * @param value The value to set. - */ - setConfigurationValue(key: K, value: RooCodeSettings[K]): Promise /** * Returns true if the API is ready to use. */