adding functionality for editing priority; adding priority to the list of displayed issues; sorting the list of issues by their priority

This commit is contained in:
viljarb
2026-02-23 15:56:16 +01:00
parent 7674ae3690
commit 970c735fa4
7 changed files with 103 additions and 12 deletions

View File

@@ -7,6 +7,7 @@ import (
func (m *Model) View() string {
if m.width == 0 || m.height == 0 {
// if there is no space just print a loading message
return "Loading..."
}
@@ -125,6 +126,20 @@ func (m *Model) View() string {
return lipgloss.Place(m.width, m.height, lipgloss.Center, lipgloss.Center, statusBox)
}
if m.choosingPriority {
priorityContent := lipgloss.JoinVertical(lipgloss.Left,
styles.LabelStyle.Render("Change priority for "+m.priorityIssueID+":"),
lipgloss.NewStyle().Foreground(styles.FaintText).Render("0 = lowest 1 = low 2 = medium 3 = high 4 = highest"),
lipgloss.NewStyle().Foreground(styles.FaintText).Render("Esc = cancel"),
)
priorityBoxWidth := min(60, m.width-4)
priorityBox := styles.ContainerStyle.
Width(priorityBoxWidth).
BorderForeground(styles.PrimaryBorder).
Render(priorityContent)
return lipgloss.Place(m.width, m.height, lipgloss.Center, lipgloss.Center, priorityBox)
}
return mainView
}