diff options
| author | Paul Bütow <1224732+snonux@users.noreply.github.com> | 2025-06-20 18:36:01 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-20 18:36:01 +0300 |
| commit | 6acfce72b3ed9d814e546dc35ebfb45c8f833f41 (patch) | |
| tree | 6544f81103500a1d3d1fd5401012d41f677cb086 /internal/ui/table.go | |
| parent | fd6ac6bf1c2269093ba9fa0b20365a31d12a7bfa (diff) | |
| parent | e12c3213df812fdc0b21eba3d918c68b05d2502a (diff) | |
Merge pull request #25 from snonux/codex/remove-table-headers-and-show-status-info
Hide table headers and show selected column
Diffstat (limited to 'internal/ui/table.go')
| -rw-r--r-- | internal/ui/table.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/internal/ui/table.go b/internal/ui/table.go index a3f6581..4c5aa3d 100644 --- a/internal/ui/table.go +++ b/internal/ui/table.go @@ -71,6 +71,7 @@ func newTable(rows []atable.Row) atable.Model { atable.WithColumns(cols), atable.WithRows(rows), atable.WithFocused(true), + atable.WithShowHeaders(false), ) styles := atable.DefaultStyles() styles.Header = styles.Header.Foreground(lipgloss.Color("205")) @@ -228,7 +229,12 @@ func (m Model) View() string { } func (m Model) statusLine() string { - status := fmt.Sprintf("Total:%d InProgress:%d Due:%d", m.total, m.inProgress, m.due) + header := "" + cols := m.tbl.Columns() + if idx := m.tbl.ColumnCursor(); idx >= 0 && idx < len(cols) { + header = cols[idx].Title + } + status := fmt.Sprintf("%s Total:%d InProgress:%d Due:%d", header, m.total, m.inProgress, m.due) return lipgloss.NewStyle(). Foreground(lipgloss.Color("229")). Background(lipgloss.Color("57")). |
