Skip to content
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/@types/vscode.proposed.chatParticipantAdditions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ declare module 'vscode' {
isComplete?: boolean;
toolSpecificData?: ChatTerminalToolInvocationData;
fromSubAgent?: boolean;
presentation?: 'hidden' | 'hiddenAfterComplete' | undefined;

constructor(toolName: string, toolCallId: string, isError?: boolean);
}
Expand Down
32 changes: 32 additions & 0 deletions src/view/treeNodes/pullRequestNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export class PRNode extends TreeNode implements vscode.CommentingRangeProvider2
super(parent);
this.registerSinceReviewChange();
this.registerConfigurationChange();
this.registerNotificationChanges();
this._register(this._folderReposManager.onDidChangeActivePullRequest(e => {
if (e.new?.number === this.pullRequestModel.number || e.old?.number === this.pullRequestModel.number) {
this.refresh(this);
Expand Down Expand Up @@ -144,6 +145,37 @@ export class PRNode extends TreeNode implements vscode.CommentingRangeProvider2
}));
}

protected registerNotificationChanges() {
// Listen for regular notification changes
this._register(this._notificationProvider.onDidChangeNotifications(notifications => {
// Check if any of the changed notifications are for this PR
const affectsThisPR = notifications.some(notification => {
if (notification.model instanceof PullRequestModel) {
return notification.model.number === this.pullRequestModel.number &&
notification.model.remote.owner === this.pullRequestModel.remote.owner &&
notification.model.remote.repositoryName === this.pullRequestModel.remote.repositoryName;
}
return false;
});
if (affectsThisPR) {
this.refresh(this);
}
}));

// Listen for Copilot notification changes
this._register(this._prsTreeModel.onDidChangeCopilotNotifications(pullRequests => {
// Check if any of the changed notifications are for this PR
const affectsThisPR = pullRequests.some(pr =>
pr.number === this.pullRequestModel.number &&
pr.remote.owner === this.pullRequestModel.remote.owner &&
pr.remote.repositoryName === this.pullRequestModel.remote.repositoryName
);
if (affectsThisPR) {
this.refresh(this);
}
}));
}

public async reopenNewPrDiffs(pullRequest: PullRequestModel) {
let hasOpenDiff: boolean = false;
vscode.window.tabGroups.all.map(tabGroup => {
Expand Down