RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/AGENTS.md/microsoft/vscode

AGENTS.md

src/vs/workbench/contrib/imageCarousel/AGENTS.md
AGENTS.md

Quality

54/100

Scores the file, not the repository.

Length

624 words

10 headings · 1 code blocks

Repository

188k

— · pushed 0 days ago

Last changed

3 days ago

First indexed 3 days ago.
microsoft/vscode/src/vs/workbench/contrib/imageCarousel/AGENTS.mdRawGitHub
1# Image Carousel
2 
3A 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.
4 
5## Architecture
6 
7The image carousel is a self-contained workbench contribution that follows the **custom editor** pattern:
8 
9- **URI scheme**: `vscode-image-carousel` (registered in `Schemas` in `src/vs/base/common/network.ts`) — used for `EditorInput.resource` identity.
10- **Direct editor input**: Callers create `ImageCarouselEditorInput` with a collection and open it directly via `IEditorService.openEditor()`.
11- **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.
12 
13## How to open the carousel
14 
15### From code (generic)
16 
17```ts
18const collection: IImageCarouselCollection = { id, title, sections: [{ title: '', images: [...] }] };
19const input = new ImageCarouselEditorInput(collection, startIndex);
20await editorService.openEditor(input, { pinned: true }, MODAL_GROUP);
21```
22 
23### From chat (via click handler)
24 
25Clicking 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`.
26 
27## Key design decisions
28 
29### Editor & lifecycle
30 
31- **Modal editor**: Opens in `MODAL_GROUP` (-4) as an overlay.
32- **Not restorable**: `canSerialize()` returns `false` — image data is in-memory only.
33- **Collection ID = chat session identity**: `sessionResource + '_carousel'` for stable dedup via `EditorInput.matches()`.
34- **Preview-gated**: `chat.imageCarousel.enabled` (default `false`, tagged `preview`). When off, clicks fall through to `openResource()`.
35- **Exact image matching**: Finds the clicked image within the constructed collection by URI first, then falls back to byte equality when needed.
36 
37### DOM & rendering
38 
39- **DOM construction**: Uses the `h()` helper from `vs/base/browser/dom` with `@name` references for declarative DOM — no imperative `document.createElement` calls.
40- **Bottom bar**: Caption and thumbnail sections are wrapped in a `div.bottom-bar` flex column below the image area.
41- **Stable DOM skeleton**: Builds DOM once per `setInput()`, updates only changing parts to avoid flash on navigation.
42- **Blob URL lifecycle**: Main image URLs tracked in `_imageDisposables` (revoked on nav), thumbnails in `_contentDisposables` (revoked on `clearInput()`).
43- **Focus border suppressed**: The slideshow container uses `outline: none !important` on `:focus` / `:focus-visible` to override the workbench's global `[tabindex="0"]` focus styles.
44 
45### Keyboard & focus
46 
47- **Keyboard parity**: Uses `registerOpenEditorListeners` (click, double-click, Enter, Space) matching other attachment widgets.
48- **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.
49 
50### Zoom
51 
52Zoom state is `ZoomScale = number | 'fit'` held in `_zoomScale`.
53 
54| Gesture | Effect |
55|---------|--------|
56| Click | Zoom in one level |
57| Alt+click (Mac) / Ctrl+click (Win/Linux) | Zoom out one level |
58| Ctrl+scroll (Win/Linux) or Alt+scroll (Mac) | Continuous zoom (~7.5% per tick) |
59| Trackpad pinch | Zoom (reported as `wheel` + `e.ctrlKey`) |
60 
61Predefined zoom levels: 10%, 20%, 30%, …, 100%, 150%, 200%, 300%, 500%, 700%, 1000%, 1500%, 2000%. Click cycles through these levels.
62 
63`_applyZoom(scale)` is the central method:
64- `'fit'` → adds `scale-to-fit` class, clears `img.style.zoom`, removes `.zoomed` from container
65- numeric → sets `img.style.zoom`, adds `.zoomed` on the container (enabling `overflow: auto` for panning with themed scrollbars), preserves scroll center using `dx/dy` ratio math, adds `pixelated` class at ≥ 3× zoom
66 
67Zoom always resets to `'fit'` when navigating to a different image.
68 
69Cursor changes to `zoom-out` when the zoom-out modifier key is held (via `.zoom-out` class on the container).
70 

Sections

  • Image Carousel
  • Architecture
  • How to open the carousel
  • From code (generic)
  • From chat (via click handler)
  • Key design decisions
  • Editor & lifecycle
  • DOM & rendering
  • Keyboard & focus
  • Zoom

Stack — with the evidence

typescript

(1.00)

node

(1.00)

javascript

(0.60)

eslint

(0.60)

github-actions

(0.60)

Format

AGENTS.md

A plain-markdown README for coding agents, deliberately unopinionated: no frontmatter, no globs, no vendor keys. That minimalism is why it became the one file a dozen different agents will read, and why it carries the least per-file targeting power of any format here.

What the corpus says about it

Repository

Owner
microsoft
Language
—
License
—
Archived
no

All configs in this repo

Also in microsoft/vscode

Diff this repo’s formats

One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
microsoft/vscode.github/instructions/accessibility.instructions.md · 188kCopilot instructionstypescriptnode+3styledo-not61/1003 days ago
microsoft/vscode.github/instructions/chat.instructions.md · 188kCopilot instructionstypescriptnode+3no sections39/1003 days ago
microsoft/vscodeextensions/copilot/src/platform/authentication/common/AGENTS.md · 188kAGENTS.mdtypescriptnode+3archsecurityagent-behaviour58/1003 days ago
microsoft/vscode.github/copilot-instructions.md · 188kCopilot instructionstypescriptnode+3stylearchtypesui+274/1002 days ago
microsoft/vscode.github/instructions/agentHostTesting.instructions.md · 188kCopilot instructionstypescriptnode+3teststyletesting-strategyagent-behaviour55/1003 days ago
microsoft/vscode.github/instructions/ai-customization.instructions.md · 188kCopilot instructionstypescriptnode+3archtypesui58/1003 days ago
microsoft/vscode.github/instructions/best-practices.instructions.md · 188kCopilot instructionstypescriptnode+3styleui60/1003 days ago
microsoft/vscode.github/instructions/buildNext.instructions.md · 188kCopilot instructionstypescriptnode+3setupbuildtestarch+166/1003 days ago
microsoft/vscode.github/instructions/coding-guidelines.instructions.md · 188kCopilot instructionstypescriptnode+3styletypesuidocs60/1003 days ago
microsoft/vscode.github/instructions/committing.instructions.md · 188kCopilot instructionstypescriptnode+3do-not23/1003 days ago
microsoft/vscode.github/instructions/css-best-practices.instructions.md · 188kCopilot instructionstypescriptnode+3styleui29/1003 days ago
microsoft/vscode.github/instructions/design-philosophy.instructions.md · 188kCopilot instructionstypescriptnode+3style34/1003 days ago
microsoft/vscode.github/instructions/design-tokens.instructions.md · 188kCopilot instructionstypescriptnode+3styledo-not65/1003 days ago
microsoft/vscode.github/instructions/disposable.instructions.md · 188kCopilot instructionstypescriptnode+3no sections16/1003 days ago
microsoft/vscode.github/instructions/interactive.instructions.md · 188kCopilot instructionstypescriptnode+3ui43/1003 days ago
microsoft/vscode.github/instructions/kusto.instructions.md · 188kCopilot instructionstypescriptnode+3agent-behaviour16/1003 days ago
microsoft/vscode.github/instructions/learnings.instructions.md · 188kCopilot instructionstypescriptnode+3style40/1003 days ago
microsoft/vscode.github/instructions/notebook.instructions.md · 188kCopilot instructionstypescriptnode+3no sections48/1003 days ago
microsoft/vscode.github/instructions/observables.instructions.md · 188kCopilot instructionstypescriptnode+3no sections40/1003 days ago
microsoft/vscode.github/instructions/oss-third-party-notices.instructions.md · 188kCopilot instructionstypescriptnode+3buildgitdependenciesdeployment+165/1003 days ago
Diff against .github/instructions/accessibility.instructions.md Diff against .github/instructions/chat.instructions.md Diff against extensions/copilot/src/platform/authentication/common/AGENTS.md Diff against .github/copilot-instructions.md Diff against .github/instructions/agentHostTesting.instructions.md Diff against .github/instructions/ai-customization.instructions.md Diff against .github/instructions/best-practices.instructions.md Diff against .github/instructions/buildNext.instructions.md Diff against .github/instructions/coding-guidelines.instructions.md Diff against .github/instructions/committing.instructions.md Diff against .github/instructions/css-best-practices.instructions.md Diff against .github/instructions/design-philosophy.instructions.md Diff against .github/instructions/design-tokens.instructions.md Diff against .github/instructions/disposable.instructions.md Diff against .github/instructions/interactive.instructions.md Diff against .github/instructions/kusto.instructions.md Diff against .github/instructions/learnings.instructions.md Diff against .github/instructions/notebook.instructions.md Diff against .github/instructions/observables.instructions.md Diff against .github/instructions/oss-third-party-notices.instructions.md

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
n8n-io/n8npackages/@n8n/agents/AGENTS.md · 199kAGENTS.mdtypescriptlangchain+16buildteststylearch+3100/1003 days ago
aaif-goose/gooseAGENTS.md · 52kAGENTS.mdrusttypescript+2setupbuildtestlint-format+6100/1003 days ago
wpscanteam/wpscanAGENTS.md · 9.7kAGENTS.mdrubyvue+3setupbuildteststyle+6100/1002 days ago
mui/material-uiAGENTS.md · 99kAGENTS.mdtypescriptjavascript+13setupbuildtestlint-format+9100/1003 days ago
SkeneTechnologies/skene-cookbookAGENTS.md · 51AGENTS.mdpythoneslint+4setupbuildtestlint-format+7100/1002 days ago
duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70AGENTS.mdtypescriptjavascript+5buildteststylearch+3100/1003 days ago
trick77/agents-md-syncAGENTS.md · 2AGENTS.mdtypescriptnode+4setupbuildteststyle+5100/1003 days ago
TryGhost/Ghoste2e/AGENTS.md · 55kAGENTS.mdtypescriptjavascript+12setupteststylearch+2100/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack