From ec6ebb10ef79d845320cb393760cbdf2d0cd687a Mon Sep 17 00:00:00 2001 From: Justin Chen <54879025+justschen@users.noreply.github.com> Date: Thu, 19 Feb 2026 00:09:59 -0800 Subject: [PATCH] make sure to respect attachCSS setting for integrated browser (#296210) make sure to respect attachCSS setting --- .../browserView/electron-browser/browserEditor.ts | 14 +++++++++----- .../attachments/simpleBrowserEditorOverlay.ts | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/vs/workbench/contrib/browserView/electron-browser/browserEditor.ts b/src/vs/workbench/contrib/browserView/electron-browser/browserEditor.ts index 42f9c41bf53..28c2dd24f25 100644 --- a/src/vs/workbench/contrib/browserView/electron-browser/browserEditor.ts +++ b/src/vs/workbench/contrib/browserView/electron-browser/browserEditor.ts @@ -718,12 +718,14 @@ export class BrowserEditor extends EditorPane { name: displayName, fullName: displayName, value: value, - modelDescription: 'Structured browser element context with HTML path, attributes, and computed styles.', + modelDescription: attachCss + ? 'Structured browser element context with HTML path, attributes, and computed styles.' + : 'Structured browser element context with HTML path and attributes.', kind: 'element', icon: ThemeIcon.fromId(Codicon.layout.id), ancestors: elementData.ancestors, attributes: elementData.attributes, - computedStyles: elementData.computedStyles, + computedStyles: attachCss ? elementData.computedStyles : undefined, dimensions: elementData.dimensions, innerText: elementData.innerText, }); @@ -864,9 +866,11 @@ export class BrowserEditor extends EditorPane { sections.push(`Attributes:\n${attributeTable}`); } - const computedStyleTable = this.formatElementMap(elementData.computedStyles); - if (computedStyleTable) { - sections.push(`Computed Styles:\n${computedStyleTable}`); + if (attachCss) { + const computedStyleTable = this.formatElementMap(elementData.computedStyles); + if (computedStyleTable) { + sections.push(`Computed Styles:\n${computedStyleTable}`); + } } if (elementData.dimensions) { diff --git a/src/vs/workbench/contrib/chat/browser/attachments/simpleBrowserEditorOverlay.ts b/src/vs/workbench/contrib/chat/browser/attachments/simpleBrowserEditorOverlay.ts index a270c52b91d..382fbd87e08 100644 --- a/src/vs/workbench/contrib/chat/browser/attachments/simpleBrowserEditorOverlay.ts +++ b/src/vs/workbench/contrib/chat/browser/attachments/simpleBrowserEditorOverlay.ts @@ -300,7 +300,7 @@ class SimpleBrowserOverlayWidget { icon: ThemeIcon.fromId(Codicon.layout.id), ancestors: elementData.ancestors, attributes: elementData.attributes, - computedStyles: elementData.computedStyles, + computedStyles: attachCss ? elementData.computedStyles : undefined, dimensions: elementData.dimensions, innerText: elementData.innerText, });