-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
model.go
72 lines (60 loc) · 1.34 KB
/
model.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package triage
import (
"context"
"github.com/google/go-github/v28/github"
"github.com/tj/go-tea"
"github.com/tj/go-tea/input"
"github.com/tj/go-tea/option"
"github.com/tj/go-tea/options"
)
// Page is the page the user is viewing.
type Page int
// Pages available.
const (
PageNotifications Page = iota
PageNotification
PageLabels
PageComment
PagePriorities
)
// Model is the application model.
type Model struct {
// active page
Page
// notifications page
Notifications []*github.Notification
NotificationsScrollY int
Selected int
Searching bool
SearchInput input.Model
// notification page
Notification *github.Notification
NotificationScrollY int
Labels []*github.Label
Issue *github.Issue
Comments []*github.IssueComment
LoadingIssue bool
LoadingLabels bool
LoadingComments bool
// priorities page
PriorityOptions option.Model
// labels page
LabelOptions options.Model
RepoLabels []*github.Label
// comment
CommentInput input.Model
// shared
MarkingAsRead bool
Unsubscribing bool
Unwatching bool
Loading bool
Width int
Height int
}
// Init function.
func Init(ctx context.Context) (tea.Model, tea.Cmd) {
return Model{
Page: PageNotifications,
Loading: true,
}, GetDimensions
}