fix #302202 fix #301997 Deduplicate consecutive carousel images and add title fallback#302568
Open
fix #302202 fix #301997 Deduplicate consecutive carousel images and add title fallback#302568
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes image carousel UX issues in the chat workbench by removing redundant consecutive images and ensuring a stable, user-friendly collection title when section titles are empty.
Changes:
- Deduplicate consecutive images with identical URIs within each collected carousel section.
- Add a default/fallback collection title for single-section carousels when the section title is empty.
- Add tests for consecutive vs non-consecutive duplicate image URIs in
collectCarouselSections.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/browser/chatImageCarouselService.ts | Adds consecutive-URI deduping when building carousel sections and introduces a default title fallback in buildCollectionArgs. |
| src/vs/workbench/contrib/chat/test/browser/chatImageCarouselService.test.ts | Adds unit tests validating consecutive URI deduplication behavior and that non-consecutive duplicates are preserved. |
Comments suppressed due to low confidence (2)
src/vs/workbench/contrib/chat/test/browser/chatImageCarouselService.test.ts:238
referencesentries are missing the requiredkind: 'reference'field forIChatContentReference, which will cause TypeScript to fail to compile these tests. Update each reference object to includekind: 'reference'(and keepreference: urias-is).
makeImageVariableEntry({
value: new Uint8Array([1, 2, 3]),
references: [{ reference: uri }],
}),
makeImageVariableEntry({
id: 'img-2',
value: new Uint8Array([1, 2, 3]),
references: [{ reference: uri }],
}),
src/vs/workbench/contrib/chat/test/browser/chatImageCarouselService.test.ts:256
references: [{ reference: ... }]is missingkind: 'reference'required byIChatContentReference, so this test code won't type-check. Includekind: 'reference'on each reference object.
makeImageVariableEntry({
value: new Uint8Array([1, 2, 3]),
references: [{ reference: uri }],
}),
makeImageVariableEntry({
src/vs/workbench/contrib/chat/test/browser/chatImageCarouselService.test.ts
Outdated
Show resolved
Hide resolved
bhavyaus
approved these changes
Mar 18, 2026
TylerLeonhardt
approved these changes
Mar 18, 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.
No description provided.