comment out closed issues list, will find a better way to show closed issues

This commit is contained in:
Robin Olsen
2026-03-20 10:49:44 +01:00
parent c5bcc670bd
commit aa9de18c99

View File

@@ -1,7 +1,7 @@
package dashboard
import (
"charm.land/bubbletea/v2"
tea "charm.land/bubbletea/v2"
"charm.land/lipgloss/v2"
"github.com/LazyBachelor/LazyPM/pkg/tui/components"
"github.com/LazyBachelor/LazyPM/pkg/tui/styles"
@@ -24,21 +24,18 @@ func (m *Model) View() tea.View {
// To avoid layer overflow or clipping, the label heights are calculated and subtracted from the available height before calculating the list heights to avoid layout overflow or clipping.
contentHeight := m.height - headerHeight - footerHeight
mainLabel := styles.LabelStyle.Render("Display issues")
closedLabel := styles.LabelStyle.Render("Closed issues")
labelHeight := lipgloss.Height(mainLabel) + lipgloss.Height(closedLabel)
availableForLists := contentHeight - labelHeight
halfHeight := availableForLists / 2
if halfHeight < 1 {
halfHeight = 1
}
//mainLabel := styles.LabelStyle.Render("Display issues")
//closedLabel := styles.LabelStyle.Render("Closed issues")
//labelHeight := lipgloss.Height(mainLabel) + lipgloss.Height(closedLabel)
availableForLists := contentHeight
halfHeight := max(availableForLists / 2, 1)
totalContentWidth := m.width - 1
listWidth := totalContentWidth * styles.ListViewRatio / 100
detailWidth := totalContentWidth - listWidth
m.issueList.SetSize(listWidth, halfHeight)
m.closedIssueList.SetSize(listWidth, halfHeight)
//m.closedIssueList.SetSize(listWidth, halfHeight)
m.issueDetail.SetSize(detailWidth, contentHeight)
// Only highlight the focused list; unfocused list should not show selection highlight.
@@ -46,17 +43,19 @@ func (m *Model) View() tea.View {
m.closedIssueList.SetHighlightSelected(m.focusedWindow == 1 && m.focusedPaneClosed == 0)
listView := m.issueList.View()
closedListView := m.closedIssueList.View()
//closedListView := m.closedIssueList.View()
detailView := m.issueDetail.View()
if m.focusedWindow == 0 {
mainLabel = lipgloss.NewStyle().Foreground(styles.Primary).Bold(true).Render("Display issues ▶")
} else {
closedLabel = lipgloss.NewStyle().Foreground(styles.Primary).Bold(true).Render("Closed issues ▶")
}
//if m.focusedWindow == 0 {
// mainLabel = lipgloss.NewStyle().Foreground(styles.Primary).Bold(true).Render("Display issues ▶")
//} else {
// closedLabel = lipgloss.NewStyle().Foreground(styles.Primary).Bold(true).Render("Closed issues ▶")
//}
leftColumn := lipgloss.JoinVertical(lipgloss.Left,
mainLabel, listView,
closedLabel, closedListView,
//mainLabel,
listView,
//closedLabel, closedListView,
)
content := lipgloss.JoinHorizontal(lipgloss.Left, leftColumn, detailView)