Documentation
¶
Overview ¶
Package inboxcount counts the pull requests in the app's Inbox, so the desktop app's dock badge and tray show the number the app's sidebar does.
It mirrors the app's queue (upNext, kindOf and the snooze filter in app/src/up-next.tsx). Saved inboxes whose badge is off are not applied: that needs the inbox filter language, which only the app has for now.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Count ¶
func Count(entries []reviewindex.Entry, queue []jobs.Job, groups []reviewgroups.Group, snoozes Snoozes, now time.Time) int
Count is the number of pull requests in the Inbox: each open one asking for the user's review, and each of their own with something for them to do (fix, merge or update), less those snoozed at now. entries are the index's, in its order; jobs the queue's; groups the review groups.
func Key ¶
func Key(pr reviewindex.Entry) string
Key names a pull request across the clones that hold it, as the app's upNextKey does.
Types ¶
type Service ¶
type Service struct {
Index func(context.Context) (reviewindex.Snapshot, error)
Jobs func() []jobs.Job
Groups func(context.Context) ([]reviewgroups.Group, error)
Snoozes func() (json.RawMessage, error)
Now func() time.Time
}
Service serves the count from the daemon's own index, queue, groups and saved ui-state.
type Snoozes ¶
type Snoozes struct {
Snoozed map[string]int64 `json:"snoozed"`
Held map[string]string `json:"held"`
}
Snoozes is what the app saved as ui-state "inbox" that hides a pull request from the queue: until a time (Unix milliseconds) or while its head stays the one it was held on. Both are keyed by Key.
func ParseSnoozes ¶
func ParseSnoozes(raw json.RawMessage) (Snoozes, error)
ParseSnoozes reads the ui-state "inbox" value; null, as before the app saved one, hides nothing.