Skip to content

fix #302202 fix #301997 Deduplicate consecutive carousel images and add title fallback#302568

Open
rebornix wants to merge 2 commits intomainfrom
rebornix/chosen-peacock
Open

fix #302202 fix #301997 Deduplicate consecutive carousel images and add title fallback#302568
rebornix wants to merge 2 commits intomainfrom
rebornix/chosen-peacock

Conversation

@rebornix
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings March 17, 2026 21:25
@rebornix rebornix self-assigned this Mar 17, 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

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

  • references entries are missing the required kind: 'reference' field for IChatContentReference, which will cause TypeScript to fail to compile these tests. Update each reference object to include kind: 'reference' (and keep reference: uri as-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 missing kind: 'reference' required by IChatContentReference, so this test code won't type-check. Include kind: 'reference' on each reference object.
				makeImageVariableEntry({
					value: new Uint8Array([1, 2, 3]),
					references: [{ reference: uri }],
				}),
				makeImageVariableEntry({

@rebornix rebornix marked this pull request as ready for review March 18, 2026 00:51
@vs-code-engineering vs-code-engineering bot added this to the 1.113.0 milestone Mar 18, 2026
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