Skip to content

Commit 39adcd4

Browse files
authored
Merge branch 'main' into feature/promql-interactive
2 parents 837b470 + 23a0db9 commit 39adcd4

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

pkg/model/query.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,20 @@ func (m QueryModel) View() string {
430430
if pageSize < 1 {
431431
pageSize = 1
432432
}
433+
helpView := m.help.FullHelpView(helpKeys)
434+
helpHeight := lipgloss.Height(helpView)
435+
436+
// Step 3: calculate exact table page size so everything fits.
437+
tableAvail := m.height - headerHeight - helpHeight - statusHeight
438+
pageSize := tableAvail - 6
439+
if pageSize < 1 {
440+
pageSize = 1
441+
}
442+
443+
// Pad rows to pageSize so the table always fills its allocated height.
444+
// Empty rows render as blank lines inside the table border.
445+
displayRows := make([]table.Row, pageSize)
446+
copy(displayRows, m.dataRows)
433447

434448
// Pad rows to pageSize so the table always fills its allocated height.
435449
// Empty rows render as blank lines inside the table border.

0 commit comments

Comments
 (0)