diff options
| author | T <t@tjp.lol> | 2026-02-19 19:42:22 -0700 |
|---|---|---|
| committer | T <t@tjp.lol> | 2026-02-19 19:42:57 -0700 |
| commit | 2ad5e85c729b4a32c4c49584e076ac9f6ce6fa60 (patch) | |
| tree | c6aa5db061504406f40d904399af4fb01857a0a9 /internal/tui/projects_box.go | |
| parent | 7ba68d333bc20b5795ccfd3870546a05eee60470 (diff) | |
re-skin
Diffstat (limited to 'internal/tui/projects_box.go')
| -rw-r--r-- | internal/tui/projects_box.go | 66 |
1 files changed, 30 insertions, 36 deletions
diff --git a/internal/tui/projects_box.go b/internal/tui/projects_box.go index cd50d5e..d909e20 100644 --- a/internal/tui/projects_box.go +++ b/internal/tui/projects_box.go @@ -74,7 +74,7 @@ func (m ClientsProjectsModel) View(width, height int, isSelected bool) string { style = selectedBoxStyle } - title := titleStyle.Render("👥 Clients & Projects") + title := titleStyle.Render("Clients & Projects") return style.Width(width).Height(height).Render( fmt.Sprintf("%s\n\n%s", title, content), @@ -86,57 +86,51 @@ func (m ClientsProjectsModel) renderClientsAndProjects() string { var content string visibleClients := m.visibleClients() + rateStyle := lipgloss.NewStyle().Foreground(colorDimmed) + treeStyle := lipgloss.NewStyle().Foreground(colorSubtle) + for i, client := range visibleClients { if i > 0 { content += "\n" } - // Build client name and rate - clientText := client.Name - if client.BillableRate.Valid { - rateInDollars := float64(client.BillableRate.Int64) / 100.0 - clientText += fmt.Sprintf(" ($%.2f/hr)", rateInDollars) - } - // Style for client text clientStyle := lipgloss.NewStyle().Bold(true) if m.selectedClient == i && m.selectedProject == nil { - clientStyle = clientStyle.Background(lipgloss.Color("62")).Foreground(lipgloss.Color("230")) + clientStyle = clientStyle.Background(colorSelected).Foreground(colorSelectedFg) } else if client.Archived != 0 { - // Gray out archived clients - clientStyle = clientStyle.Foreground(lipgloss.Color("246")) + clientStyle = clientStyle.Foreground(colorDimmed) } - content += "• " + clientStyle.Render(clientText) + "\n" + clientText := client.Name + content += clientStyle.Render(clientText) + if client.BillableRate.Valid && !(m.selectedClient == i && m.selectedProject == nil) { + rateInDollars := float64(client.BillableRate.Int64) / 100.0 + content += rateStyle.Render(fmt.Sprintf(" $%g", rateInDollars)) + } + content += "\n" visibleProjects := m.visibleProjects(client.ID) - if len(visibleProjects) == 0 { - content += " └── (no projects)\n" - } else { - for j, project := range visibleProjects { - prefix := "├──" - if j == len(visibleProjects)-1 { - prefix = "└──" - } - - // Build project name and rate - projectText := project.Name - if project.BillableRate.Valid { - rateInDollars := float64(project.BillableRate.Int64) / 100.0 - projectText += fmt.Sprintf(" ($%.2f/hr)", rateInDollars) - } + for j, project := range visibleProjects { + prefix := "├ " + if j == len(visibleProjects)-1 { + prefix = "└ " + } - // Style for project text - projectStyle := lipgloss.NewStyle() - if m.selectedClient == i && m.selectedProject != nil && *m.selectedProject == j { - projectStyle = projectStyle.Background(lipgloss.Color("62")).Foreground(lipgloss.Color("230")) - } else if project.Archived != 0 { - // Gray out archived projects - projectStyle = projectStyle.Foreground(lipgloss.Color("246")) - } + // Style for project text + projectStyle := lipgloss.NewStyle() + if m.selectedClient == i && m.selectedProject != nil && *m.selectedProject == j { + projectStyle = projectStyle.Background(colorSelected).Foreground(colorSelectedFg) + } else if project.Archived != 0 { + projectStyle = projectStyle.Foreground(colorDimmed) + } - content += fmt.Sprintf(" %s ", prefix) + projectStyle.Render(projectText) + "\n" + content += treeStyle.Render(" "+prefix) + projectStyle.Render(project.Name) + if project.BillableRate.Valid && !(m.selectedClient == i && m.selectedProject != nil && *m.selectedProject == j) { + rateInDollars := float64(project.BillableRate.Int64) / 100.0 + content += rateStyle.Render(fmt.Sprintf(" $%g", rateInDollars)) } + content += "\n" } } |
