Skip to content
Draft
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
24 changes: 12 additions & 12 deletions review.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,15 @@ func formatDueTime(deadlineOffset int) string {
func formatGoalDetails(goal *Goal, config *Config, colorStyles map[string]lipgloss.Style) string {
var details string

// Display title only if not empty
if goal.Title != "" {
details += fmt.Sprintf("Title: %s\n", goal.Title)
// Display current rate (n / unit)
if goal.Rate != nil && goal.Runits != "" {
rateStr := formatRate(*goal.Rate, goal.Runits, goal.Gunits)
details += fmt.Sprintf("Rate: %s\n", rateStr)
}

// Display autoratchet only if set (not nil)
if goal.Autoratchet != nil {
details += fmt.Sprintf("Autoratchet: %.0f\n", *goal.Autoratchet)
}

// Display limsum with color coding based on urgency
Expand Down Expand Up @@ -254,22 +260,16 @@ func formatGoalDetails(goal *Goal, config *Config, colorStyles map[string]lipglo

details += fmt.Sprintf("Pledge: $%.2f\n", goal.Pledge)

// Display current rate (n / unit)
if goal.Rate != nil && goal.Runits != "" {
rateStr := formatRate(*goal.Rate, goal.Runits, goal.Gunits)
details += fmt.Sprintf("Rate: %s\n", rateStr)
// Display title only if not empty
if goal.Title != "" {
details += fmt.Sprintf("Title: %s\n", goal.Title)
}

// Display autodata only if not empty
if goal.Autodata != "" {
details += fmt.Sprintf("Autodata: %s\n", goal.Autodata)
}

// Display autoratchet only if set (not nil)
if goal.Autoratchet != nil {
details += fmt.Sprintf("Autoratchet: %.0f\n", *goal.Autoratchet)
}

// Generate and display goal URL
baseURL := getBaseURL(config)
goalURL := fmt.Sprintf("%s/%s/%s", baseURL, url.PathEscape(config.Username), url.PathEscape(goal.Slug))
Expand Down