Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions internal/tui/workspace/views/boosts.go

This file was deleted.

4 changes: 2 additions & 2 deletions internal/tui/workspace/views/campfire.go
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ func (v *Campfire) renderMessages() {
b.WriteString(" ")
b.WriteString(timeStyle.Render(line.CreatedAt))
if line.GetBoosts().Count > 0 {
b.WriteString(lipgloss.NewStyle().Foreground(theme.Muted).Render(" " + boostLabel(line.GetBoosts().Count)))
b.WriteString(lipgloss.NewStyle().Foreground(theme.Muted).Render(" " + widget.BoostLabel(line.GetBoosts().Count)))
}
b.WriteString("\n")
}
Expand All @@ -640,7 +640,7 @@ func (v *Campfire) renderMessages() {
b.WriteString(rendered)
// Show boosts inline for grouped (non-header) messages
if !showHeader && line.GetBoosts().Count > 0 {
b.WriteString(lipgloss.NewStyle().Foreground(theme.Muted).Render(" " + boostLabel(line.GetBoosts().Count)))
b.WriteString(lipgloss.NewStyle().Foreground(theme.Muted).Render(" " + widget.BoostLabel(line.GetBoosts().Count)))
}
b.WriteString("\n")
}
Expand Down
2 changes: 1 addition & 1 deletion internal/tui/workspace/views/detail.go
Original file line number Diff line number Diff line change
Expand Up @@ -1307,7 +1307,7 @@ func (v *Detail) syncPreview() {
})
}
if v.data.boosts > 0 {
boostValue := boostLabel(v.data.boosts)
boostValue := widget.BoostLabel(v.data.boosts)
if len(v.data.boostDetails) > 0 {
const maxShown = 3
var parts []string
Expand Down
4 changes: 2 additions & 2 deletions internal/tui/workspace/widget/kanban.go
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ func (k *Kanban) renderFocusedCard(card KanbanCard, width int, theme tui.Theme)
func (k *Kanban) renderUnfocusedCard(card KanbanCard, width int, theme tui.Theme) string {
boostStr := ""
if card.Boosts > 0 {
boostStr = " " + boostLabel(card.Boosts)
boostStr = " " + lipgloss.NewStyle().Foreground(theme.Muted).Render(BoostLabel(card.Boosts))
}
availWidth := width - 2 - lipgloss.Width(boostStr) // 2 for " " prefix
title := Truncate(card.Title, availWidth)
Expand Down Expand Up @@ -556,7 +556,7 @@ func buildDetailLine(card KanbanCard) string {
parts = append(parts, fmt.Sprintf("%d comments", card.CommentsCount))
}
if card.Boosts > 0 {
parts = append(parts, boostLabel(card.Boosts))
parts = append(parts, BoostLabel(card.Boosts))
}
return strings.Join(parts, " \u00b7 ") // middle dot separator
}
Expand Down
8 changes: 4 additions & 4 deletions internal/tui/workspace/widget/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ func (l *List) renderItem(item ListItem, selected bool, theme tui.Theme) string
maxTitleWidth -= 2 // "* " prefix
}
if item.Boosts > 0 {
maxTitleWidth -= lipgloss.Width(" " + boostLabel(item.Boosts))
maxTitleWidth -= lipgloss.Width(" " + BoostLabel(item.Boosts))
}
if item.Extra != "" {
maxTitleWidth -= lipgloss.Width(item.Extra) + 2 // extra + gap
Expand All @@ -516,7 +516,7 @@ func (l *List) renderItem(item ListItem, selected bool, theme tui.Theme) string

line := cursor + titleStyle.Render(title)
if item.Boosts > 0 {
line += descStyle.Render(" " + boostLabel(item.Boosts))
line += descStyle.Render(" " + BoostLabel(item.Boosts))
}

// Add extra (right-aligned) if space permits
Expand Down Expand Up @@ -555,8 +555,8 @@ func (l *List) renderItem(item ListItem, selected bool, theme tui.Theme) string
return line
}

// boostLabel returns "1 boost" or "N boosts".
func boostLabel(n int) string {
// BoostLabel returns "1 boost" or "N boosts".
func BoostLabel(n int) string {
if n == 1 {
return "1 boost"
}
Expand Down
6 changes: 3 additions & 3 deletions internal/tui/workspace/widget/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,9 @@ func TestList_BoostSingularPlural(t *testing.T) {
}

func TestList_BoostLabel(t *testing.T) {
assert.Equal(t, "1 boost", boostLabel(1))
assert.Equal(t, "2 boosts", boostLabel(2))
assert.Equal(t, "99 boosts", boostLabel(99))
assert.Equal(t, "1 boost", BoostLabel(1))
assert.Equal(t, "2 boosts", BoostLabel(2))
assert.Equal(t, "99 boosts", BoostLabel(99))
}

func TestList_LongFilter_NoOverflow(t *testing.T) {
Expand Down
Loading