mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 12:04:04 +01:00
Sessions - more changes view cleanup (#303303)
* Sessions - more changes view cleanup * Pull request feedback * More changes
This commit is contained in:
@@ -342,6 +342,7 @@ export class ChangesViewPane extends ViewPane {
|
||||
super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, hoverService);
|
||||
|
||||
this.viewModel = this.instantiationService.createInstance(ChangesViewModel);
|
||||
this._register(this.viewModel);
|
||||
|
||||
// Version mode
|
||||
this._register(bindContextKey(changesVersionModeContextKey, this.scopedContextKeyService, reader => {
|
||||
@@ -353,7 +354,7 @@ export class ChangesViewPane extends ViewPane {
|
||||
return this.viewModel.viewModeObs.read(reader);
|
||||
}));
|
||||
|
||||
// Set chatSessionType on the view's context key service so ViewTitlev menu items
|
||||
// Set chatSessionType on the view's context key service so ViewTitle menu items
|
||||
// can use it in their `when` clauses. Update reactively when the active session
|
||||
// changes.
|
||||
this._register(bindContextKey(ChatContextKeys.agentSessionType, this.scopedContextKeyService, reader => {
|
||||
@@ -623,8 +624,6 @@ export class ChangesViewPane extends ViewPane {
|
||||
if (this.actionsContainer) {
|
||||
dom.clearNode(this.actionsContainer);
|
||||
|
||||
const scopedInstantiationService = this.renderDisposables.add(this.instantiationService.createChild(new ServiceCollection([IContextKeyService, this.scopedContextKeyService])));
|
||||
|
||||
this.renderDisposables.add(bindContextKey(ChatContextKeys.hasAgentSessionChanges, this.scopedContextKeyService, reader => {
|
||||
const { files } = topLevelStats.read(reader);
|
||||
return files > 0;
|
||||
@@ -646,6 +645,10 @@ export class ChangesViewPane extends ViewPane {
|
||||
return metadata?.pullRequestUrl !== undefined;
|
||||
}));
|
||||
|
||||
const scopedServiceCollection = new ServiceCollection([IContextKeyService, this.scopedContextKeyService]);
|
||||
const scopedInstantiationService = this.instantiationService.createChild(scopedServiceCollection);
|
||||
this.renderDisposables.add(scopedInstantiationService);
|
||||
|
||||
this.renderDisposables.add(autorun(reader => {
|
||||
const { added, removed } = topLevelStats.read(reader);
|
||||
const sessionResource = this.viewModel.activeSessionResourceObs.read(reader);
|
||||
|
||||
Reference in New Issue
Block a user