From b53c952fc8a054d935d90db2ccf3f0b897e6c771 Mon Sep 17 00:00:00 2001 From: T Date: Thu, 19 Feb 2026 22:24:55 -0700 Subject: contractor bar across the top --- internal/tui/shared.go | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) (limited to 'internal/tui/shared.go') diff --git a/internal/tui/shared.go b/internal/tui/shared.go index 9025fb8..75126c9 100644 --- a/internal/tui/shared.go +++ b/internal/tui/shared.go @@ -157,7 +157,7 @@ func getMostRecentTimerInfo(ctx context.Context, q *queries.Queries) (TimerInfo, // RenderTopBar renders the top bar with view name and time stats func RenderTopBar(m AppModel, contentWidth int) string { - leftText := fmt.Sprintf("Punchcard / %s", m.selectedBox.String()) + leftText := fmt.Sprintf("Punchcard 👊 💳 / %s", m.selectedBox.String()) today := m.timeStats.TodayTotal week := m.timeStats.WeekTotal @@ -344,6 +344,50 @@ func getAppData( return } +// RenderContractorPanel renders the full-width contractor info panel. +func RenderContractorPanel(c ContractorInfo, contentWidth int, isSelected bool) string { + style := unselectedBoxStyle + if isSelected { + style = selectedBoxStyle + } + + // Build content: name, label, email on one line separated by dimmed dividers + dimStyle := lipgloss.NewStyle().Foreground(colorDimmed) + nameStyle := lipgloss.NewStyle().Bold(true).Foreground(colorFg) + + var parts []string + if c.name != "" { + parts = append(parts, nameStyle.Render(c.name)) + } + if c.label != "" { + parts = append(parts, dimStyle.Render(c.label)) + } + if c.email != "" { + parts = append(parts, dimStyle.Render(c.email)) + } + + var content string + if len(parts) == 0 { + content = dimStyle.Render("No contractor info set. Press 'e' to edit.") + } else { + sep := dimStyle.Render(" | ") + content = "" + for i, part := range parts { + if i > 0 { + content += sep + } + content += part + } + } + + // Use padding 0 vertically to keep it compact, override the box style padding + panelStyle := style. + Width(contentWidth). + Padding(0, 2) + + return panelStyle.Render(content) +} + func mostRecentMonday(from time.Time) time.Time { d := dateOnly(from.Local()) dayOffset := time.Duration(d.Weekday()-1) % 7 -- cgit v1.2.3