fix chat tip getting stuck when mode changes (#297744)

fix #297287
This commit is contained in:
Megan Rogge
2026-02-25 19:57:36 +01:00
committed by GitHub
parent 42da810b51
commit e2c2a7db6a
@@ -2076,6 +2076,14 @@ export class ChatWidget extends Disposable implements IChatWidget {
this.chatSuggestNextWidget.hide();
this.chatTipService.resetSession();
// Switching sessions resets tip service state; clear any rendered tip so
// empty-state rendering picks a fresh, context-appropriate tip.
this._gettingStartedTipPartRef = undefined;
this._gettingStartedTipPart.clear();
const tipContainer = this.inputPart.gettingStartedTipContainerElement;
dom.clearNode(tipContainer);
dom.setVisibility(false, tipContainer);
this._codeBlockModelCollection.clear();
this.viewModel = this.instantiationService.createInstance(ChatViewModel, model, this._codeBlockModelCollection, undefined);