Skip to content

Commit 5e965a7

Browse files
authored
Make title of "make merged prs" command reflect behavior (#6826)
1 parent b25dbd6 commit 5e965a7

5 files changed

Lines changed: 29 additions & 6 deletions

File tree

package.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1583,6 +1583,12 @@
15831583
"title": "%command.notifications.markMergedPullRequestsAsRead.title%",
15841584
"category": "%command.notifications.category%",
15851585
"icon": "$(git-pull-request)"
1586+
},
1587+
{
1588+
"command": "notifications.markMergedPullRequestsAsDone",
1589+
"title": "%command.notifications.markMergedPullRequestsAsDone.title%",
1590+
"category": "%command.notifications.category%",
1591+
"icon": "$(git-pull-request)"
15861592
}
15871593
],
15881594
"viewsWelcome": [
@@ -2275,6 +2281,10 @@
22752281
"command": "notifications.markMergedPullRequestsAsRead",
22762282
"when": "false"
22772283
},
2284+
{
2285+
"command": "notifications.markMergedPullRequestsAsDone",
2286+
"when": "false"
2287+
},
22782288
{
22792289
"command": "review.copyPrLink",
22802290
"when": "github:inReviewMode"
@@ -2408,7 +2418,12 @@
24082418
},
24092419
{
24102420
"command": "notifications.markMergedPullRequestsAsRead",
2411-
"when": "gitHubOpenRepositoryCount != 0 && github:initialized && view == notifications:github && config.githubPullRequests.experimental.notificationsMarkPullRequests != none",
2421+
"when": "gitHubOpenRepositoryCount != 0 && github:initialized && view == notifications:github && config.githubPullRequests.experimental.notificationsMarkPullRequests == markAsRead",
2422+
"group": "navigation@0"
2423+
},
2424+
{
2425+
"command": "notifications.markMergedPullRequestsAsDone",
2426+
"when": "gitHubOpenRepositoryCount != 0 && github:initialized && view == notifications:github && config.githubPullRequests.experimental.notificationsMarkPullRequests == markAsDone",
24122427
"group": "navigation@0"
24132428
},
24142429
{

package.nls.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@
300300
"command.notifications.markAsRead.title": "Mark as Read",
301301
"command.notifications.markAsDone.title": "Mark as Done",
302302
"command.notifications.markMergedPullRequestsAsRead.title": "Mark Merged Pull Requests as Read",
303+
"command.notifications.markMergedPullRequestsAsDone.title": "Mark Merged Pull Requests as Done",
303304
"command.notification.chatSummarizeNotification.title": "Summarize With Copilot",
304305
"welcome.github.login.contents": {
305306
"message": "You have not yet signed in with GitHub\n[Sign in](command:pr.signin)",

src/common/settingKeys.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ export const EXPERIMENTAL_USE_QUICK_CHAT = 'experimental.useQuickChat';
5757
export const EXPERIMENTAL_NOTIFICATIONS = 'experimental.notificationsView';
5858
export const EXPERIMENTAL_NOTIFICATIONS_PAGE_SIZE = 'experimental.notificationsViewPageSize';
5959
export const EXPERIMENTAL_NOTIFICATIONS_SCORE = 'experimental.notificationsScore';
60-
export const EXPERIMENTAL_NOTIFICATIONS_MARK_PRS = 'experimental.notificationsMarkPullRequests';
6160

6261
// git
6362
export const GIT = 'git';

src/notifications/notificationsFeatureRegistar.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,17 @@ export class NotificationsFeatureRegister extends Disposable {
127127
"notifications.markMergedPullRequestsAsRead" : {}
128128
*/
129129
this._telemetry.sendTelemetryEvent('notifications.markMergedPullRequestsAsRead');
130-
return notificationsManager.markMergedPullRequestAsRead();
130+
return notificationsManager.markMergedPullRequest();
131+
})
132+
);
133+
134+
this._register(
135+
vscode.commands.registerCommand('notifications.markMergedPullRequestsAsDone', () => {
136+
/* __GDPR__
137+
"notifications.markMergedPullRequestsAsDone" : {}
138+
*/
139+
this._telemetry.sendTelemetryEvent('notifications.markMergedPullRequestsAsDone');
140+
return notificationsManager.markMergedPullRequest(true);
131141
})
132142
);
133143

src/notifications/notificationsManager.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import * as vscode from 'vscode';
77
import { Disposable } from '../common/lifecycle';
8-
import { EXPERIMENTAL_NOTIFICATIONS_MARK_PRS } from '../common/settingKeys';
98
import { EventType, TimelineEvent } from '../common/timelineEvent';
109
import { toNotificationUri } from '../common/uri';
1110
import { CredentialStore } from '../github/credentials';
@@ -263,8 +262,7 @@ export class NotificationsManager extends Disposable implements vscode.TreeDataP
263262
}
264263
}
265264

266-
public async markMergedPullRequestAsRead(): Promise<void> {
267-
const markAsDone = vscode.workspace.getConfiguration('githubPullRequests').get<'markAsRead' | 'markAsDone'>(EXPERIMENTAL_NOTIFICATIONS_MARK_PRS, 'markAsRead') === 'markAsDone';
265+
public async markMergedPullRequest(markAsDone: boolean = false): Promise<void> {
268266
const filteredNotifications = Array.from(this._notifications.values()).filter(notification => notification.notification.subject.type === NotificationSubjectType.PullRequest && notification.model.isMerged);
269267
const timlines = await Promise.all(filteredNotifications.map(notification => (notification.model as PullRequestModel).getTimelineEvents()));
270268

0 commit comments

Comments
 (0)