Skip to content

Commit 748cd8e

Browse files
authored
Ensure the welcome message avatar icon rerenders when the chat session loads (microsoft#182923)
1 parent 65123b4 commit 748cd8e

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/vs/workbench/contrib/chat/browser/chatWidget.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ export class ChatWidget extends Disposable implements IChatWidget {
174174
diffIdentityProvider: {
175175
getId: (element) => {
176176
return ((isResponseVM(element) || isRequestVM(element)) ? element.dataId : element.id) +
177+
// TODO? We can give the welcome message a proper VM or get rid of the rest of the VMs
178+
((isWelcomeVM(element) && !this.viewModel?.isInitialized) ? '_initializing' : '') +
177179
// Ensure re-rendering an element once slash commands are loaded, so the colorization can be applied.
178180
`${(isRequestVM(element) || isWelcomeVM(element)) && !!this.lastSlashCommands ? '_scLoaded' : ''}` +
179181
// If a response is in the process of progressive rendering, we need to ensure that it will

src/vs/workbench/contrib/chat/common/chatViewModel.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export function isWelcomeVM(item: unknown): item is IInteractiveWelcomeMessageVi
2727
}
2828

2929
export interface IChatViewModel {
30+
readonly isInitialized: boolean;
3031
readonly providerId: string;
3132
readonly sessionId: string;
3233
readonly onDidDisposeModel: Event<void>;
@@ -108,6 +109,10 @@ export class ChatViewModel extends Disposable implements IChatViewModel {
108109
return this._model.providerId;
109110
}
110111

112+
get isInitialized() {
113+
return this._model.isInitialized;
114+
}
115+
111116
constructor(
112117
private readonly _model: IChatModel,
113118
@IInstantiationService private readonly instantiationService: IInstantiationService,

0 commit comments

Comments
 (0)