2bbe257a7372fbd81c41ca79c05256993bff9db3

Author
Christian Rocha <christian@rocha.is>
Committer
Ayman Bagabas <ayman.bagabas@gmail.com>
Date

Message

chore: update box var naming for tabs in repo section

Diff

This diff is truncated to protect this page.

  1diff --git a/ui/pages/repo/repo.go b/ui/pages/repo/repo.go
  2index b87fc0e0b8758636cc0e2b54dbb7917ad6238890..170289c27e34c7d0fddb59e2aae23b3a950f2a0d 100644
  3--- a/ui/pages/repo/repo.go
  4+++ b/ui/pages/repo/repo.go
  5@@ -61,7 +61,7 @@ type Repo struct {
  6 	activeTab    tab
  7 	tabs         *tabs.Tabs
  8 	statusbar    *statusbar.StatusBar
  9-	boxes        []common.Component
 10+	panes        []common.Component
 11 	ref          *ggit.Reference
 12 }
 13 
 14@@ -80,7 +80,7 @@ func New(cfg *config.Config, c common.Common) *Repo {
 15 	branches := NewRefs(c, ggit.RefsHeads)
 16 	tags := NewRefs(c, ggit.RefsTags)
 17 	// Make sure the order matches the order of tab constants above.
 18-	boxes := []common.Component{
 19+	panes := []common.Component{
 20 		readme,
 21 		files,
 22 		log,
 23@@ -92,7 +92,7 @@ func New(cfg *config.Config, c common.Common) *Repo {
 24 		common:    c,
 25 		tabs:      tb,
 26 		statusbar: sb,
 27-		boxes:     boxes,
 28+		panes:     panes,
 29 	}
 30 	return r
 31 }
 32@@ -108,8 +108,8 @@ func (r *Repo) SetSize(width, height int) {
 33 		r.common.Styles.Tabs.GetVerticalFrameSize()
 34 	r.tabs.SetSize(width, height-hm)
 35 	r.statusbar.SetSize(width, height-hm)
 36-	for _, b := range r.boxes {
 37-		b.SetSize(width, height-hm)
 38+	for _, p := range r.panes {
 39+		p.SetSize(width, height-hm)
 40 	}
 41 }
 42 
 43@@ -127,7 +127,7 @@ func (r *Repo) commonHelp() []key.Binding {
 44 // ShortHelp implements help.KeyMap.
 45 func (r *Repo) ShortHelp() []key.Binding {
 46 	b := r.commonHelp()
 47-	b = append(b, r.boxes[r.activeTab].(help.KeyMap).ShortHelp()...)
 48+	b = append(b, r.panes[r.activeTab].(help.KeyMap).ShortHelp()...)
 49 	return b
 50 }
 51 
 52@@ -135,7 +135,7 @@ func (r *Repo) ShortHelp() []key.Binding {
 53 func (r *Repo) FullHelp() [][]key.Binding {
 54 	b := make([][]key.Binding, 0)
 55 	b = append(b, r.commonHelp())
 56-	b = append(b, r.boxes[r.activeTab].(help.KeyMap).FullHelp()...)
 57+	b = append(b, r.panes[r.activeTab].(help.KeyMap).FullHelp()...)
 58 	return b
 59 }
 60 
 61@@ -161,8 +161,8 @@ func (r *Repo) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
 62 		)
 63 	case RefMsg:
 64 		r.ref = msg
 65-		for _, b := range r.boxes {
 66-			cmds = append(cmds, b.Init())
 67+		for _, p := range r.panes {
 68+			cmds = append(cmds, p.Init())
 69 		}
 70 		cmds = append(cmds,
 71 			r.updateStatusBarCmd,
 72@@ -193,8 +193,8 @@ func (r *Repo) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
 73 		}
 74 	case ReadmeMsg:
 75 	case FileItemsMsg:
 76-		f, cmd := r.boxes[filesTab].Update(msg)
 77-		r.boxes[filesTab] = f.(*Files)
 78+		f, cmd := r.panes[filesTab].Update(msg)
 79+		r.panes[filesTab] = f.(*Files)
 80 		if cmd != nil {
 81 			cmds = append(cmds, cmd)
 82 		}
 83@@ -202,22 +202,22 @@ func (r *Repo) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
 84 	// for now. We need to pass the TickMsg to the Log bubble when the Log is
 85 	// loading but not the current selected tab so that the spinner works.
 86 	case LogCountMsg, LogItemsMsg, spinner.TickMsg:
 87-		l, cmd := r.boxes[commitsTab].Update(msg)
 88-		r.boxes[commitsTab] = l.(*Log)
 89+		l, cmd := r.panes[commitsTab].Update(msg)
 90+		r.panes[commitsTab] = l.(*Log)
 91 		if cmd != nil {
 92 			cmds = append(cmds, cmd)
 93 		}
 94 	case RefItemsMsg:
 95 		switch msg.prefix {
 96 		case ggit.RefsHeads:
 97-			b, cmd := r.boxes[branchesTab].Update(msg)
 98-			r.boxes[branchesTab] = b.(*Refs)
 99+			b, cmd := r.panes[branchesTab].Update(msg)
100+			r.panes[branchesTab] = b.(*Refs)
101 			if cmd != nil {
102 				cmds = append(cmds, cmd)
103 			}
104 		case ggit.RefsTags: