feat(chat): add 'Export Chat as Markdown' command#295128
Open
n24q02m wants to merge 1 commit intomicrosoft:mainfrom
Open
feat(chat): add 'Export Chat as Markdown' command#295128n24q02m wants to merge 1 commit intomicrosoft:mainfrom
n24q02m wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Add a new action 'workbench.action.chat.exportAsMarkdown' that exports the current chat session as a formatted Markdown file (.md). The command: - Appears in the command palette (F1) - Shows in the Chat context menu and Chat title bar menu - Uses the existing stringifyItem() utility for consistent formatting - Filters out system-filtered responses - Opens a Save dialog with .md filter Also adds smoke tests verifying the Export Markdown, Export JSON, and Import Chat commands are discoverable in the command palette. Fixes microsoft#276629
Author
|
@microsoft-github-policy-service agree |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new Export Chat as Markdown command that allows users to export the current chat session as a formatted .md file, complementing the existing JSON export functionality. The implementation reuses existing markdown formatting logic for consistency with the copy commands.
Changes:
- Added a new
ExportChatAsMarkdownActionwith menu placements in the chat context menu and title bar - Created smoke tests to verify Export Markdown, Export JSON, and Import Chat commands are discoverable
- Reused existing
stringifyItem()utility for consistent markdown formatting
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/smoke/src/main.ts | Added import and setup call for new chat export markdown smoke tests |
| test/smoke/src/areas/chat/chatExportMarkdown.test.ts | New smoke test file verifying discoverability of export/import commands |
| src/vs/workbench/contrib/chat/browser/actions/chatImportExport.ts | Added ExportChatAsMarkdownAction with markdown export logic, imports, and menu configuration |
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.
Fixes #276629
Adds a new Export Chat as Markdown command (
workbench.action.chat.exportAsMarkdown) that allows users to export the current chat session as a formatted.mdfile.Changes
New Action:
ExportChatAsMarkdownActionworkbench.action.chat.exportAsMarkdownstringifyItem()utility for consistent Markdown formatting.mdfilter, defaulting to a sanitized session titleSmoke Tests
How It Works
The implementation follows the same pattern as the existing
ExportChatAction(JSON export):IChatServicestringifyItem(request)andstringifyItem(response)to produce Markdown text.mdfilter)IFileServiceTesting