Skip to content

chat: gate structured customization preview behind a setting (default off)#314416

Merged
joshspicer merged 4 commits intomainfrom
agents/feature-gate-setting-default-off
May 5, 2026
Merged

chat: gate structured customization preview behind a setting (default off)#314416
joshspicer merged 4 commits intomainfrom
agents/feature-gate-setting-default-off

Conversation

@joshspicer
Copy link
Copy Markdown
Member

Adds a new setting chat.customizations.structuredPreview.enabled (boolean, default false, tag preview) to gate the structured markdown preview introduced in #312545.

What changed

  • New setting chat.customizations.structuredPreview.enabled registered in ChatConfiguration and chat.contribution.ts.
  • The single chokepoint isStructuredPreviewSupported() in AICustomizationManagementEditor now 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.
  • A new onStructuredPreviewSettingChanged() handler wired into the existing onDidChangeConfiguration listener 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.
  • Unit tests updated to provide a configurationService stub (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.
  • Component fixtures updated to opt-in to the setting so AgentsItemPreview, AgentsItemRaw, BuiltinSkillItemPreview, and BuiltinSkillItemRaw screenshot 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
  • Pre-commit hygiene hook ✅

… 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>
Copilot AI review requested due to automatic review settings May 5, 2026 16:36
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Screenshot Changes

Base: 98b4a731 Current: 89e566e1

Changed (17)

chat/input/chatInput/Default/Dark
Before After
before after
chat/input/chatInput/Default/Light
Before After
before after
chat/input/chatInput/WithArtifacts/Dark
Before After
before after
chat/input/chatInput/WithFileChanges/Dark
Before After
before after
chat/input/chatInput/WithFileChanges/Light
Before After
before after
chat/input/chatInput/WithTodos/Dark
Before After
before after
chat/input/chatInput/WithTodos/Light
Before After
before after
chat/input/chatInput/WithTodosAndFileChanges/Light
Before After
before after
chat/input/chatInput/WithArtifactsAndFileChanges/Dark
Before After
before after
chat/input/chatInput/WithArtifactsAndFileChanges/Light
Before After
before after
chat/input/chatInput/Full/Dark
Before After
before after
chat/input/chatInput/Full/Light
Before After
before after
chat/widget/chatWidget/SimpleQA/Light
Before After
before after
chat/widget/chatWidget/PendingToolApproval/Dark
Before After
before after
chat/widget/chatWidget/PendingToolApproval/Light
Before After
before after
agentSessionsViewer/ApprovalRowLongLabel/Dark
Before After
before after
agentSessionsViewer/ApprovalRowLongLabel/Light
Before After
before after

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

roblourens
roblourens previously approved these changes May 5, 2026
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.

Copilot's findings

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

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
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
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>
@joshspicer joshspicer merged commit 15ba359 into main May 5, 2026
26 checks passed
@joshspicer joshspicer deleted the agents/feature-gate-setting-default-off branch May 5, 2026 20:38
@vs-code-engineering vs-code-engineering Bot added this to the 1.120.0 milestone May 5, 2026
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.

5 participants