mirror of
https://github.com/microsoft/vscode.git
synced 2026-02-15 07:28:05 +00:00
1.2 KiB
1.2 KiB
description
| description |
|---|
| Chat feature area coding guidelines |
Adding chat/AI-related features
- When adding a new chat/AI feature like a new surface where chat or agents appear, a new AI command, etc, these features must not show up for users when they've disabled AI features. The best way to do this is to gate the feature on the context key
ChatContextKeys.enabledvia a when clause. - When doing a code review for code that adds an AI feature, please ensure that the feature is properly gated.
Hiding AI Features When Disabled
When surfacing a UI AI feature, ensure the feature hides when chat.disableAIFeatures is set:
- UI Hiding: Use
ChatContextKeys.enabledinwhenconditions to conditionally show/hide UI elements (commands, views, menu items, etc.)- Example:
when: ChatContextKeys.enabledin action/command registration - This context key is
falsewhen AI features are disabled
- Example:
- Programmatic Hiding: Check
IChatEntitlementService.sentiment.hiddento determine if AI features should be hiddensentiment.hiddenistruewhen the user signals no intent in using Chat- This should not only disable Chat but also hide all of its UI
This ensures consistency when implementing AI-powered UI functionality across the codebase.