Skip to content

Commit d7dd39b

Browse files
authored
Unify dismiss notification commands (#7978)
Fixes #7893
1 parent c7b94e4 commit d7dd39b

File tree

5 files changed

+9
-3
lines changed

5 files changed

+9
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@
967967
},
968968
{
969969
"command": "pr.markAllCopilotNotificationsAsRead",
970-
"title": "Mark All as Read",
970+
"title": "%command.pr.markAllCopilotNotificationsAsRead.title%",
971971
"category": "%command.pull.request.category%",
972972
"enablement": "viewItem == copilot-query-with-notifications"
973973
},

package.nls.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@
191191
"command.pr.pickOnVscodeDev.title": "Checkout Pull Request on vscode.dev",
192192
"command.pr.exit.title": "Checkout Default Branch",
193193
"command.pr.dismissNotification.title": "Dismiss Notification",
194+
"command.pr.markAllCopilotNotificationsAsRead.title": "Dismiss All Copilot Notifications",
194195
"command.pr.merge.title": "Merge Pull Request",
195196
"command.pr.readyForReview.title": "Mark Pull Request Ready For Review",
196197
"command.pr.openPullRequestOnGitHub.title": "Open Pull Request on GitHub",

src/commands.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -900,6 +900,7 @@ export function registerCommands(
900900
vscode.commands.registerCommand('pr.dismissNotification', node => {
901901
if (node instanceof PRNode) {
902902
notificationManager.markPrNotificationsAsRead(node.pullRequestModel);
903+
copilotRemoteAgentManager.clearNotification(node.pullRequestModel.remote.owner, node.pullRequestModel.remote.repositoryName, node.pullRequestModel.number);
903904
}
904905
}),
905906
);

src/github/copilotRemoteAgent.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,10 +994,14 @@ export class CopilotRemoteAgentManager extends Disposable {
994994
}
995995

996996

997-
public clearAllNotifications(owner?: string, repo?: string): void {
997+
clearAllNotifications(owner?: string, repo?: string): void {
998998
this._stateModel.clearAllNotifications(owner, repo);
999999
}
10001000

1001+
clearNotification(owner: string, repo: string, pullRequestNumber: number): void {
1002+
this._stateModel.clearNotification(owner, repo, pullRequestNumber);
1003+
}
1004+
10011005
hasNotification(owner: string, repo: string, pullRequestNumber?: number): boolean {
10021006
if (pullRequestNumber !== undefined) {
10031007
const key = this._stateModel.makeKey(owner, repo, pullRequestNumber);

src/view/treeNodes/pullRequestNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ export class PRNode extends TreeNode implements vscode.CommentingRangeProvider2
307307
}
308308
const login = author.specialDisplayName ?? author.login;
309309

310-
const hasNotification = this._notificationProvider.hasNotification(this.pullRequestModel);
310+
const hasNotification = this._notificationProvider.hasNotification(this.pullRequestModel) || this._codingAgentManager.hasNotification(this.pullRequestModel.remote.owner, this.pullRequestModel.remote.repositoryName, this.pullRequestModel.number);
311311

312312
const formattedPRNumber = number.toString();
313313
let labelPrefix = currentBranchIsForThisPR ? '✓ ' : '';

0 commit comments

Comments
 (0)