Repository navigation
Remove image preview in favor of core image previewer - #341900
Merged
Logan Ramos (lramos15) merged 4 commits intoOct 20, 2026
Merged
Conversation
Logan Ramos (lramos15)
requested review from
TylerLeonhardt,
Alexandru Dima (alexdima),
Alex Ross (alexr00) and
SteVen Batten (sbatten)
as code owners
October 16, 2026 00:01
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved copying, refresh, navigation, and accessibility regressions prevent approval.
6 open findings
Web workbench no longer copies images with Cmd/Ctrl+C · New Stale image loads commit after navigation · New Media previews miss uncorrelated file change events · New Removing worker encoding delays image copying · New Viewer hides keyboard focus indicator · New Media diff status bar information is cleared · New
What changed in this PR
Moves image, audio, and video previews from the bundled extension into the workbench, sharing image rendering with the carousel.
Changes:
- Adds core preview editors, commands, status information, and legacy-editor migration.
- Shares image zooming and copying, with browser and native clipboard support.
- Removes the extension and updates tests, build configuration, and localization.
| File | Description |
|---|---|
| src/vs/workbench/workbench.common.main.ts | Loads core media previews. |
| src/vs/workbench/test/electron-browser/workbenchTestServices.ts | Adds native clipboard stub. |
| src/vs/workbench/test/browser/componentFixtures/imageCarousel.fixture.ts | Provides context-menu service. |
| src/vs/workbench/services/clipboard/electron-browser/clipboardService.ts | Forwards image writes. |
| src/vs/workbench/contrib/mediaPreview/test/common/mediaPreview.test.ts | Tests LFS detection. |
| src/vs/workbench/contrib/mediaPreview/test/browser/mediaPreviewErrors.test.ts | Tests text-editor fallback. |
| src/vs/workbench/contrib/mediaPreview/test/browser/mediaPreviewEditorInputs.test.ts | Tests input behavior and saving. |
| src/vs/workbench/contrib/mediaPreview/test/browser/imageViewer.test.ts | Tests shared viewer behavior. |
| src/vs/workbench/contrib/mediaPreview/test/browser/imagePreviewEditor.test.ts | Tests asynchronous image reloads. |
| src/vs/workbench/contrib/mediaPreview/common/mediaPreview.ts | Defines preview identifiers and helpers. |
| src/vs/workbench/contrib/mediaPreview/browser/mediaPreviewStatusBar.ts | Displays preview metadata. |
| src/vs/workbench/contrib/mediaPreview/browser/mediaPreviewSaveAs.ts | Implements media Save As. |
| src/vs/workbench/contrib/mediaPreview/browser/mediaPreviewErrors.ts | Provides text-editor recovery. |
| src/vs/workbench/contrib/mediaPreview/browser/mediaPreviewActions.ts | Registers preview actions. |
| src/vs/workbench/contrib/mediaPreview/browser/mediaPreview.contribution.ts | Registers editors and migration. |
| src/vs/workbench/contrib/mediaPreview/browser/mediaPlayerEditorInput.ts | Implements audio/video previews. |
| src/vs/workbench/contrib/mediaPreview/browser/media/imageViewer.css | Styles the shared viewer. |
| src/vs/workbench/contrib/mediaPreview/browser/media/imagePreviewEditor.css | Styles image previews. |
| src/vs/workbench/contrib/mediaPreview/browser/imageViewer.ts | Shares rendering, zoom, and copying. |
| src/vs/workbench/contrib/mediaPreview/browser/imagePreviewEditorInput.ts | Defines image editor inputs. |
| src/vs/workbench/contrib/mediaPreview/browser/imagePreviewEditor.ts | Loads and watches image resources. |
| src/vs/workbench/contrib/imageCarousel/browser/media/imageCarousel.css | Uses shared viewer styling. |
| src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditor.ts | Adopts the shared viewer. |
| src/vs/workbench/contrib/imageCarousel/AGENTS.md | Documents shared viewer behavior. |
| src/vs/sessions/sessions.common.main.ts | Enables previews in Agents Window. |
| src/vs/platform/native/electron-main/nativeHostMainService.ts | Writes native clipboard images. |
| src/vs/platform/native/common/native.ts | Extends native clipboard contract. |
| src/vs/platform/clipboard/test/common/testClipboardService.ts | Records image writes in tests. |
| src/vs/platform/clipboard/common/clipboardService.ts | Adds image-writing API. |
| src/vs/platform/clipboard/browser/clipboardService.ts | Implements browser image writes. |
| src/vs/base/common/network.ts | Adds Git URI scheme constant. |
| extensions/vscode-api-tests/src/singlefolder-tests/env.test.ts | Replaces removed extension reference. |
| extensions/media-preview/tsconfig.json | Removes extension compiler configuration. |
| extensions/media-preview/tsconfig.browser.json | Removes browser compiler configuration. |
| extensions/media-preview/src/videoPreview.ts | Removes extension video provider. |
| extensions/media-preview/src/util/uuid.ts | Removes duplicated UUID helper. |
| extensions/media-preview/src/util/dom.ts | Removes extension HTML helper. |
| extensions/media-preview/src/util/dispose.ts | Removes extension disposal helper. |
| extensions/media-preview/src/ownedStatusBarEntry.ts | Removes extension status ownership. |
| extensions/media-preview/src/mediaPreview.ts | Removes extension preview base. |
| extensions/media-preview/src/imagePreview/zoomStatusBarEntry.ts | Removes extension zoom status. |
| extensions/media-preview/src/imagePreview/sizeStatusBarEntry.ts | Removes extension dimension status. |
| extensions/media-preview/src/imagePreview/index.ts | Removes extension image provider. |
| extensions/media-preview/src/extension.ts | Removes extension activation. |
| extensions/media-preview/src/binarySizeStatusBarEntry.ts | Removes extension file-size status. |
| extensions/media-preview/src/audioPreview.ts | Removes extension audio provider. |
| extensions/media-preview/README.md | Removes extension documentation. |
| extensions/media-preview/package.nls.json | Removes extension localization strings. |
| extensions/media-preview/package.json | Removes extension manifest. |
| extensions/media-preview/package-lock.json | Removes extension dependency lockfile. |
| extensions/media-preview/media/videoPreview.js | Removes video webview script. |
| extensions/media-preview/media/videoPreview.css | Removes video webview styles. |
| extensions/media-preview/media/loading.svg | Removes loading asset. |
| extensions/media-preview/media/loading-hc.svg | Removes high-contrast loading asset. |
| extensions/media-preview/media/loading-dark.svg | Removes dark loading asset. |
| extensions/media-preview/media/imagePreview.js | Removes image webview implementation. |
| extensions/media-preview/media/imagePreview.css | Removes image webview styles. |
| extensions/media-preview/media/audioPreview.js | Removes audio webview script. |
| extensions/media-preview/media/audioPreview.css | Removes audio webview styles. |
| extensions/media-preview/esbuild.mts | Removes Node bundling configuration. |
| extensions/media-preview/esbuild.browser.mts | Removes browser bundling configuration. |
| extensions/media-preview/.vscodeignore | Removes packaging exclusions. |
| extensions/media-preview/.npmrc | Removes extension npm configuration. |
| eslint.config.js | Removes extension entries; corrects comment. |
| build/npm/dirs.ts | Removes extension installation directory. |
| build/lib/i18n.resources.json | Registers core preview localization. |
| build/gulpfile.extensions.ts | Removes extension compilation entry. |
| .eslint-allowed-javascript-files | Removes deleted script exemptions. |
Files not reviewed (1)
- extensions/media-preview/package-lock.json: Generated file
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Logan Ramos (lramos15)
marked this pull request as draft
October 16, 2026 00:19
Encode copied images in a worker and pass PNG sources through as is, handle the browser's native copy event, discard stale carousel image loads, refresh previews on uncorrelated file changes from extension file systems, keep the keyboard focus ring, and show status bar info for the focused side of media diffs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Logan Ramos (lramos15)
force-pushed
the
lramos15/agents/image-preview-context-menu-fix
branch
from
October 16, 2026 00:36
4425e2c to
6d61fcd
Compare
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Benjamin Christopher Simmonds (@benibenj)Matched files:
|
Alexandru Dima (alexdima)
previously approved these changes
Oct 20, 2026
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved correctness and keyboard-accessibility regressions remain in media previews and image diffs.
6 open issues
Handle keyboard context-menu requests on the focus target · New Copy the cached blob currently displayed for URI-backed images · New Copy the image blob currently displayed in the preview · New Render Git LFS pointer errors without hiding valid diff media · New Enable zoom commands for focused image diff panes · New Resolve last-focused image pane for zoom level selection · New
6 resolved since last review
1 file not reviewed
extensions/media-preview/package-lock.json: Generated file
Review effort: Balanced
Open the image context menu from the keyboard on the viewer's focus target, copy the image that is displayed rather than re-reading the file, show Git LFS and load errors within the preview so the other side of a diff stays visible, and make the zoom actions and status bar follow the focused side of image diffs. Tests now await signals or use faked timers instead of polling. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Dmitriy Vasyura (dmitrivMS)
approved these changes
Oct 20, 2026
Ben Villalobos (benvillalobos)
approved these changes
Oct 20, 2026
roblourens
approved these changes
Oct 20, 2026
TylerLeonhardt
approved these changes
Oct 20, 2026
Logan Ramos (lramos15)
deleted the
lramos15/agents/image-preview-context-menu-fix
branch
October 20, 2026 18:06
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.


This helps reduce duplication across image carousel and the image preview extension
The built-in
media-previewextension is removed. Its image, video and audio previews now live in core undersrc/vs/workbench/contrib/mediaPreview:ImageViewer: zoom, a context menu and Copy. Used by both the new core image editor and the image carousel, so the carousel now has a context menu.blob:media sources.IClipboardService.writeImage, because the workbench window can't useclipboard-sanitized-write. Copy works with Cmd/Ctrl+C through the copy command and the browser's nativecopyevent.imagePreview.previewEditor,vscode.videoPreviewandvscode.audioPrevieware kept, and editors restored from the old custom editor are migrated.How to test
Validation
npm run typecheck-client: passednpm run eslint -- <changed files>: passednpm run valid-layers-check: passed./scripts/test.sh --reporter dotwith the 5mediaPreviewtest files and the 2imageCarouseltest files: 40 passing