Skip to content

Show a warning when showing the rendered markdown diff#317829

Merged
mjbvz merged 2 commits into
mainfrom
dev/mjbvz/main-llama
May 21, 2026
Merged

Show a warning when showing the rendered markdown diff#317829
mjbvz merged 2 commits into
mainfrom
dev/mjbvz/main-llama

Conversation

@mjbvz
Copy link
Copy Markdown
Collaborator

@mjbvz mjbvz commented May 21, 2026

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

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
Copilot AI review requested due to automatic review settings May 21, 2026 18:47
@mjbvz mjbvz enabled auto-merge May 21, 2026 18:48
Copy link
Copy Markdown
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

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 RenderedDiffWarningManager that 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 in MarkdownPreviewManager to drive the warning UI.
  • Minor cleanup in the document renderer (trailing comma + narrow ExtensionContext typing + 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

Comment thread extensions/markdown-language-features/src/preview/renderedDiffWarning.ts Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@mjbvz mjbvz merged commit 507d09d into main May 21, 2026
25 checks passed
@mjbvz mjbvz deleted the dev/mjbvz/main-llama branch May 21, 2026 20:46
@vs-code-engineering vs-code-engineering Bot added this to the 1.122.0 milestone May 21, 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.

3 participants