Show a warning when showing the rendered markdown diff#317829
Merged
Conversation
Our current implementation has some bugs that can hide changes. However even after fixing these, I'm not 100% confident a unexpected change wont sneak through. Best to make users aware of this while also trying to prevent this
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a user-facing warning when viewing rendered Markdown diffs to reduce the risk of hidden/unnoticed changes in the rendered diff view. This integrates with the Markdown preview lifecycle so the warning appears only when a diff preview is active, and provides a “Don’t Show Again” option.
Changes:
- Introduces a
RenderedDiffWarningManagerthat shows a status bar warning while a rendered diff preview is active and a one-time warning notification. - Tracks whether a preview is a diff view (
isDiffView) and wires active-preview changes inMarkdownPreviewManagerto drive the warning UI. - Minor cleanup in the document renderer (trailing comma + narrow
ExtensionContexttyping + comment wording update).
Show a summary per file
| File | Description |
|---|---|
| extensions/markdown-language-features/src/preview/renderedDiffWarning.ts | New manager to show status bar + notification warning for rendered markdown diffs, with suppression stored in memento. |
| extensions/markdown-language-features/src/preview/previewManager.ts | Injects and drives the warning manager based on the active preview and whether it’s a diff view. |
| extensions/markdown-language-features/src/preview/preview.ts | Adds isDiffView tracking and exposes it through IManagedMarkdownPreview implementations. |
| extensions/markdown-language-features/src/preview/documentRenderer.ts | Small formatting fix and narrows context type to only extensionUri; updates comment wording. |
| extensions/markdown-language-features/src/extension.shared.ts | Passes context.workspaceState into MarkdownPreviewManager to back warning suppression/one-time state. |
Copilot's findings
- Files reviewed: 5/5 changed files
- Comments generated: 1
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
vijayupadya
approved these changes
May 21, 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.
Our current implementation has some bugs that can hide changes. However even after fixing these, I'm not 100% confident a unexpected change wont sneak through. Best to make users aware of this while also trying to prevent this