File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 16881688 "view" : " github:activePullRequest:welcome" ,
16891689 "when" : " !github:stateValidated" ,
16901690 "contents" : " %welcome.github.activePullRequest.contents%"
1691+ },
1692+ {
1693+ "view" : " notifications:github" ,
1694+ "when" : " !github:notificationCount" ,
1695+ "contents" : " %welcome.github.notificationsLoading.contents%"
1696+ },
1697+ {
1698+ "view" : " notifications:github" ,
1699+ "when" : " ReposManagerStateContext == RepositoriesLoaded && github:notificationCount == 0" ,
1700+ "contents" : " %welcome.github.notifications.contents%"
16911701 }
16921702 ],
16931703 "keybindings" : [
Original file line number Diff line number Diff line change 353353 " Please make sure there is no space between the right bracket and left parenthesis: ]( this is an internal syntax for links"
354354 ]
355355 },
356+ "welcome.github.notificationsLoading.contents" : " Loading..." ,
357+ "welcome.github.notifications.contents" : " No notifications, your inbox is empty $(rocket)" ,
356358 "welcome.issues.github.uninitialized.contents" : " Loading..." ,
357359 "welcome.issues.github.noFolder.contents" : " You have not yet opened a folder." ,
358360 "welcome.issues.github.noRepo.contents" : " No git repositories found" ,
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ export namespace contexts {
1919 export const PULL_REQUEST_DESCRIPTION_VISIBLE = 'github:pullRequestDescriptionVisible' ; // Boolean indicating if the pull request description is visible
2020 export const ACTIVE_COMMENT_HAS_SUGGESTION = 'github:activeCommentHasSuggestion' ; // Boolean indicating if the active comment has a suggestion
2121 export const CREATING = 'pr:creating' ;
22+ export const NOTIFICATION_COUNT = 'github:notificationCount' ; // Number of notifications in the notifications view
2223}
2324
2425export namespace commands {
Original file line number Diff line number Diff line change 55
66import * as vscode from 'vscode' ;
77import { AuthProvider } from '../common/authentication' ;
8+ import { commands , contexts } from '../common/executeCommands' ;
89import { Disposable } from '../common/lifecycle' ;
910import { EXPERIMENTAL_NOTIFICATIONS_PAGE_SIZE , PR_SETTINGS_NAMESPACE } from '../common/settingKeys' ;
1011import { OctokitCommon } from '../github/common' ;
@@ -101,6 +102,7 @@ export class NotificationsProvider extends Disposable {
101102 . map ( ( notification : OctokitCommon . Notification ) => parseNotification ( notification ) )
102103 . filter ( notification => ! ! notification ) as Notification [ ] ;
103104
105+ commands . setContext ( contexts . NOTIFICATION_COUNT , notifications . length ) ;
104106 return { notifications, hasNextPage : headers . link ?. includes ( `rel="next"` ) === true } ;
105107 }
106108
You can’t perform that action at this time.
0 commit comments