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

Method renderOptions

internal/tui/branch_warning.go:339–369  ·  view source on GitHub ↗

renderOptions renders the selectable options list.

(content *strings.Builder)

Source from the content-addressed store, hash-verified

337
338// renderOptions renders the selectable options list.
339func (b *BranchWarning) renderOptions(content *strings.Builder) {
340 optionStyle := lipgloss.NewStyle().Foreground(TextColor)
341 selectedStyle := lipgloss.NewStyle().Foreground(PrimaryColor).Bold(true)
342 hintStyle := lipgloss.NewStyle().Foreground(MutedColor)
343 recommendedStyle := lipgloss.NewStyle().Foreground(SuccessColor)
344
345 for i, opt := range b.options {
346 isSelected := i == b.selectedIndex
347
348 // Render option label
349 if isSelected {
350 content.WriteString(selectedStyle.Render(fmt.Sprintf("▶ %s", opt.label)))
351 } else {
352 content.WriteString(optionStyle.Render(fmt.Sprintf(" %s", opt.label)))
353 }
354
355 // Render recommended tag
356 if opt.recommended {
357 content.WriteString(" ")
358 content.WriteString(recommendedStyle.Render("(Recommended)"))
359 }
360
361 content.WriteString("\n")
362
363 // Render path hint (indented under the option)
364 if opt.hint != "" {
365 content.WriteString(hintStyle.Render(fmt.Sprintf(" → %s", opt.hint)))
366 content.WriteString("\n")
367 }
368 }
369}
370
371// centerModal centers the modal on the screen.
372func (b *BranchWarning) centerModal(modal string) string {

Callers 1

RenderMethod · 0.95

Calls 1

RenderMethod · 0.45

Tested by

no test coverage detected