cody icon indicating copy to clipboard operation
cody copied to clipboard

pass config to webview through new Observable-based webview API

Open sqs opened this issue 1 year ago • 2 comments

The webview protocol message config had 2 problems:

  1. It was sent (in ChatController.sendConfig) whenever ChatController thought it might have changed, which meant a bunch of unnecessary calls to sendConfig sprinkled throughout ChatController.
  2. It is a different schema from the other configuration, with configFeatures and other things having custom logic to construct them in ChatController.

This solves problem 1. Now, the config is sent through the legacyConfig(): LegacyWebviewConfig observable webview API method to the webview, which means it gets an up-to-date view of the config. It uses the same type, so this does not yet address problem 2, but it makes it much easier to address it.

There are several other fixes and changes to account for how the value is sent immediately when it changes and not on the previously more brittle schedule.

Removes the old config webview protocol message.

There is no user-facing behavior change.

Test plan

CI and e2e

sqs avatar Sep 30 '24 10:09 sqs