MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / storiesListHeight

Method storiesListHeight

internal/tui/app.go:2127–2138  ·  view source on GitHub ↗

storiesListHeight calculates how many story lines fit in the panel. Must match the calculation in renderStoriesPanel.

()

Source from the content-addressed store, hash-verified

2125// storiesListHeight calculates how many story lines fit in the panel.
2126// Must match the calculation in renderStoriesPanel.
2127func (a *App) storiesListHeight() int {
2128 fh := footerHeight
2129 if a.height < 12 {
2130 fh = 0
2131 }
2132 contentHeight := a.height - a.effectiveHeaderHeight() - fh - 2
2133 if a.isNarrowMode() {
2134 storiesHeight := max((contentHeight*40)/100, 5)
2135 return storiesHeight - 5
2136 }
2137 return contentHeight - 5
2138}
2139
2140// adjustStoriesScroll ensures the selected index is visible in the scroll window.
2141func (a *App) adjustStoriesScroll() {

Calls 3

effectiveHeaderHeightMethod · 0.95
isNarrowModeMethod · 0.95
maxFunction · 0.85