From 4b93e2e4718df47109044b0f66462dbfdc77120d Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Mon, 13 Sep 2021 13:32:25 -0400 Subject: [PATCH] Remove a magic number when determining repo height --- tui/bubbles/repo/bubble.go | 2 +- tui/commands.go | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tui/bubbles/repo/bubble.go b/tui/bubbles/repo/bubble.go index fdc579ebb..573c869dc 100644 --- a/tui/bubbles/repo/bubble.go +++ b/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() { diff --git a/tui/commands.go b/tui/commands.go index 2675cb863..6deb2832f 100644 --- a/tui/commands.go +++ b/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