MCPcopy Create free account
hub / github.com/arctic-cli/interface / buildContentRows

Function buildContentRows

packages/arctic/src/cli/cmd/tui/component/logo.tsx:130–146  ·  view source on GitHub ↗
(theme: Theme, directory: string, contentWidth: number, recents: RecentSessionSummary[])

Source from the content-addressed store, hash-verified

128type ColumnLine = Segment | undefined
129
130function buildContentRows(theme: Theme, directory: string, contentWidth: number, recents: RecentSessionSummary[]) {
131 const minColumns = { left: 22, right: 20 }
132 let leftWidth = Math.max(minColumns.left, Math.floor(contentWidth * 0.55))
133 let rightWidth = contentWidth - leftWidth - 3
134 if (rightWidth < minColumns.right) {
135 rightWidth = minColumns.right
136 leftWidth = Math.max(minColumns.left, contentWidth - rightWidth - 3)
137 }
138 const rows: Segment[][] = []
139 const leftLines = buildLeftColumn(theme, directory, leftWidth)
140 const rightLines = buildRightColumn(theme, rightWidth, recents)
141 const totalRows = Math.max(leftLines.length, rightLines.length)
142 for (let i = 0; i < totalRows; i++) {
143 rows.push(buildTwoColumnRow(leftLines[i], rightLines[i], leftWidth, rightWidth, theme))
144 }
145 return rows
146}
147
148function buildLeftColumn(theme: Theme, directory: string, width: number): ColumnLine[] {
149 const lines: ColumnLine[] = []

Callers 1

buildCardFunction · 0.85

Calls 4

buildLeftColumnFunction · 0.85
buildRightColumnFunction · 0.85
buildTwoColumnRowFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected