diff --git a/internal/tui/bubbles/git/about/bubble.go b/internal/tui/bubbles/git/about/bubble.go index 1bb36e9e0..4740246b6 100644 --- a/internal/tui/bubbles/git/about/bubble.go +++ b/internal/tui/bubbles/git/about/bubble.go @@ -88,7 +88,11 @@ func (b *Bubble) Help() []types.HelpEntry { func (b *Bubble) glamourize() (string, error) { w := b.width - b.widthMargin - b.styles.RepoBody.GetHorizontalFrameSize() - return types.Glamourize(w, b.repo.GetReadme()) + rm := b.repo.GetReadme() + if rm == "" { + return b.styles.AboutNoReadme.Render("No readme found."), nil + } + return types.Glamourize(w, rm) } func (b *Bubble) setupCmd() tea.Msg { diff --git a/internal/tui/bubbles/git/tree/bubble.go b/internal/tui/bubbles/git/tree/bubble.go index 94c4b43ea..1876df204 100644 --- a/internal/tui/bubbles/git/tree/bubble.go +++ b/internal/tui/bubbles/git/tree/bubble.go @@ -142,6 +142,7 @@ func NewBubble(repo types.Repo, styles *style.Styles, width, widthMargin, height l.DisableQuitKeybindings() l.KeyMap.NextPage = types.NextPage l.KeyMap.PrevPage = types.PrevPage + l.Styles.NoItems = styles.TreeNoItems b := &Bubble{ fileViewport: &vp.ViewportBubble{ Viewport: &viewport.Model{}, diff --git a/internal/tui/style/style.go b/internal/tui/style/style.go index e7c386fc4..ab2063e27 100644 --- a/internal/tui/style/style.go +++ b/internal/tui/style/style.go @@ -40,6 +40,8 @@ type Styles struct { ErrorTitle lipgloss.Style ErrorBody lipgloss.Style + AboutNoReadme lipgloss.Style + LogItemSelector lipgloss.Style LogItemActive lipgloss.Style LogItemInactive lipgloss.Style @@ -67,6 +69,8 @@ type Styles struct { TreeFileMode lipgloss.Style TreeFileSize lipgloss.Style TreeFileContent lipgloss.Style + TreePaginator lipgloss.Style + TreeNoItems lipgloss.Style Spinner lipgloss.Style } @@ -193,6 +197,10 @@ func DefaultStyles() *Styles { MarginLeft(2). Width(52) // for now + s.AboutNoReadme = lipgloss.NewStyle(). + MarginLeft(1). + Foreground(lipgloss.Color("#626262")) + s.LogItemInactive = lipgloss.NewStyle(). MarginLeft(1) @@ -262,6 +270,10 @@ func DefaultStyles() *Styles { s.TreeFileContent = lipgloss.NewStyle() + s.TreePaginator = s.LogPaginator.Copy() + + s.TreeNoItems = s.AboutNoReadme.Copy() + s.Spinner = lipgloss.NewStyle(). MarginLeft(1). Foreground(lipgloss.Color("205"))