Remove a magic number when determining repo height

Christian Rocha created

Change summary

tui/bubbles/repo/bubble.go | 2 +-
tui/commands.go            | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)

Detailed changes

tui/bubbles/repo/bubble.go 🔗

@@ -88,7 +88,7 @@ func (b *Bubble) SetSize(w, h int) {
 	b.width = w
 	b.height = h
 	b.readmeViewport.Viewport.Width = w - b.widthMargin
-	b.readmeViewport.Viewport.Height = h - b.heightMargin
+	b.readmeViewport.Viewport.Height = h - lipgloss.Height(b.headerView()) - b.heightMargin
 }
 
 func (b *Bubble) GotoTop() {

tui/commands.go 🔗

@@ -47,8 +47,7 @@ func (b *Bubble) setupCmd() tea.Msg {
 		var heightMargin = lipgloss.Height(b.headerView()) +
 			lipgloss.Height(b.footerView()) +
 			b.styles.RepoBody.GetVerticalFrameSize() +
-			b.styles.App.GetVerticalMargins() +
-			3 // TODO: make this dynamic (this is the height of the repo info)
+			b.styles.App.GetVerticalMargins()
 		rb := repo.NewBubble(b.repoSource, me.Repo, b.styles, width, boxLeftWidth, b.height, heightMargin, tmplConfig)
 		rb.Host = b.config.Host
 		rb.Port = b.config.Port