agentleFS
MicrosoftKnown publishermicrosoft/vscode/src/vs/workbench/contrib/imageCarousel/AGENTS.md

vscode / imageCarousel

AGENTS.md196k starsChanged 17 days agoMITView on GitHub

A generic workbench editor for viewing collections of images in a carousel/slideshow UI. Opens as a modal editor pane with navigation arrows, a caption, and a thumbnail strip. The image carousel is a self-contained workbench contribution that follows the custom editor pattern: Clicking an image attachment pill in chat (when chat.imageCarousel.enabled is true) executes the workbench.action.chat.openImageInCarousel command, which collects request attachment images together with response-derived images for the current chat session and opens them in the carousel. MIME types are…

Trending

More talk lately.about the whole repository

Dec 2025: 2 mentionsJan 2026: 1 mentionFeb 2026: 1 mentionMar 2026: 1 mentionApr 2026: 2 mentionsMay 2026: 4 mentionsJun 2026: 2 mentionsJul 2026: 2 mentionsAug 2026: 0 mentionsSep 2026: 3 mentionsOct 2026: 1 mentionNov 2026: 2 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the microsoft/vscode repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about microsoft/vscode

The biggest 5 of 96 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 96

Talked about on Bluesky, Hacker News and GitHub (96 times).

On Bluesky · 48

43 more on Bluesky

On Hacker News · 39

34 more on Hacker News

On GitHub · 9

4 more on GitHub

The file

Files
AGENTS.md

Image Carousel

A generic workbench editor for viewing collections of images in a carousel/slideshow UI. Opens as a modal editor pane with navigation arrows, a caption, and a thumbnail strip.

Architecture

The image carousel is a self-contained workbench contribution that follows the custom editor pattern:

  • URI scheme: vscode-image-carousel (registered in Schemas in src/vs/base/common/network.ts) — used for EditorInput.resource identity.
  • Direct editor input: Callers create ImageCarouselEditorInput with a collection and open it directly via IEditorService.openEditor().
  • Image extraction: Chat integration builds a sections-based collection from chat request/response items. A section can include user-attached request images alongside response-derived images (tool invocations and inline references). For paired request/response items, the section title prefers the user's chat request message; pending requests with image attachments form their own section.

How to open the carousel

From code (generic)

const collection: IImageCarouselCollection = { id, title, sections: [{ title: '', images: [...] }] };
const input = new ImageCarouselEditorInput(collection, startIndex);
await editorService.openEditor(input, { pinned: true }, MODAL_GROUP);

From chat (via click handler)

Clicking an image attachment pill in chat (when chat.imageCarousel.enabled is true) executes the workbench.action.chat.openImageInCarousel command, which collects request attachment images together with response-derived images for the current chat session and opens them in the carousel. MIME types are resolved via getMediaMime() from src/vs/base/common/mime.ts.

Key design decisions

Editor & lifecycle

  • Modal editor: Opens in MODAL_GROUP (-4) as an overlay.
  • Not restorable: canSerialize() returns false — image data is in-memory only.
  • Collection ID = chat session identity: sessionResource + '_carousel' for stable dedup via EditorInput.matches().
  • Preview-gated: chat.imageCarousel.enabled (default false, tagged preview). When off, clicks fall through to openResource().
  • Exact image matching: Finds the clicked image within the constructed collection by URI first, then falls back to byte equality when needed.
  • Markup close confirmation: While the editor shows the markup of an image (ICarouselImage.markUp) that has changes, closing it first cancels the markup, which asks the user to confirm discarding them. The editor provides this to the input's closeHandler through ImageCarouselEditorInput.markUpCloseHandler.

DOM & rendering

  • DOM construction: Uses the h() helper from vs/base/browser/dom with @name references for declarative DOM — no imperative document.createElement calls.
  • Bottom bar: Caption and thumbnail sections are wrapped in a div.bottom-bar flex column below the image area.
  • Stable DOM skeleton: Builds DOM once per setInput(), updates only changing parts to avoid flash on navigation.
  • Blob URL lifecycle: Main image URLs tracked in _imageDisposables (revoked on nav), thumbnails in _contentDisposables (revoked on clearInput()).
  • Focus border suppressed: The slideshow container uses outline: none !important on :focus / :focus-visible to override the workbench's global [tabindex="0"] focus styles.

Keyboard & focus

  • Keyboard parity: Uses registerOpenEditorListeners (click, double-click, Enter, Space) matching other attachment widgets.
  • Arrow key navigation: Handled via DOM keydown listener with stopPropagation() — not Action2 keybindings, because the modal editor's KEY_DOWN handler blocks workbench.* commands not in its allowlist. The editor overrides focus() to forward focus to the slideshow container so arrow keys work immediately without clicking.

Zoom and context menu

Zooming and the image context menu come from the shared ImageViewer widget in src/vs/workbench/contrib/mediaPreview/browser/imageViewer.ts, which is also used by the built-in image preview editor. The carousel creates one viewer per setInput(), passes its slideshow container as the viewer's focusTarget (so arrow key navigation keeps working and modifier keys update the zoom cursor), and hides the viewer while a video is shown.

GestureEffect
ClickZoom in one level
Alt+click (Mac) / Ctrl+click (Win/Linux)Zoom out one level
Ctrl+scroll (Win/Linux) or Alt+scroll (Mac)Continuous zoom (~7.5% per tick)
Trackpad pinchZoom (reported as wheel + e.ctrlKey)
Right-clickContext menu (ImageViewerContextMenuId) with Copy
Copy (Cmd/Ctrl+C)Copies the current image as PNG

ImageViewer.setSource() decodes the image before swapping it in and resets the zoom to 'fit', so zoom always resets when navigating to a different image.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.