mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 20:13:32 +01:00
When archiving active session, clear it (#303684)
This commit is contained in:
@@ -13,6 +13,7 @@ import { Event } from '../../../../../../base/common/event.js';
|
||||
import { MutableDisposable, toDisposable, DisposableStore } from '../../../../../../base/common/lifecycle.js';
|
||||
import { MarshalledId } from '../../../../../../base/common/marshallingIds.js';
|
||||
import { autorun, IReader } from '../../../../../../base/common/observable.js';
|
||||
import { isEqual } from '../../../../../../base/common/resources.js';
|
||||
import { URI } from '../../../../../../base/common/uri.js';
|
||||
import { localize } from '../../../../../../nls.js';
|
||||
import { MenuWorkbenchToolBar } from '../../../../../../platform/actions/browser/toolbar.js';
|
||||
@@ -628,6 +629,16 @@ export class ChatViewPane extends ViewPane implements IViewWelcomeDelegate {
|
||||
}
|
||||
}));
|
||||
|
||||
// When the currently displayed session is archived, start a new session
|
||||
this._register(this.agentSessionsService.model.onDidChangeSessionArchivedState(e => {
|
||||
if (e.isArchived()) {
|
||||
const currentSessionResource = chatWidget.viewModel?.sessionResource;
|
||||
if (currentSessionResource && isEqual(currentSessionResource, e.resource)) {
|
||||
this.clear();
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
// When showing sessions stacked, adjust the height of the sessions list to make room for chat input
|
||||
this._register(autorun(reader => {
|
||||
chatWidget.inputPart.height.read(reader);
|
||||
|
||||
Reference in New Issue
Block a user