From 093376241c3bc126b3fdfdbb5f262ce549c1f9ff Mon Sep 17 00:00:00 2001 From: Osvaldo Ortega Date: Wed, 4 Mar 2026 15:45:55 -0800 Subject: [PATCH] Sessions window: contributed pr actions --- extensions/github/package.json | 12 ------------ .../contrib/changesView/browser/changesView.ts | 13 ++++++------- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/extensions/github/package.json b/extensions/github/package.json index 815c6452706..78577f2192d 100644 --- a/extensions/github/package.json +++ b/extensions/github/package.json @@ -184,18 +184,6 @@ } ], "chat/input/editing/sessionApplyActions": [ - { - "command": "github.createPullRequest", - "group": "navigation", - "order": 1, - "when": "isSessionsWindow && agentSessionHasChanges && chatSessionType == copilotcli && !github.hasOpenPullRequest" - }, - { - "command": "github.openPullRequest", - "group": "navigation", - "order": 1, - "when": "isSessionsWindow && agentSessionHasChanges && chatSessionType == copilotcli && github.hasOpenPullRequest" - } ] }, "configuration": [ diff --git a/src/vs/sessions/contrib/changesView/browser/changesView.ts b/src/vs/sessions/contrib/changesView/browser/changesView.ts index 1bed45ff7c6..3dcdffcec1d 100644 --- a/src/vs/sessions/contrib/changesView/browser/changesView.ts +++ b/src/vs/sessions/contrib/changesView/browser/changesView.ts @@ -54,7 +54,6 @@ import { createFileIconThemableTreeContainerScope } from '../../../../workbench/ import { IActivityService, NumberBadge } from '../../../../workbench/services/activity/common/activity.js'; import { IEditorService, MODAL_GROUP, SIDE_GROUP } from '../../../../workbench/services/editor/common/editorService.js'; import { IExtensionService } from '../../../../workbench/services/extensions/common/extensions.js'; -import { ICommandService } from '../../../../platform/commands/common/commands.js'; import { IWorkbenchLayoutService } from '../../../../workbench/services/layout/browser/layoutService.js'; import { ISessionsManagementService } from '../../sessions/browser/sessionsManagementService.js'; import { GITHUB_REMOTE_FILE_SCHEME } from '../../fileTreeView/browser/githubFileSystemProvider.js'; @@ -254,7 +253,6 @@ export class ChangesViewPane extends ViewPane { @ISessionsManagementService private readonly sessionManagementService: ISessionsManagementService, @ILabelService private readonly labelService: ILabelService, @IStorageService private readonly storageService: IStorageService, - @ICommandService private readonly commandService: ICommandService, ) { super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, hoverService); @@ -561,12 +559,16 @@ export class ChangesViewPane extends ViewPane { return files > 0; })); - // Check if a PR exists when the active session changes + // Set context key for PR state from session metadata + const hasOpenPullRequestKey = scopedContextKeyService.createKey('github.copilot.chat.copilotCLI.hasOpenPullRequest', false); this.renderDisposables.add(autorun(reader => { const sessionResource = activeSessionResource.read(reader); + sessionsChangedSignal.read(reader); if (sessionResource) { const metadata = this.agentSessionsService.getSession(sessionResource)?.metadata; - this.commandService.executeCommand('github.checkOpenPullRequest', sessionResource, metadata).catch(() => { /* ignore */ }); + hasOpenPullRequestKey.set(!!metadata?.pullRequestUrl); + } else { + hasOpenPullRequestKey.set(false); } })); @@ -592,9 +594,6 @@ export class ChangesViewPane extends ViewPane { ); return { showIcon: true, showLabel: true, isSecondary: true, customClass: 'working-set-diff-stats', customLabel: diffStatsLabel }; } - if (action.id === 'github.createPullRequest' || action.id === 'github.openPullRequest') { - return { showIcon: true, showLabel: true, isSecondary: true }; - } if (action.id === 'chatEditing.synchronizeChanges') { return { showIcon: true, showLabel: true, isSecondary: true }; }