From 4adbf9311ee44e9928d9cc939a032671c83de46b Mon Sep 17 00:00:00 2001 From: Kyriakos Akriotis Date: Tue, 20 Oct 2026 12:11:56 +0200 Subject: [PATCH 1/2] hide all except timestamp in compact mode, fix tableviewport title in both modes #163 --- internal/ui/app.go | 10 +++++++++- internal/ui/render.go | 21 ++++++++------------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/internal/ui/app.go b/internal/ui/app.go index 9631260..f9a0fb6 100644 --- a/internal/ui/app.go +++ b/internal/ui/app.go @@ -697,6 +697,11 @@ func (m Model) View() string { ) } + compactMode := false + if m.width <= compactWidth { + compactMode = true + } + header := m.renderHeader() contentView := m.renderTable() @@ -710,7 +715,7 @@ func (m Model) View() string { if m.resource != nil { var resourceTags strings.Builder - if m.width > compactWidth { + if !compactMode { for _, entry := range m.navigation { resourceTags.WriteString( navigationTagStyle.Render(" <"+entry.resource+"> ") + mainStyle.Render(" "), @@ -763,6 +768,9 @@ func (m Model) View() string { } rightTag := lipgloss.JoinHorizontal(lipgloss.Left, debugTag, debugState, cacheTag, useCachedState, autoRefreshTag, autoRefreshMsgState, timeTag) + if compactMode { + rightTag = lipgloss.JoinHorizontal(lipgloss.Left, timeTag) + } if m.showLoading { loadingLabelTag := infoStyle.Render(fmt.Sprintf(" %s ", m.loadingLabel)) diff --git a/internal/ui/render.go b/internal/ui/render.go index 728b59d..1890f8b 100644 --- a/internal/ui/render.go +++ b/internal/ui/render.go @@ -224,14 +224,13 @@ func (m Model) renderTable() string { title := "" if m.resource != nil { - title = fmt.Sprintf( - " %s[%d] ", - m.resource.Kind(), - m.itemCount, - ) - - if !m.showHeaderContext() && m.context.Cloud != "" { - title = fmt.Sprintf(" (%s)%s", m.context.Cloud, title) + title = fmt.Sprintf(" %s[%d] ", m.resource.Kind(), m.itemCount) + + if len(m.navigation) > 0 { + parent := m.navigation[len(m.navigation)-1] + title = fmt.Sprintf(" %s(%s/%s)[%d]", m.resource.Kind(), parent.resource, parent.id, m.itemCount) + } else if !m.showHeaderContext() && m.context.Cloud != "" && m.resource.Kind() != "contexts" { + title = fmt.Sprintf(" %s(%s)[%d]", m.resource.Kind(), m.context.Cloud, m.itemCount) } } @@ -296,10 +295,6 @@ func (m Model) renderTable() string { body = header + "\n" + emptyContent } } - // - //selectedStyle := lipgloss.NewStyle(). - // Foreground(lipgloss.Color(m.skin.TableSelected.Foreground)). - // Background(lipgloss.Color(m.skin.TableSelected.Background)) paddingStyle := lipgloss.NewStyle(). Background(lipgloss.Color(m.skin.Table.Background)) @@ -333,7 +328,7 @@ func (m Model) renderDetails() string { } if m.resource != nil && m.detailID != "" { - title = fmt.Sprintf(" %s %s ", m.resource.Kind(), m.detailID) + title = fmt.Sprintf(" %s/%s ", m.resource.Kind(), m.detailID) } innerWidth := max(m.width-2, 1) From 51b00b9446ef90c8169578a86c19117e901a146b Mon Sep 17 00:00:00 2001 From: Kyriakos Akriotis Date: Tue, 20 Oct 2026 12:14:55 +0200 Subject: [PATCH 2/2] fixed tableviewport title right margin #163 --- internal/ui/render.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/ui/render.go b/internal/ui/render.go index 1890f8b..433ba3c 100644 --- a/internal/ui/render.go +++ b/internal/ui/render.go @@ -228,9 +228,9 @@ func (m Model) renderTable() string { if len(m.navigation) > 0 { parent := m.navigation[len(m.navigation)-1] - title = fmt.Sprintf(" %s(%s/%s)[%d]", m.resource.Kind(), parent.resource, parent.id, m.itemCount) + title = fmt.Sprintf(" %s(%s/%s)[%d] ", m.resource.Kind(), parent.resource, parent.id, m.itemCount) } else if !m.showHeaderContext() && m.context.Cloud != "" && m.resource.Kind() != "contexts" { - title = fmt.Sprintf(" %s(%s)[%d]", m.resource.Kind(), m.context.Cloud, m.itemCount) + title = fmt.Sprintf(" %s(%s)[%d] ", m.resource.Kind(), m.context.Cloud, m.itemCount) } }