From 6a820a17ef8a6dd76e4f984cf6269beb8c96d0c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20B=C3=BCtow?= <1224732+snonux@users.noreply.github.com> Date: Fri, 20 Jun 2025 00:32:50 +0300 Subject: Fix ANSI color truncation by using ansi-aware table --- internal/ui/table.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'internal/ui') diff --git a/internal/ui/table.go b/internal/ui/table.go index af85acb..4300034 100644 --- a/internal/ui/table.go +++ b/internal/ui/table.go @@ -1,20 +1,20 @@ package ui import ( - "github.com/charmbracelet/bubbles/table" tea "github.com/charmbracelet/bubbletea" "github.com/charmbracelet/lipgloss" + atable "tasksamurai/internal/atable" ) // Model wraps a Bubble Tea table.Model to display tasks. type Model struct { - tbl table.Model + tbl atable.Model showHelp bool } // New creates a new UI model with the provided rows. -func New(rows []table.Row) Model { - cols := []table.Column{ +func New(rows []atable.Row) Model { + cols := []atable.Column{ {Title: "ID", Width: 4}, {Title: "Task", Width: 30}, {Title: "Active", Width: 6}, @@ -26,12 +26,12 @@ func New(rows []table.Row) Model { {Title: "Urg", Width: 5}, {Title: "Annotations", Width: 20}, } - t := table.New( - table.WithColumns(cols), - table.WithRows(rows), - table.WithFocused(true), + t := atable.New( + atable.WithColumns(cols), + atable.WithRows(rows), + atable.WithFocused(true), ) - styles := table.DefaultStyles() + styles := atable.DefaultStyles() styles.Header = styles.Header.Foreground(lipgloss.Color("205")) styles.Selected = styles.Selected.Foreground(lipgloss.Color("229")).Background(lipgloss.Color("57")) styles.Cell = styles.Cell.Padding(0, 1) -- cgit v1.2.3