Open abeatrix opened 3 days ago
@abeatrix , I've pushed a small update:
css
to cssVariables
and gives it that {[key: string]: string}
type.data-ide
attribute. This is the one you should switch your theme remapping stylesheet off.I pushed 78cb8e06cf76d249c6e61aab93f74dd9b3613e96 to sourcegraph/jetbrains dpc/web-content branch which sends this.
I'm also sending an "isDark" property, do you need that? High contrast mode?
Here's what the prototype webview looks like in the inspector now:
You can test this, maybe this can be the start of a manual test plan for your PR:
CODY_DIR=/Users/dpc/projects/cody ./gradlew :runIDE -PforceAgentBuild=true
document.body.style.background = 'var(--jetbrains-textText)'
should change the background color to the same color as the label "Cody Experimental Chat UX"(It takes forever to reach DOMContentLoaded, will worry about that later.)
CLOSE https://linear.app/sourcegraph/issue/CODY-2462/implement-the-webview-side-of-dom-css-theme-plumbing
This change adds the ability to set the webview theme based on the theme provided by the Agent IDE. The
SimpleChatPanelProvider
now checks for a theme from the IDE and sends aui/theme
message to the webview with the CSS variables to apply the theme.The
App
component in the webview then listens for theui/theme
message and applies the provided CSS variables to the root element.This allows the webview to match the theme of the Agent IDE, providing a more consistent user experience.
Test plan
TBC. Need to implement the changes on JB to test.