Skip to content

chat: replace structured customization preview with markdown renderer, remove feature flag#314851

Draft
joshspicer wants to merge 2 commits intomainfrom
agents/smart-markdown-rendering-update
Draft

chat: replace structured customization preview with markdown renderer, remove feature flag#314851
joshspicer wants to merge 2 commits intomainfrom
agents/smart-markdown-rendering-update

Conversation

@joshspicer
Copy link
Copy Markdown
Member

Summary

Removes the chat.customizations.structuredPreview.enabled setting and replaces the custom front-matter/issues preview UI with a simple markdown render using IMarkdownRendererService — the same renderer used throughout VS Code.

Previously, when the setting was enabled, clicking a markdown customization file (agent, skill, instructions, prompt) in the AI Customizations editor would show:

  • A bespoke front-matter rows section (key/value pairs with hover help buttons)
  • A header issues box (for YAML parse errors)
  • A rendered markdown body

Now the preview renders the full markdown body directly, without the front-matter or issues sections. The preview/raw toggle button is preserved and still defaults to preview for the supported file types.

Changes

  • src/vs/workbench/contrib/chat/common/constants.ts — Remove ChatCustomizationsStructuredPreviewEnabled enum entry
  • src/vs/workbench/contrib/chat/browser/chat.contribution.ts — Remove config registration for the setting
  • src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.ts:
    • Remove renderPreviewIssues, renderPreviewFrontMatter, renderPreviewAttribute, stringifyPreviewValue, toPreviewObject, onStructuredPreviewSettingChanged
    • Remove editorPreviewIssuesContainer and editorPreviewFrontMatterContainer DOM fields
    • Remove unused imports (IHeaderAttribute, IValue, getAttributeDefinition, getTarget, Target)
    • isStructuredPreviewSupported no longer checks the removed setting — preview is always on for supported file types
  • src/vs/workbench/contrib/chat/test/browser/aiCustomization/aiCustomizationManagementEditor.test.ts — Remove tests that were specific to the old structured preview (front-matter help button, setting-off guards); keep editor-mode-button label/tooltip tests
  • src/vs/workbench/test/browser/componentFixtures/sessions/aiCustomizationManagementEditor.fixture.ts — Remove the setting override; fixtures use default config
  • src/vs/sessions/AI_CUSTOMIZATIONS.md — Update documentation section

Testing

  • npm run compile-check-ts-native passes
  • Hygiene check passes

Remove the 'chat.customizations.structuredPreview.enabled' setting and the
custom front-matter/issues UI it gated. The customization editor preview now
renders the markdown body directly via  the sameIMarkdownRendererService
renderer used everywhere else in VS  instead of a bespoke structuredCode
view with front-matter rows and error boxes.

The preview/raw toggle button is preserved and still defaults to preview for
agent, skill, instructions, and prompt files.

- Remove ChatCustomizationsStructuredPreviewEnabled enum entry and config reg
- Drop renderPreviewIssues, renderPreviewFrontMatter, renderPreviewAttribute,
  stringifyPreviewValue, toPreviewObject, and onStructuredPreviewSettingChanged
- Remove editorPreviewIssuesContainer and editorPreviewFrontMatterContainer
- Remove unused imports (IHeaderAttribute, IValue, getAttributeDefinition, getTarget)
- Update tests and fixture; update AI_CUSTOMIZATIONS.md doc

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 6, 2026 21:28
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

This PR simplifies the Chat Customizations management editor’s markdown customization preview by removing the chat.customizations.structuredPreview.enabled feature flag and replacing the bespoke structured front-matter/issues UI with VS Code’s standard IMarkdownRendererService rendering of the markdown body.

Changes:

  • Removed the chat.customizations.structuredPreview.enabled configuration key (enum entry + configuration registration).
  • Simplified AICustomizationManagementEditor preview rendering to only render the parsed markdown body via IMarkdownRendererService (no front-matter rows or header issue box).
  • Updated tests/fixtures/docs to reflect the always-on rendered preview behavior for supported markdown customization file types.
Show a summary per file
File Description
src/vs/workbench/test/browser/componentFixtures/sessions/aiCustomizationManagementEditor.fixture.ts Drops the structured-preview config override from fixtures now that preview behavior is no longer flag-gated.
src/vs/workbench/contrib/chat/test/browser/aiCustomization/aiCustomizationManagementEditor.test.ts Removes tests tied to the old structured preview UI/setting; keeps mode button label/tooltip coverage.
src/vs/workbench/contrib/chat/common/constants.ts Removes the ChatCustomizationsStructuredPreviewEnabled enum entry.
src/vs/workbench/contrib/chat/browser/chat.contribution.ts Removes configuration registration for the deleted setting.
src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.ts Removes structured preview UI pieces and renders only the markdown body via IMarkdownRendererService; updates tooltip copy.
src/vs/sessions/AI_CUSTOMIZATIONS.md Updates Sessions documentation to describe the rendered markdown preview behavior.

Copilot's findings

  • Files reviewed: 6/6 changed files
  • Comments generated: 1

Comment on lines 1963 to 1968
private isStructuredPreviewSupported(promptType: PromptsType | undefined): boolean {
if (this.configurationService.getValue<boolean>(ChatConfiguration.ChatCustomizationsStructuredPreviewEnabled) !== true) {
return false;
}
return promptType === PromptsType.agent
|| promptType === PromptsType.skill
|| promptType === PromptsType.instructions
|| promptType === PromptsType.prompt;
}
@OrenMe
Copy link
Copy Markdown
Contributor

OrenMe commented May 7, 2026

Removing the dedicated frontmatter section 😥?

Add 'chat.customizations.markdownPreview.enabled' (default: true) to let
users disable the rendered markdown preview in the AI Customizations editor.
When disabled the editor falls back to the raw code editor view, matching the
previous behaviour before the preview was introduced.

- Add ChatCustomizationsMarkdownPreviewEnabled enum entry and config registration
- Check setting in isStructuredPreviewSupported
- Add onMarkdownPreviewSettingChanged handler and wire up config listener
- Add test coverage for the setting toggle

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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