Skip to content

Commit 31189e3

Browse files
authored
Merge pull request #16 from tom-draper/feat/tui-component-height
feat(tui): reduce activity component height changes when cycling through periods
2 parents 01a55c2 + 73aeca7 commit 31189e3

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

tui/internal/ui/dashboard/grid.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -436,13 +436,10 @@ func (l *Layout) renderFooterCards(sidebarWidth int) string {
436436
var renderedCards []string
437437
for i, card := range l.grid.cardsByPosition[PositionFooter] {
438438
cardWidth := l.calculateCardWidth(sidebarWidth, len(l.grid.cardsByPosition[PositionFooter]), i)
439-
440-
height := DefaultFooterHeight
441-
if dynamicRenderer, ok := card.Renderer.(cards.DynamicHeightCard); ok {
442-
height = dynamicRenderer.GetRequiredHeight(cardWidth - BorderPadding)
443-
}
444-
445-
card.SetSize(cardWidth, height)
439+
// Keep the footer row at a stable viewport height so period-dependent
440+
// list sizes (for example Referrers) do not change the Activity card's
441+
// height as the user switches between time ranges.
442+
card.SetSize(cardWidth, DefaultFooterHeight)
446443
renderedCards = append(renderedCards, card.Render())
447444
}
448445

0 commit comments

Comments
 (0)