Enhance image carousel with section support and chat integration#301308
Merged
Enhance image carousel with section support and chat integration#301308
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the image carousel feature to support sections (grouped thumbnails with titles) and per-image captions, while moving the image extraction logic from a dedicated service (ImageCarouselService) into a standalone utility function (extractImagesFromChatResponse) in the chat domain. The chat integration for building carousel collections is moved into ImageAttachmentWidget, removing the prior IImageCarouselService dependency.
Changes:
- Replaced
imageswithsections(array ofICarouselSection) onIImageCarouselCollection, and addedcaptiontoICarouselImage, with corresponding editor UI updates (section rendering, caption display, counter removal). - Deleted
ImageCarouselServiceand replaced it with a pure functionextractImagesFromChatResponsein a newchatImageExtraction.tsfile, improving type safety and decoupling. - Moved carousel-opening logic (response scanning, fallback) from the action handler into
ImageAttachmentWidget.openInCarousel, simplifying the command to accept either a pre-built collection or single image args.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
imageCarouselTypes.ts |
Added ICarouselSection interface, caption to ICarouselImage, replaced images with sections on IImageCarouselCollection. |
imageCarouselEditor.ts |
Adapted editor to flatten sections for navigation, render section thumbnails with titles, and display captions. |
imageCarousel.contribution.ts |
Removed service registration, added typed arg interfaces and type guards, simplified action to accept collection or single image args. |
imageCarouselService.ts |
Deleted — service replaced by standalone extraction function. |
chatImageExtraction.ts |
New file: pure extraction functions with URI generation, caption from tool messages, and collection title from user request. |
chatAttachmentWidgets.ts |
Moved carousel-opening logic here; scans responses, matches by URI or data, builds collection with single section. |
imageCarousel.css |
Restructured bottom bar: added section containers, section titles, caption styling; removed counter. |
AGENTS.md |
Updated design documentation to reflect new DOM structure, sections, and keyboard handling. |
src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditor.ts
Outdated
Show resolved
Hide resolved
…eCurrentImage documentation
TylerLeonhardt
approved these changes
Mar 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce support for sections and captions in the image carousel. Refactor the image extraction logic for improved type safety and integrate image extraction from chat responses to enhance the carousel experience.