Change summary
ui/components/footer/footer.go | 6 ++++--
ui/pages/repo/log.go | 25 ++++++++++---------------
ui/styles/styles.go | 3 ++-
3 files changed, 16 insertions(+), 18 deletions(-)
Detailed changes
@@ -34,7 +34,8 @@ func New(c common.Common, keymap help.KeyMap) *Footer {
// SetSize implements common.Component.
func (f *Footer) SetSize(width, height int) {
f.common.SetSize(width, height)
- f.help.Width = width
+ f.help.Width = width -
+ f.common.Styles.Footer.GetHorizontalFrameSize()
}
// Init implements tea.Model.
@@ -52,7 +53,8 @@ func (f *Footer) View() string {
if f.keymap == nil {
return ""
}
- s := f.common.Styles.Footer.Copy().Width(f.common.Width)
+ s := f.common.Styles.Footer.Copy().
+ Width(f.common.Width)
helpView := f.help.View(f.keymap)
return s.Render(helpView)
}
@@ -7,7 +7,6 @@ import (
"github.com/charmbracelet/bubbles/key"
tea "github.com/charmbracelet/bubbletea"
- "github.com/charmbracelet/glamour"
gansi "github.com/charmbracelet/glamour/ansi"
"github.com/charmbracelet/lipgloss"
ggit "github.com/charmbracelet/soft-serve/git"
@@ -277,10 +276,15 @@ func (l *Log) StatusBarValue() string {
if c == nil {
return ""
}
- return fmt.Sprintf("%s by %s",
- c.ID.String(),
- fmt.Sprintf("%s <%s>", c.Author.Name, c.Author.Email),
- )
+ who := c.Author.Name
+ if email := c.Author.Email; email != "" {
+ who += " <" + email + ">"
+ }
+ value := c.ID.String()
+ if who != "" {
+ value += " by " + who
+ }
+ return value
}
// StatusBarInfo returns the status bar info.
@@ -348,19 +352,10 @@ func (l *Log) loadDiffCmd() tea.Msg {
return LogDiffMsg(diff)
}
-func styleConfig() gansi.StyleConfig {
- noColor := ""
- s := glamour.DarkStyleConfig
- s.Document.StylePrimitive.Color = &noColor
- s.CodeBlock.Chroma.Text.Color = &noColor
- s.CodeBlock.Chroma.Name.Color = &noColor
- return s
-}
-
func renderCtx() gansi.RenderContext {
return gansi.NewRenderContext(gansi.Options{
ColorProfile: termenv.TrueColor,
- Styles: styleConfig(),
+ Styles: common.StyleConfig(),
})
}
@@ -208,10 +208,11 @@ func DefaultStyles() *Styles {
Bold(true)
s.RepoHeaderDesc = lipgloss.NewStyle().
+ Faint(true).
Foreground(lipgloss.Color("15"))
s.Footer = lipgloss.NewStyle().
- PaddingLeft(1).
+ Padding(0, 1).
Height(1)
s.Branch = lipgloss.NewStyle().