making improvements based on copilot's suggestions from previous merge with main: subtracting the label heights from available heights before calculating the list height, to avoid potential layer overflow, in pkg/tui/views/view.go; creating a handler function for refreshing issue list and updating detail view, to avoid duplicate logic in pkg/tui/views/operations.go

This commit is contained in:
viljarb
2026-02-23 13:50:23 +01:00
parent d8d2994c8a
commit 7674ae3690
2 changed files with 29 additions and 42 deletions

View File

@@ -18,8 +18,14 @@ func (m *Model) View() string {
footer := m.footer()
footerHeight := lipgloss.Height(footer)
// 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
halfHeight := contentHeight / 2
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
}
@@ -36,8 +42,6 @@ func (m *Model) View() string {
closedListView := m.closedIssueList.View()
detailView := m.issueDetail.View()
mainLabel := styles.LabelStyle.Render("Display issues")
closedLabel := styles.LabelStyle.Render("Closed issues")
if m.focusedWindow == 0 {
mainLabel = lipgloss.NewStyle().Foreground(styles.Primary).Bold(true).Render("Display issues ▶")
} else {