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

Method renderGitignoreStep

internal/tui/first_time_setup.go:389–466  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

387}
388
389func (f FirstTimeSetup) renderGitignoreStep() string {
390 modalWidth := min(65, f.width-10)
391 if modalWidth < 45 {
392 modalWidth = 45
393 }
394
395 var content strings.Builder
396
397 // Title
398 titleStyle := lipgloss.NewStyle().
399 Bold(true).
400 Foreground(PrimaryColor)
401 content.WriteString(titleStyle.Render("Welcome to Chief!"))
402 content.WriteString("\n")
403 content.WriteString(DividerStyle.Render(strings.Repeat("─", modalWidth-4)))
404 content.WriteString("\n\n")
405
406 // Message
407 messageStyle := lipgloss.NewStyle().Foreground(TextColor)
408 content.WriteString(messageStyle.Render("Would you like to add .chief to .gitignore?"))
409 content.WriteString("\n\n")
410
411 descStyle := lipgloss.NewStyle().Foreground(MutedColor)
412 content.WriteString(descStyle.Render("This keeps your PRD plans local and out of version control."))
413 content.WriteString("\n")
414 content.WriteString(descStyle.Render("Not required, but recommended if you prefer local-only plans."))
415 content.WriteString("\n\n")
416
417 // Options
418 optionStyle := lipgloss.NewStyle().Foreground(TextColor)
419 selectedStyle := lipgloss.NewStyle().
420 Foreground(PrimaryColor).
421 Bold(true)
422
423 options := []struct {
424 label string
425 desc string
426 }{
427 {"Yes, add .chief to .gitignore", "(Recommended)"},
428 {"No, keep .chief in version control", ""},
429 }
430
431 for i, opt := range options {
432 var line string
433 if i == f.gitignoreSelected {
434 line = selectedStyle.Render(fmt.Sprintf("▶ %s", opt.label))
435 if opt.desc != "" {
436 line += " " + lipgloss.NewStyle().Foreground(SuccessColor).Render(opt.desc)
437 }
438 } else {
439 line = optionStyle.Render(fmt.Sprintf(" %s", opt.label))
440 if opt.desc != "" {
441 line += " " + lipgloss.NewStyle().Foreground(MutedColor).Render(opt.desc)
442 }
443 }
444 content.WriteString(line)
445 content.WriteString("\n")
446 }

Callers 1

ViewMethod · 0.95

Calls 4

centerModalMethod · 0.95
minFunction · 0.85
RenderMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected