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

Method RenderCompact

internal/tui/tabbar.go:270–287  ·  view source on GitHub ↗

RenderCompact renders a compact version of the tab bar for narrow terminals.

()

Source from the content-addressed store, hash-verified

268
269// RenderCompact renders a compact version of the tab bar for narrow terminals.
270func (t *TabBar) RenderCompact() string {
271 if len(t.entries) == 0 {
272 return TabNewStyle.Render("+")
273 }
274
275 var tabs []string
276
277 for i, entry := range t.entries {
278 tab := t.renderCompactTab(entry, i+1)
279 tabs = append(tabs, tab)
280 }
281
282 // Compact new tab
283 newTab := TabNewStyle.Render("+")
284 tabs = append(tabs, newTab)
285
286 return lipgloss.JoinHorizontal(lipgloss.Top, tabs...)
287}
288
289// renderCompactTab renders a compact version of a tab.
290func (t *TabBar) renderCompactTab(entry TabEntry, number int) string {

Callers 1

renderTabBarMethod · 0.80

Calls 2

renderCompactTabMethod · 0.95
RenderMethod · 0.45

Tested by

no test coverage detected