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

Method Render

internal/tui/tabbar.go:156–176  ·  view source on GitHub ↗

Render renders the tab bar.

()

Source from the content-addressed store, hash-verified

154
155// Render renders the tab bar.
156func (t *TabBar) Render() string {
157 if len(t.entries) == 0 {
158 // No PRDs - show just the "+ New" button
159 newTab := TabNewStyle.Render("+ New")
160 return newTab
161 }
162
163 var tabs []string
164
165 for i, entry := range t.entries {
166 tab := t.renderTab(entry, i+1)
167 tabs = append(tabs, tab)
168 }
169
170 // Add the "+ New" tab
171 newTab := TabNewStyle.Render("+ New")
172 tabs = append(tabs, newTab)
173
174 // Join tabs with small spacing
175 return lipgloss.JoinHorizontal(lipgloss.Top, tabs...)
176}
177
178// renderTab renders a single tab.
179func (t *TabBar) renderTab(entry TabEntry, number int) string {

Callers 3

renderTabMethod · 0.45
RenderCompactMethod · 0.45
renderCompactTabMethod · 0.45

Calls 1

renderTabMethod · 0.95

Tested by

no test coverage detected