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
21 changes: 16 additions & 5 deletions internal/editor/editor.go
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,7 @@ func (m *Model) navigateUp() {
// enters at column 0 regardless of direction.
if m.kanban != nil {
m.kanban.enterFromBelow()
m.kanbanAnchorTop = true
return
}

Expand Down Expand Up @@ -3235,11 +3236,21 @@ func (m *Model) updateViewport() {
bottomTarget = lineOffset + chromeLines + bot
cursorLine = lineOffset + chromeLines + top
kanbanTop := lineOffset + chromeLines
// Anchor to the title row only when the user just changed
// columns — otherwise navigating into the kanban from below
// would snap to top instead of landing near the entry point.
if m.kanbanAnchorTop && bottomTarget-kanbanTop+1 <= m.viewport.Height() {
scrollTarget = kanbanTop
// The active board clips tall columns internally, so anchoring
// to the board top keeps headers visible without hiding the
// selected card.
if m.kanbanAnchorTop {
contextLines := 0
if m.active >= 0 && m.active < len(m.blockLineCounts) {
contextLines = m.viewport.Height() - m.blockLineCounts[m.active]
if contextLines > kanbanDocumentContextLines {
contextLines = kanbanDocumentContextLines
}
if contextLines < 0 {
contextLines = 0
}
}
scrollTarget = kanbanTop - contextLines/2
} else {
scrollTarget = cursorLine
}
Expand Down
Loading
Loading