Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions internal/ui/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -1524,24 +1524,26 @@ func (m *AppModel) viewDashboard() string {
promptPreviewHeight = lipgloss.Height(promptPreview)
}

// Calculate heights dynamically
headerHeight := len(headerParts)
// Build the header first so we can measure its actual rendered height
header := ""
headerHeight := 0
if len(headerParts) > 0 {
header = lipgloss.JoinVertical(lipgloss.Left, headerParts...)
headerHeight = lipgloss.Height(header)
}

// Render help to measure its actual height
helpView := m.renderHelp()
helpHeight := lipgloss.Height(helpView)

kanbanHeight := m.height - headerHeight - filterBarHeight - helpHeight - promptPreviewHeight
if kanbanHeight < 10 {
kanbanHeight = 10
}

// Update kanban size
m.kanban.SetSize(m.width, kanbanHeight)

// Build the view
header := ""
if len(headerParts) > 0 {
header = lipgloss.JoinVertical(lipgloss.Left, headerParts...)
}

var contentParts []string
if header != "" {
contentParts = append(contentParts, header)
Expand Down
10 changes: 8 additions & 2 deletions internal/ui/kanban.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,14 @@ func splitPinnedTasks(tasks []*db.Task) (pinned []*db.Task, unpinned []*db.Task)

// SetSize updates the board dimensions.
func (k *KanbanBoard) SetSize(width, height int) {
heightChanged := k.height != height
k.width = width
k.height = height
// When height changes (e.g. quickview appearing/disappearing),
// recalculate scroll offsets so the selected task stays visible
if heightChanged {
k.ensureSelectedVisible()
}
}

// MoveLeft moves selection to the left column, skipping collapsed columns.
Expand Down Expand Up @@ -1468,8 +1474,8 @@ func (k *KanbanBoard) handleClickDesktop(x, y int) *db.Task {

// Calculate which task was clicked
col := k.columns[colIdx]
colHeight := k.height
maxTasks := (colHeight - 3) / taskCardHeight // -3 for header bar and minimal padding
colHeight := k.height - 2 // -2 for column borders (top + bottom)
maxTasks := (colHeight - 3) / taskCardHeight // -3 for header bar and scroll indicators
if maxTasks < 1 {
maxTasks = 1
}
Expand Down