Skip to content

Implement image carousel service and integrate with chat attachments#301587

Open
TylerLeonhardt wants to merge 3 commits intomainfrom
tyler/envious-bear
Open

Implement image carousel service and integrate with chat attachments#301587
TylerLeonhardt wants to merge 3 commits intomainfrom
tyler/envious-bear

Conversation

@TylerLeonhardt
Copy link
Member

@TylerLeonhardt TylerLeonhardt commented Mar 13, 2026

  • Introduced ChatImageCarouselService to manage image carousels in chat.
  • Updated ImageAttachmentWidget to utilize the new carousel service for image display.
  • Enhanced image extraction logic to support inline references and tool invocations.
  • Added tests for carousel service functionality and image extraction.

Copilot AI review requested due to automatic review settings March 13, 2026 20:24
@TylerLeonhardt TylerLeonhardt enabled auto-merge (squash) March 13, 2026 20:24
@TylerLeonhardt TylerLeonhardt self-assigned this Mar 13, 2026
@vs-code-engineering vs-code-engineering bot added this to the 1.112.0 milestone Mar 13, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a chat-focused image carousel service and expands image extraction so chat can open an “image carousel” experience from image attachments and inline references.

Changes:

  • Added ChatImageCarouselService to collect images from the focused chat session and open the image carousel command at the clicked image.
  • Extended extractImagesFromChatResponse to also extract images from inline references (optionally via a readFile callback) and added unit tests.
  • Wired image inline anchors and image request attachments to open the carousel when chat.imageCarousel.enabled is enabled.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/vs/workbench/contrib/chat/common/chatImageExtraction.ts Makes image extraction async; adds inline-reference image extraction support.
src/vs/workbench/contrib/chat/browser/chatImageCarouselService.ts New service to build carousel sections from chat responses and open the carousel command.
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.ts Opens the carousel when clicking an image inline reference pill (behind config).
src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.ts Routes image attachment “open in carousel” behavior through the new service.
src/vs/workbench/contrib/chat/browser/chat.contribution.ts Registers the new IChatImageCarouselService singleton.
src/vs/workbench/contrib/chat/test/common/chatImageExtraction.test.ts New tests for tool-invocation and inline-reference image extraction.
src/vs/workbench/contrib/chat/test/browser/chatImageCarouselService.test.ts New tests for carousel-service helper functions.

You can also share your feedback on Copilot code review. Take the survey.

- Introduced `ChatImageCarouselService` to manage image carousels in chat.
- Updated `ImageAttachmentWidget` to utilize the new carousel service for image display.
- Enhanced image extraction logic to support inline references and tool invocations.
- Added tests for carousel service functionality and image extraction.

What's missing is pills rendered in other places like `pastTenseMessage` and `invocationMessage`... maybe more?
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a dedicated ChatImageCarouselService to open the image carousel from chat UI elements (attachments + inline reference “pills”), and expands image extraction so carousel sections can include images coming from inline references and tool invocation messages.

Changes:

  • Added ChatImageCarouselService (registered as a singleton) that aggregates images from the focused chat’s responses and opens the carousel at the clicked image.
  • Updated chat attachment and inline-reference click handling to route image clicks to the carousel service (when enabled).
  • Expanded image extraction to include inline reference images and image URIs embedded in tool invocation messages; added unit tests for extraction and carousel helper logic.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/vs/workbench/contrib/chat/common/chatImageExtraction.ts Makes extraction async and adds inline-reference + tool-message URI image extraction.
src/vs/workbench/contrib/chat/browser/chatImageCarouselService.ts New service + helper functions to build carousel payloads and locate clicked image.
src/vs/workbench/contrib/chat/browser/chat.contribution.ts Registers the new carousel service singleton.
src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.ts Routes image attachment clicks through the carousel service.
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.ts Opens the carousel when clicking inline-reference image resources (when enabled).
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.ts Renames the extraction helper used for terminal tool image pills (output-details only).
src/vs/workbench/contrib/chat/test/common/chatImageExtraction.test.ts New unit tests covering expanded extraction logic.
src/vs/workbench/contrib/chat/test/browser/chatImageCarouselService.test.ts New unit tests for carousel helper functions.

You can also share your feedback on Copilot code review. Take the survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants