Skip to content

"Add Element to Chat" screenshot rectangle is misaligned #304158

@jruales

Description

@jruales

Repro steps:

  • Open Integrated Browser and browse to a page
  • Change the zoom level of the page itself (not of VS Code) so that it's a different zoom level than VS Code itself
  • Use Add Element to Chat to add an element to chat
  • 🐛 The attached screenshot will not be aligned with the element you clicked on

I'm using:

  • VS Code Version: 1.113.0-insider (Universal)
  • OS Version: Darwin arm64 25.3.0

See issue here: #303645 (comment)

Current behavior (notice the screenshot rectangle is not aligned with the image element):

Image

Expected (screenshot rectangle aligned with the image element):

Image

Probable cause:
It seems like Add Element to Chat uses the VS Code zoom level when calculating the rectangle for the screenshot, instead of the browser's own zoom level.

Probable solution:
In integrated browser (anything related with /browserView/), use the browser's own zoom level for calculating the rectangle. For simple browser or Live Preview extension, use VS Code's zoom level (since those don't support a browser-specific zoom level).

Metadata

Metadata

Labels

browser-integrationWeb browsing features integrated into VS Code (e.g. integrated browser)bugIssue identified by VS Code Team member as probable bugverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions