Skip to content

Conversation

@connor4312
Copy link
Member

@connor4312 connor4312 commented Nov 10, 2025

Goes with microsoft/vscode-copilot-chat#1905

  • Adds common markdown rendering to the IChatContentPartRenderContext.
    These have to get passed down everywhere that can render markdown
    'properly' and so this made sense, though we may want to revisit this
    and make them actual dependency-injected services with scope
    instantiation service.
  • Add a new basic MarkdownDiffBlockPart and allow consumers to
    optionally enable that for handling of diff blocks in their markdown.
  • Some further tweaks to deal with md/code in nested blocks.

Closes #266574

image

Copilot AI review requested due to automatic review settings November 10, 2025 23:14
@connor4312 connor4312 enabled auto-merge (squash) November 10, 2025 23:14
@connor4312 connor4312 self-assigned this Nov 10, 2025
@vs-code-engineering
Copy link

vs-code-engineering bot commented Nov 10, 2025

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@roblourens

Matched files:

  • src/vs/workbench/contrib/chat/browser/chatListRenderer.ts

@vs-code-engineering vs-code-engineering bot added this to the November 2025 milestone Nov 10, 2025
Copilot finished reviewing on behalf of connor4312 November 10, 2025 23:18
Goes with microsoft/vscode-copilot-chat#1905

- Adds common markdown rendering to the `IChatContentPartRenderContext`.
  These have to get passed down everywhere that can render markdown
  'properly' and so this made sense, though we may want to revisit this
  and make them actual dependency-injected services with scope
  instantiation service.
- Add a new basic `MarkdownDiffBlockPart` and allow consumers to
  optionally enable that for handling of `diff` blocks in their markdown.
- Some further tweaks to deal with md/code in nested blocks.
@connor4312 connor4312 force-pushed the connor4312/edit-confirmation-diffs branch from 3e394c3 to d64ae9b Compare November 10, 2025 23:19
Copy link
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

This PR adds support for displaying diffs in sensitive edit confirmations by enhancing markdown rendering capabilities across the chat interface.

Key Changes

  • Added MarkdownDiffBlockPart to render inline diff blocks in markdown with unified diff format support
  • Moved EditorPool and DiffEditorPool to a shared module (chatContentCodePools.ts) and added them to IChatContentPartRenderContext for better accessibility
  • Updated BaseChatConfirmationWidget to use ChatMarkdownContentPart instead of basic markdown rendering to support code blocks and diffs in confirmation messages

Reviewed Changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
chatDiffBlockPart.ts New file introducing parseUnifiedDiff function and MarkdownDiffBlockPart class for rendering inline diffs in markdown code blocks
chatContentParts.ts Extended IChatContentPartRenderContext with editorPool, diffEditorPool, codeBlockModelCollection, currentWidth, and codeBlockStartIndex fields
chatContentCodePools.ts New file consolidating EditorPool and DiffEditorPool classes moved from chatMarkdownContentPart.ts and chatTextEditContentPart.ts
chatMarkdownContentPart.ts Added diff block rendering support via allowInlineDiffs option; removed EditorPool class (moved to shared module)
chatConfirmationWidget.ts Updated renderMessage to use ChatMarkdownContentPart for proper code block/diff support; added codeblocks and codeblocksPartId getters
chatListRenderer.ts Updated to populate new IChatContentPartRenderContext fields and removed duplicate getCodeBlockStartIndex method
codeBlockPart.ts Added horizontalPadding and isReadOnly fields to ICodeCompareBlockData; updated layout logic to account for horizontal padding
chatTextEditContentPart.ts Removed DiffEditorPool class (moved to shared module); cleaned up imports
chatToolPostExecuteConfirmationPart.ts Removed editorPool and currentWidthDelegate parameters; uses context fields instead
chatToolInputOutputContentPart.ts Removed editorPool and width parameters; uses context fields instead
chatToolOutputContentSubPart.ts Removed editorPool and width parameters; uses context fields instead
chatInputOutputMarkdownProgressPart.ts Removed editorPool and currentWidthDelegate() call from constructor invocation
chatToolInvocationPart.ts Removed editorPool and currentWidthDelegate arguments when creating post-confirmation parts
chatToolConfirmationSubPart.ts Added trailing comma for consistency
chatTerminalToolProgressPart.ts Updated import to use EditorPool from shared module
chatTerminalToolConfirmationSubPart.ts Updated import to use EditorPool from shared module; added trailing comma
chatExtensionsInstallToolSubPart.ts Changed codeblocks to getter returning fallback empty array; changed codeblocksPartId to getter with fallback
chatElicitationContentPart.ts Added codeblocks and codeblocksPartId getters that delegate to confirmation widget
chatToolInvocationSubPart.ts Changed codeblocksPartId from readonly field to getter
chatConfirmationWidget.css Added CSS rule to hide toolbar for diff blocks shown within confirmations

@connor4312 connor4312 merged commit e75b176 into main Nov 11, 2025
28 checks passed
@connor4312 connor4312 deleted the connor4312/edit-confirmation-diffs branch November 11, 2025 01:36
Kosta-Github added a commit to Kosta-Github/vscode that referenced this pull request Nov 11, 2025
…nal-tooltips-markdown

* 'main' of https://github.com/microsoft/vscode: (56 commits)
  edits: show diff for sensitive edit confirmations (microsoft#276620)
  Enable Back button on the Manage Accounts picker (microsoft#276622)
  Ignore obsolete chat content parts when loading persisted session (microsoft#276615)
  settings cleanup (microsoft#276602)
  Remove unused `args: any` parameter
  Terminal suggest - include persistent options in suggestions and improve suggestion grouping (microsoft#276409)
  fix selections not being added (microsoft#276600)
  Embed AI search into the existing search view message (microsoft#276586)
  Cleanup some eslint exemptions (microsoft#276581)
  fix microsoft#276579 (microsoft#276590)
  SCM - cleanup some more eslint rules (microsoft#276571)
  Bump gpu types and skip lib check for gpu typing issue
  Fix in smoke tests
  Remove `forChatSessionTypeAndId`
  Fix one more import
  detect `press any/a key` and ask if user wants to send `a` to terminal (microsoft#276554)
  Filter subagent and todo tools from subagent requests (microsoft#276553)
  Expand hover setting to allow for key modifier mode (microsoft#274001)
  Allow partial monacoEnvironment.getWorker/getWorkerUrl
  Update imports
  ...
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.

Copilot: Sensitive Files Diff Preview

3 participants