Merge pull request #75 from LazyBachelor/LPM-140
LPM-140 The Sprinting Update Adds sprint support across the web UI (board + issue detail), TUI kanban, CLI/REPL, and the Beads-backed storage layer. Changes: Introduces sprint entities in storage and exposes sprint operations via IssueService. Updates web board to support backlog vs. sprint columns, sprint selection, and sprint creation routes. Updates TUI kanban to show backlog + sprint columns and adds sprint selection/creation actions.
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
package kanban
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
tea "charm.land/bubbletea/v2"
|
||||
"charm.land/lipgloss/v2"
|
||||
"github.com/LazyBachelor/LazyPM/internal/style"
|
||||
"github.com/LazyBachelor/LazyPM/pkg/tui/components"
|
||||
"github.com/LazyBachelor/LazyPM/pkg/tui/modal"
|
||||
"github.com/LazyBachelor/LazyPM/internal/style"
|
||||
)
|
||||
|
||||
func (m *Model) View() tea.View {
|
||||
@@ -16,6 +18,14 @@ func (m *Model) View() tea.View {
|
||||
m.helpBar.SetWidth(m.width)
|
||||
m.modalManager.SetSize(m.width, m.height)
|
||||
|
||||
var sprintName string
|
||||
if m.currentSprintNum > 0 {
|
||||
sprintName = fmt.Sprintf("Sprint %d", m.currentSprintNum)
|
||||
} else {
|
||||
sprintName = "No Sprint"
|
||||
}
|
||||
|
||||
m.header = components.NewHeader(fmt.Sprintf("Kanban Board - %s", sprintName))
|
||||
header := m.header.View(m.width)
|
||||
headerHeight := m.header.Height()
|
||||
|
||||
@@ -24,49 +34,53 @@ func (m *Model) View() tea.View {
|
||||
|
||||
contentHeight := m.height - headerHeight - footerHeight
|
||||
totalContentWidth := m.width - 1
|
||||
colWidth := max(totalContentWidth/4, 20)
|
||||
colWidth := max(totalContentWidth/5, 16)
|
||||
|
||||
// Calculate initial list height (half of content height, minimum 5 rows)
|
||||
listHeight := contentHeight / 2
|
||||
if listHeight < 5 {
|
||||
listHeight = contentHeight
|
||||
}
|
||||
|
||||
m.backlogList.SetSize(colWidth, listHeight-1)
|
||||
m.todoList.SetSize(colWidth, listHeight-1)
|
||||
m.inProgList.SetSize(colWidth, listHeight-1)
|
||||
m.blockedList.SetSize(colWidth, listHeight-1)
|
||||
m.doneList.SetSize(colWidth, listHeight-1)
|
||||
|
||||
// Only highlight the focused column's selected row
|
||||
currentFocus := m.focusManager.Current()
|
||||
m.backlogList.SetHighlightSelected(currentFocus == modal.FocusColumn0)
|
||||
m.todoList.SetHighlightSelected(currentFocus == modal.FocusColumn1)
|
||||
m.inProgList.SetHighlightSelected(currentFocus == modal.FocusColumn2)
|
||||
m.blockedList.SetHighlightSelected(currentFocus == modal.FocusColumn3)
|
||||
m.doneList.SetHighlightSelected(currentFocus == modal.FocusColumn4)
|
||||
|
||||
todoLabel := style.LabelStyle.Render("To Do")
|
||||
inProgLabel := style.LabelStyle.Render("In Progress")
|
||||
blockedLabel := style.LabelStyle.Render("Blocked")
|
||||
doneLabel := style.LabelStyle.Render("Done")
|
||||
backlogLabel := style.LabelStyle.Render("Backlog")
|
||||
todoLabel := style.LabelStyle.Render(fmt.Sprintf("%s - To Do", sprintName))
|
||||
inProgLabel := style.LabelStyle.Render(fmt.Sprintf("%s - In Progress", sprintName))
|
||||
blockedLabel := style.LabelStyle.Render(fmt.Sprintf("%s - Blocked", sprintName))
|
||||
doneLabel := style.LabelStyle.Render(fmt.Sprintf("%s - Done", sprintName))
|
||||
|
||||
highlight := lipgloss.NewStyle().Foreground(style.Primary).Bold(true)
|
||||
switch currentFocus {
|
||||
case modal.FocusColumn0:
|
||||
backlogLabel = highlight.Render("Backlog ▶")
|
||||
case modal.FocusColumn1:
|
||||
todoLabel = highlight.Render("To Do ▶")
|
||||
todoLabel = highlight.Render(fmt.Sprintf("%s - To Do ▶", sprintName))
|
||||
case modal.FocusColumn2:
|
||||
inProgLabel = highlight.Render("In Progress ▶")
|
||||
inProgLabel = highlight.Render(fmt.Sprintf("%s - In Progress ▶", sprintName))
|
||||
case modal.FocusColumn3:
|
||||
blockedLabel = highlight.Render("Blocked ▶")
|
||||
blockedLabel = highlight.Render(fmt.Sprintf("%s - Blocked ▶", sprintName))
|
||||
case modal.FocusColumn4:
|
||||
doneLabel = highlight.Render("Done ▶")
|
||||
doneLabel = highlight.Render(fmt.Sprintf("%s - Done ▶", sprintName))
|
||||
}
|
||||
|
||||
backlogCol := lipgloss.JoinVertical(lipgloss.Left, backlogLabel, m.backlogList.View())
|
||||
todoCol := lipgloss.JoinVertical(lipgloss.Left, todoLabel, m.todoList.View())
|
||||
inProgCol := lipgloss.JoinVertical(lipgloss.Left, inProgLabel, m.inProgList.View())
|
||||
blockedCol := lipgloss.JoinVertical(lipgloss.Left, blockedLabel, m.blockedList.View())
|
||||
doneCol := lipgloss.JoinVertical(lipgloss.Left, doneLabel, m.doneList.View())
|
||||
|
||||
board := lipgloss.JoinHorizontal(lipgloss.Left, todoCol, inProgCol, blockedCol, doneCol)
|
||||
board := lipgloss.JoinHorizontal(lipgloss.Left, backlogCol, todoCol, inProgCol, blockedCol, doneCol)
|
||||
boardHeight := lipgloss.Height(board)
|
||||
|
||||
detailHeight := max(contentHeight-boardHeight, 5)
|
||||
|
||||
Reference in New Issue
Block a user