comment out closed issues list, will find a better way to show closed issues
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
package dashboard
|
package dashboard
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"charm.land/bubbletea/v2"
|
tea "charm.land/bubbletea/v2"
|
||||||
"charm.land/lipgloss/v2"
|
"charm.land/lipgloss/v2"
|
||||||
"github.com/LazyBachelor/LazyPM/pkg/tui/components"
|
"github.com/LazyBachelor/LazyPM/pkg/tui/components"
|
||||||
"github.com/LazyBachelor/LazyPM/pkg/tui/styles"
|
"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.
|
// 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
|
contentHeight := m.height - headerHeight - footerHeight
|
||||||
|
|
||||||
mainLabel := styles.LabelStyle.Render("Display issues")
|
//mainLabel := styles.LabelStyle.Render("Display issues")
|
||||||
closedLabel := styles.LabelStyle.Render("Closed issues")
|
//closedLabel := styles.LabelStyle.Render("Closed issues")
|
||||||
labelHeight := lipgloss.Height(mainLabel) + lipgloss.Height(closedLabel)
|
//labelHeight := lipgloss.Height(mainLabel) + lipgloss.Height(closedLabel)
|
||||||
availableForLists := contentHeight - labelHeight
|
availableForLists := contentHeight
|
||||||
halfHeight := availableForLists / 2
|
halfHeight := max(availableForLists / 2, 1)
|
||||||
if halfHeight < 1 {
|
|
||||||
halfHeight = 1
|
|
||||||
}
|
|
||||||
|
|
||||||
totalContentWidth := m.width - 1
|
totalContentWidth := m.width - 1
|
||||||
listWidth := totalContentWidth * styles.ListViewRatio / 100
|
listWidth := totalContentWidth * styles.ListViewRatio / 100
|
||||||
detailWidth := totalContentWidth - listWidth
|
detailWidth := totalContentWidth - listWidth
|
||||||
|
|
||||||
m.issueList.SetSize(listWidth, halfHeight)
|
m.issueList.SetSize(listWidth, halfHeight)
|
||||||
m.closedIssueList.SetSize(listWidth, halfHeight)
|
//m.closedIssueList.SetSize(listWidth, halfHeight)
|
||||||
m.issueDetail.SetSize(detailWidth, contentHeight)
|
m.issueDetail.SetSize(detailWidth, contentHeight)
|
||||||
|
|
||||||
// Only highlight the focused list; unfocused list should not show selection highlight.
|
// 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)
|
m.closedIssueList.SetHighlightSelected(m.focusedWindow == 1 && m.focusedPaneClosed == 0)
|
||||||
|
|
||||||
listView := m.issueList.View()
|
listView := m.issueList.View()
|
||||||
closedListView := m.closedIssueList.View()
|
//closedListView := m.closedIssueList.View()
|
||||||
detailView := m.issueDetail.View()
|
detailView := m.issueDetail.View()
|
||||||
|
|
||||||
if m.focusedWindow == 0 {
|
//if m.focusedWindow == 0 {
|
||||||
mainLabel = lipgloss.NewStyle().Foreground(styles.Primary).Bold(true).Render("Display issues ▶")
|
// mainLabel = lipgloss.NewStyle().Foreground(styles.Primary).Bold(true).Render("Display issues ▶")
|
||||||
} else {
|
//} else {
|
||||||
closedLabel = lipgloss.NewStyle().Foreground(styles.Primary).Bold(true).Render("Closed issues ▶")
|
// closedLabel = lipgloss.NewStyle().Foreground(styles.Primary).Bold(true).Render("Closed issues ▶")
|
||||||
}
|
//}
|
||||||
|
|
||||||
leftColumn := lipgloss.JoinVertical(lipgloss.Left,
|
leftColumn := lipgloss.JoinVertical(lipgloss.Left,
|
||||||
mainLabel, listView,
|
//mainLabel,
|
||||||
closedLabel, closedListView,
|
listView,
|
||||||
|
//closedLabel, closedListView,
|
||||||
)
|
)
|
||||||
content := lipgloss.JoinHorizontal(lipgloss.Left, leftColumn, detailView)
|
content := lipgloss.JoinHorizontal(lipgloss.Left, leftColumn, detailView)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user