Skip to content

Commit fe5f00f

Browse files
authored
Also mark unmerged PRs (#6871)
1 parent e415446 commit fe5f00f

4 files changed

Lines changed: 21 additions & 21 deletions

File tree

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1579,14 +1579,14 @@
15791579
"icon": "$(check-all)"
15801580
},
15811581
{
1582-
"command": "notifications.markMergedPullRequestsAsRead",
1583-
"title": "%command.notifications.markMergedPullRequestsAsRead.title%",
1582+
"command": "notifications.markPullRequestsAsRead",
1583+
"title": "%command.notifications.markPullRequestsAsRead.title%",
15841584
"category": "%command.notifications.category%",
15851585
"icon": "$(git-pull-request)"
15861586
},
15871587
{
1588-
"command": "notifications.markMergedPullRequestsAsDone",
1589-
"title": "%command.notifications.markMergedPullRequestsAsDone.title%",
1588+
"command": "notifications.markPullRequestsAsDone",
1589+
"title": "%command.notifications.markPullRequestsAsDone.title%",
15901590
"category": "%command.notifications.category%",
15911591
"icon": "$(git-pull-request)"
15921592
}
@@ -2278,11 +2278,11 @@
22782278
"when": "false"
22792279
},
22802280
{
2281-
"command": "notifications.markMergedPullRequestsAsRead",
2281+
"command": "notifications.markPullRequestsAsRead",
22822282
"when": "false"
22832283
},
22842284
{
2285-
"command": "notifications.markMergedPullRequestsAsDone",
2285+
"command": "notifications.markPullRequestsAsDone",
22862286
"when": "false"
22872287
},
22882288
{
@@ -2417,12 +2417,12 @@
24172417
"group": "sortNotifications@2"
24182418
},
24192419
{
2420-
"command": "notifications.markMergedPullRequestsAsRead",
2420+
"command": "notifications.markPullRequestsAsRead",
24212421
"when": "gitHubOpenRepositoryCount != 0 && github:initialized && view == notifications:github && config.githubPullRequests.experimental.notificationsMarkPullRequests == markAsRead",
24222422
"group": "navigation@0"
24232423
},
24242424
{
2425-
"command": "notifications.markMergedPullRequestsAsDone",
2425+
"command": "notifications.markPullRequestsAsDone",
24262426
"when": "gitHubOpenRepositoryCount != 0 && github:initialized && view == notifications:github && config.githubPullRequests.experimental.notificationsMarkPullRequests == markAsDone",
24272427
"group": "navigation@0"
24282428
},

package.nls.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
"githubPullRequests.createDefaultBaseBranch.auto": "When the current repository is a fork, this will work like \"repositoryDefault\". Otherwise, it will work like \"createdFromBranch\".",
8989
"githubPullRequests.experimental.chat.description": "Enables the `@githubpr` Copilot chat participant in the chat view. `@githubpr` can help search for issues and pull requests, suggest fixes for issues, and summarize issues, pull requests, and notifications.",
9090
"githubPullRequests.experimental.notificationsView.description": "Enables the notifications view, which shows a list of your GitHub notifications. When combined with `#githubPullRequests.experimental.chat#`, you can have Copilot sort and summarize your notifications. View will not show in a Codespace accessed from the browser.",
91-
"githubPullRequests.experimental.notificationsMarkPullRequests.description": "Adds an action in the Notifications view to mark merged pull requests with no reviews, comments, or commits since you last viewed the pull request as read.",
91+
"githubPullRequests.experimental.notificationsMarkPullRequests.description": "Adds an action in the Notifications view to mark pull requests with no non-empty reviews, comments, or commits since you last viewed the pull request as read.",
9292
"githubPullRequests.experimental.useQuickChat.description": "Controls whether the Copilot \"Summarize\" commands in the Pull Requests, Issues, and Notifications views will use quick chat. Only has an effect if `#githubPullRequests.experimental.chat#` is enabled.",
9393
"githubIssues.ignoreMilestones.description": "An array of milestones titles to never show issues from.",
9494
"githubIssues.createIssueTriggers.description": "Strings that will cause the 'Create issue from comment' code action to show.",
@@ -299,8 +299,8 @@
299299
"command.notifications.openOnGitHub.title": "Open on GitHub",
300300
"command.notifications.markAsRead.title": "Mark as Read",
301301
"command.notifications.markAsDone.title": "Mark as Done",
302-
"command.notifications.markMergedPullRequestsAsRead.title": "Mark Merged Pull Requests as Read",
303-
"command.notifications.markMergedPullRequestsAsDone.title": "Mark Merged Pull Requests as Done",
302+
"command.notifications.markPullRequestsAsRead.title": "Mark Pull Requests as Read",
303+
"command.notifications.markPullRequestsAsDone.title": "Mark Pull Requests as Done",
304304
"command.notification.chatSummarizeNotification.title": "Summarize With Copilot",
305305
"welcome.github.login.contents": {
306306
"message": "You have not yet signed in with GitHub\n[Sign in](command:pr.signin)",

src/notifications/notificationsFeatureRegistar.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,22 +123,22 @@ export class NotificationsFeatureRegister extends Disposable {
123123
);
124124

125125
this._register(
126-
vscode.commands.registerCommand('notifications.markMergedPullRequestsAsRead', () => {
126+
vscode.commands.registerCommand('notifications.markPullRequestsAsRead', () => {
127127
/* __GDPR__
128-
"notifications.markMergedPullRequestsAsRead" : {}
128+
"notifications.markPullRequestsAsRead" : {}
129129
*/
130-
this._telemetry.sendTelemetryEvent('notifications.markMergedPullRequestsAsRead');
131-
return notificationsManager.markMergedPullRequest();
130+
this._telemetry.sendTelemetryEvent('notifications.markPullRequestsAsRead');
131+
return notificationsManager.markPullRequests();
132132
})
133133
);
134134

135135
this._register(
136-
vscode.commands.registerCommand('notifications.markMergedPullRequestsAsDone', () => {
136+
vscode.commands.registerCommand('notifications.markPullRequestsAsDone', () => {
137137
/* __GDPR__
138-
"notifications.markMergedPullRequestsAsDone" : {}
138+
"notifications.markPullRequestsAsDone" : {}
139139
*/
140-
this._telemetry.sendTelemetryEvent('notifications.markMergedPullRequestsAsDone');
141-
return notificationsManager.markMergedPullRequest(true);
140+
this._telemetry.sendTelemetryEvent('notifications.markPullRequestsAsDone');
141+
return notificationsManager.markPullRequests(true);
142142
})
143143
);
144144

src/notifications/notificationsManager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ export class NotificationsManager extends Disposable implements vscode.TreeDataP
262262
}
263263
}
264264

265-
public async markMergedPullRequest(markAsDone: boolean = false): Promise<void> {
266-
const filteredNotifications = Array.from(this._notifications.values()).filter(notification => notification.notification.subject.type === NotificationSubjectType.PullRequest && notification.model.isMerged);
265+
public async markPullRequests(markAsDone: boolean = false): Promise<void> {
266+
const filteredNotifications = Array.from(this._notifications.values()).filter(notification => notification.notification.subject.type === NotificationSubjectType.PullRequest);
267267
const timlines = await Promise.all(filteredNotifications.map(notification => (notification.model as PullRequestModel).getTimelineEvents()));
268268

269269
const markPromises: Promise<void>[] = [];

0 commit comments

Comments
 (0)