LPM-138 Refactor Tui with composable modals and use canvas Refactors the TUI (dashboard + kanban) to use a shared, composable modal system with canvas-based overlay rendering, while consolidating styling into internal/style and expanding issue interactions (e.g., comments). Changes: Introduces a new pkg/tui/modal system (manager/stack + multiple modal types) and overlays modals using Lipgloss compositor layers. Refactors dashboard/kanban views and input handling to use the modal manager + focus manager instead of per-modal boolean state. Consolidates TUI styling by moving from pkg/tui/styles to internal/style and updates components to use the new style package; adds a shared footer renderer.
30 lines
463 B
Go
30 lines
463 B
Go
package components
|
|
|
|
import (
|
|
"charm.land/lipgloss/v2"
|
|
"github.com/LazyBachelor/LazyPM/internal/style"
|
|
)
|
|
|
|
type Header struct {
|
|
Title string
|
|
}
|
|
|
|
func NewHeader(title string) Header {
|
|
return Header{Title: title}
|
|
}
|
|
|
|
func (h Header) View(width int) string {
|
|
title := style.HeaderTitleStyle.Render(h.Title)
|
|
|
|
return lipgloss.PlaceHorizontal(
|
|
width,
|
|
lipgloss.Left,
|
|
title,
|
|
lipgloss.WithWhitespaceChars("─"),
|
|
)
|
|
}
|
|
|
|
func (h Header) Height() int {
|
|
return 1
|
|
}
|