-
Notifications
You must be signed in to change notification settings - Fork 36.1k
edits: show diff for sensitive edit confirmations #276620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @roblourensMatched files:
|
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.
3e394c3 to
d64ae9b
Compare
There was a problem hiding this 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
MarkdownDiffBlockPartto render inline diff blocks in markdown with unified diff format support - Moved
EditorPoolandDiffEditorPoolto a shared module (chatContentCodePools.ts) and added them toIChatContentPartRenderContextfor better accessibility - Updated
BaseChatConfirmationWidgetto useChatMarkdownContentPartinstead 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 |
src/vs/workbench/contrib/chat/browser/chatContentParts/chatConfirmationWidget.ts
Show resolved
Hide resolved
…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 ...
Goes with microsoft/vscode-copilot-chat#1905
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.
MarkdownDiffBlockPartand allow consumers tooptionally enable that for handling of
diffblocks in their markdown.Closes #266574