Implement image carousel service and integrate with chat attachments#301587
Implement image carousel service and integrate with chat attachments#301587TylerLeonhardt wants to merge 3 commits intomainfrom
Conversation
There was a problem hiding this comment.
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
ChatImageCarouselServiceto collect images from the focused chat session and open the image carousel command at the clicked image. - Extended
extractImagesFromChatResponseto also extract images from inline references (optionally via areadFilecallback) and added unit tests. - Wired image inline anchors and image request attachments to open the carousel when
chat.imageCarousel.enabledis 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.
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.ts
Show resolved
Hide resolved
- 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?
cc951a4 to
eb20098
Compare
There was a problem hiding this comment.
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.
ChatImageCarouselServiceto manage image carousels in chat.ImageAttachmentWidgetto utilize the new carousel service for image display.