Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1579,14 +1579,14 @@
"icon": "$(check-all)"
},
{
"command": "notifications.markMergedPullRequestsAsRead",
"title": "%command.notifications.markMergedPullRequestsAsRead.title%",
"command": "notifications.markPullRequestsAsRead",
"title": "%command.notifications.markPullRequestsAsRead.title%",
"category": "%command.notifications.category%",
"icon": "$(git-pull-request)"
},
{
"command": "notifications.markMergedPullRequestsAsDone",
"title": "%command.notifications.markMergedPullRequestsAsDone.title%",
"command": "notifications.markPullRequestsAsDone",
"title": "%command.notifications.markPullRequestsAsDone.title%",
"category": "%command.notifications.category%",
"icon": "$(git-pull-request)"
}
Expand Down Expand Up @@ -2278,11 +2278,11 @@
"when": "false"
},
{
"command": "notifications.markMergedPullRequestsAsRead",
"command": "notifications.markPullRequestsAsRead",
"when": "false"
},
{
"command": "notifications.markMergedPullRequestsAsDone",
"command": "notifications.markPullRequestsAsDone",
"when": "false"
},
{
Expand Down Expand Up @@ -2417,12 +2417,12 @@
"group": "sortNotifications@2"
},
{
"command": "notifications.markMergedPullRequestsAsRead",
"command": "notifications.markPullRequestsAsRead",
"when": "gitHubOpenRepositoryCount != 0 && github:initialized && view == notifications:github && config.githubPullRequests.experimental.notificationsMarkPullRequests == markAsRead",
"group": "navigation@0"
},
{
"command": "notifications.markMergedPullRequestsAsDone",
"command": "notifications.markPullRequestsAsDone",
"when": "gitHubOpenRepositoryCount != 0 && github:initialized && view == notifications:github && config.githubPullRequests.experimental.notificationsMarkPullRequests == markAsDone",
"group": "navigation@0"
},
Expand Down
6 changes: 3 additions & 3 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"githubPullRequests.createDefaultBaseBranch.auto": "When the current repository is a fork, this will work like \"repositoryDefault\". Otherwise, it will work like \"createdFromBranch\".",
"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.",
"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.",
"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.",
"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.",
"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.",
"githubIssues.ignoreMilestones.description": "An array of milestones titles to never show issues from.",
"githubIssues.createIssueTriggers.description": "Strings that will cause the 'Create issue from comment' code action to show.",
Expand Down Expand Up @@ -299,8 +299,8 @@
"command.notifications.openOnGitHub.title": "Open on GitHub",
"command.notifications.markAsRead.title": "Mark as Read",
"command.notifications.markAsDone.title": "Mark as Done",
"command.notifications.markMergedPullRequestsAsRead.title": "Mark Merged Pull Requests as Read",
"command.notifications.markMergedPullRequestsAsDone.title": "Mark Merged Pull Requests as Done",
"command.notifications.markPullRequestsAsRead.title": "Mark Pull Requests as Read",
"command.notifications.markPullRequestsAsDone.title": "Mark Pull Requests as Done",
"command.notification.chatSummarizeNotification.title": "Summarize With Copilot",
"welcome.github.login.contents": {
"message": "You have not yet signed in with GitHub\n[Sign in](command:pr.signin)",
Expand Down
16 changes: 8 additions & 8 deletions src/notifications/notificationsFeatureRegistar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,22 +122,22 @@ export class NotificationsFeatureRegister extends Disposable {
);

this._register(
vscode.commands.registerCommand('notifications.markMergedPullRequestsAsRead', () => {
vscode.commands.registerCommand('notifications.markPullRequestsAsRead', () => {
/* __GDPR__
"notifications.markMergedPullRequestsAsRead" : {}
"notifications.markPullRequestsAsRead" : {}
*/
this._telemetry.sendTelemetryEvent('notifications.markMergedPullRequestsAsRead');
return notificationsManager.markMergedPullRequest();
this._telemetry.sendTelemetryEvent('notifications.markPullRequestsAsRead');
return notificationsManager.markPullRequests();
})
);

this._register(
vscode.commands.registerCommand('notifications.markMergedPullRequestsAsDone', () => {
vscode.commands.registerCommand('notifications.markPullRequestsAsDone', () => {
/* __GDPR__
"notifications.markMergedPullRequestsAsDone" : {}
"notifications.markPullRequestsAsDone" : {}
*/
this._telemetry.sendTelemetryEvent('notifications.markMergedPullRequestsAsDone');
return notificationsManager.markMergedPullRequest(true);
this._telemetry.sendTelemetryEvent('notifications.markPullRequestsAsDone');
return notificationsManager.markPullRequests(true);
})
);

Expand Down
4 changes: 2 additions & 2 deletions src/notifications/notificationsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ export class NotificationsManager extends Disposable implements vscode.TreeDataP
}
}

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

const markPromises: Promise<void>[] = [];
Expand Down