chat: gate structured customization preview behind a setting (default off)#314416
Merged
joshspicer merged 4 commits intomainfrom May 5, 2026
Merged
chat: gate structured customization preview behind a setting (default off)#314416joshspicer merged 4 commits intomainfrom
joshspicer merged 4 commits intomainfrom
Conversation
… off) Adds chat.customizations.structuredPreview.enabled (boolean, default false, tag 'preview') to gate the structured markdown preview introduced in #312545. When disabled (the default), the AI Customizations editor falls back to the previous raw-only embedded code editor and hides the Preview/Raw toggle button. When enabled, the editor defaults to the structured preview view. Runtime toggling is handled via an onDidChangeConfiguration listener that snaps the display mode back to raw and clears the preview when the setting is turned off, or triggers a preview re-render when it is turned on with an item already open. Existing component fixtures and unit tests are updated to opt-in to the setting so the preview-first screenshot fixtures remain stable. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Screenshot ChangesBase: Changed (17) |
roblourens
previously approved these changes
May 5, 2026
Adds a unit test that verifies disabling chat.customizations.structuredPreview.enabled at runtime forces the editor back to raw mode and hides the toggle button, addressing review feedback from the Copilot reviewer. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
roblourens
previously approved these changes
May 5, 2026
The initial sanity assertion in the runtime-toggle test was checking for 'View Raw' but the test editor has currentEditingReadOnly=false, so getEditorModeButtonLabel() returns 'Edit' when in preview mode. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Yoyokrazy
previously approved these changes
May 5, 2026
clearEditorPreview() calls this.editorPreviewDisposables.clear() but the test stub only provided add() and dispose(). Add clear() to the stub so the runtime-toggle test does not throw. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
dmitrivMS
approved these changes
May 5, 2026
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.
Adds a new setting
chat.customizations.structuredPreview.enabled(boolean, defaultfalse, tagpreview) to gate the structured markdown preview introduced in #312545.What changed
chat.customizations.structuredPreview.enabledregistered inChatConfigurationandchat.contribution.ts.isStructuredPreviewSupported()inAICustomizationManagementEditornow also checks the setting — when it's off the Preview/Raw toggle button is hidden and the editor opens directly in the raw embedded code editor.onStructuredPreviewSettingChanged()handler wired into the existingonDidChangeConfigurationlistener handles runtime toggling: snaps the mode back to raw and clears the preview when disabled; re-schedules a preview render when re-enabled with a file already open.configurationServicestub (default-on so existing assertions keep exercising the preview path) and a new regression test confirms the button is hidden when the setting is off.AgentsItemPreview,AgentsItemRaw,BuiltinSkillItemPreview, andBuiltinSkillItemRawscreenshot fixtures remain stable.Why
The structured preview is a new feature that should be rolled out gradually. Defaulting to off lets us keep the code in main while giving users and teams control over when they adopt it.
Testing
npm run compile-check-ts-native✅npm run valid-layers-check✅