From 426b836d03078a5e438319d0d2a90d9d2a93430b Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 27 Mar 2026 06:46:28 +0200 Subject: fix askcli header width for 0685342b-606c-4c8f-aab5-cd363d926e77 --- internal/askcli/formatter.go | 4 ++-- internal/askcli/formatter_test.go | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/internal/askcli/formatter.go b/internal/askcli/formatter.go index 7ca9225..9e3c245 100644 --- a/internal/askcli/formatter.go +++ b/internal/askcli/formatter.go @@ -31,7 +31,7 @@ type taskListWidths struct { func taskListWidthsFor(tasks []TaskExport, aliases map[string]string) taskListWidths { widths := taskListWidths{ Urgency: len("Urgency"), - Priority: len("Priority"), + Priority: len("Prio"), ID: len("ID"), Status: len("Status"), Started: len("Started"), @@ -53,7 +53,7 @@ func taskListWidthsFor(tasks []TaskExport, aliases map[string]string) taskListWi func writeTaskListHeader(b *strings.Builder, widths taskListWidths) { fmt.Fprintf(b, "%-*s | %-*s | %-*s | %-*s | %-*s | %-*s | %-*s\n", widths.Urgency, "Urgency", - widths.Priority, "Priority", + widths.Priority, "Prio", widths.ID, "ID", widths.Status, "Status", widths.Started, "Started", diff --git a/internal/askcli/formatter_test.go b/internal/askcli/formatter_test.go index c99effd..1d2a22e 100644 --- a/internal/askcli/formatter_test.go +++ b/internal/askcli/formatter_test.go @@ -18,8 +18,11 @@ func TestFormatTaskList(t *testing.T) { if len(lines) < 3 { t.Fatalf("FormatTaskList produced too few lines: %d", len(lines)) } - if !strings.Contains(lines[0], "ID") || !strings.Contains(lines[0], "Priority") { - t.Fatalf("header missing ID or Priority column: %s", lines[0]) + if !strings.Contains(lines[0], "ID") || !strings.Contains(lines[0], "Prio") { + t.Fatalf("header missing ID or Prio column: %s", lines[0]) + } + if strings.Contains(lines[0], "Priority") { + t.Fatalf("header should use compact Prio label: %s", lines[0]) } if !strings.Contains(lines[0], "Started") { t.Fatalf("header missing Started column: %s", lines[0]) @@ -62,7 +65,7 @@ func TestFormatTaskList_AlignsHeaderAndSeparator(t *testing.T) { widths := taskListWidthsFor(tasks, aliases) wantHeader := fmt.Sprintf("%-*s | %-*s | %-*s | %-*s | %-*s | %-*s | %-*s", widths.Urgency, "Urgency", - widths.Priority, "Priority", + widths.Priority, "Prio", widths.ID, "ID", widths.Status, "Status", widths.Started, "Started", -- cgit v1.2.3