Conversation
- Import ChatContextKeys and observableContextKey - Add IContextKeyService injection to SimpleBrowserOverlayController - Check ChatContextKeys.enabled in constructor (early exit if disabled) - Observe chatEnabled state reactively in autorun to hide overlay when AI features are disabled - Hide overlay when either chat is disabled or no active editor Co-authored-by: jruales <1588988+jruales@users.noreply.github.com>
Co-authored-by: jruales <1588988+jruales@users.noreply.github.com>
|
@copilot currently this causes the "Add element to chat" widget to be hidden immediately when the user disables AI features, which is great. However, when the user re-enables AI features, the widget doesn't appear anymore until the user restarts VS Code. Can we fix that? |
Remove early exit check for ChatContextKeys.enabled in constructor. The reactive autorun already handles showing/hiding based on chat enabled state, so the controller should always initialize to allow dynamic toggling of AI features without requiring VS Code restart. Co-authored-by: jruales <1588988+jruales@users.noreply.github.com>
Fixed in 3d54ba0. Removed the early exit check for chat enabled state in the constructor - the reactive autorun now handles all show/hide logic dynamically. The overlay will now reappear immediately when AI features are re-enabled without requiring a restart. |
|
@copilot can we make it so that |
- Import observableConfigValue utility - Remove early exit check for sendElementsToChat.enabled - Create observable for chat.sendElementsToChat.enabled configuration - Update autorun to also check isSendElementsEnabled - Overlay now shows/hides immediately when toggling both chat.disableAIFeatures and chat.sendElementsToChat.enabled Co-authored-by: jruales <1588988+jruales@users.noreply.github.com>
Fixed in 8697ec4. Now using |
There was a problem hiding this comment.
Pull request overview
This PR ensures the Simple Browser “Add element to chat” overlay respects chat AI feature gating and can be toggled on/off immediately when related settings change.
Changes:
- Adds reactive gating in
SimpleBrowserOverlayControllerbased onChatContextKeys.enabled(coverschat.disableAIFeatures) andchat.sendElementsToChat.enabled. - Removes the constructor early-return so the controller always initializes and can dynamically show/hide the overlay without restart.
The Simple Browser overlay ignored
chat.disableAIFeaturesandchat.sendElementsToChat.enabledsettings, showing "Add element to chat" UI even when AI features or the specific feature were disabled. Changes required restart to take effect. Integrated Browser already had proper gating viaChatContextKeys.enabledin action preconditions.Changes
SimpleBrowserOverlayController now reactively observes both AI feature settings:
observableContextKeyforChatContextKeys.enabledandobservableConfigValueforchat.sendElementsToChat.enabledThe controller always initializes, allowing the reactive autorun to handle all show/hide logic. This ensures the overlay responds to both
chat.disableAIFeaturesandchat.sendElementsToChat.enabledchanges in real-time.Testing
chat.disableAIFeatures: truechat.disableAIFeatures: falsechat.sendElementsToChat.enabled: falsechat.sendElementsToChat.enabled: trueAligns with chat feature gating guidelines in
.github/instructions/chat.instructions.md.Original prompt
"chat.disableAIFeatures": true#292678💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.