summaryrefslogtreecommitdiff
path: root/internal/ui
diff options
context:
space:
mode:
authorPaul Bütow <1224732+snonux@users.noreply.github.com>2025-06-20 00:32:50 +0300
committerPaul Bütow <1224732+snonux@users.noreply.github.com>2025-06-20 00:32:50 +0300
commit6a820a17ef8a6dd76e4f984cf6269beb8c96d0c3 (patch)
tree33073d2d963ef1d60fc4aa56d62e460a17008510 /internal/ui
parent603024c59e04019cb867c43d8e8298b2d459de3d (diff)
Fix ANSI color truncation by using ansi-aware table
Diffstat (limited to 'internal/ui')
-rw-r--r--internal/ui/table.go18
1 files changed, 9 insertions, 9 deletions
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)