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

Method renderGHErrorStep

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

Source from the content-addressed store, hash-verified

650}
651
652func (f FirstTimeSetup) renderGHErrorStep() string {
653 modalWidth := min(60, f.width-10)
654 if modalWidth < 45 {
655 modalWidth = 45
656 }
657
658 var content strings.Builder
659
660 // Title
661 titleStyle := lipgloss.NewStyle().
662 Bold(true).
663 Foreground(ErrorColor)
664 content.WriteString(titleStyle.Render("GitHub CLI Issue"))
665 content.WriteString("\n")
666 content.WriteString(DividerStyle.Render(strings.Repeat("─", modalWidth-4)))
667 content.WriteString("\n\n")
668
669 // Error message
670 errorStyle := lipgloss.NewStyle().Foreground(ErrorColor)
671 for _, line := range strings.Split(f.ghErrorMsg, "\n") {
672 content.WriteString(errorStyle.Render(line))
673 content.WriteString("\n")
674 }
675 content.WriteString("\n")
676
677 // Options
678 optionStyle := lipgloss.NewStyle().Foreground(TextColor)
679 selectedOptionStyle := lipgloss.NewStyle().
680 Foreground(PrimaryColor).
681 Bold(true)
682
683 options := []string{
684 "Continue without PR creation",
685 "Try again",
686 }
687
688 for i, opt := range options {
689 if i == f.ghErrorSelected {
690 content.WriteString(selectedOptionStyle.Render(fmt.Sprintf("▶ %s", opt)))
691 } else {
692 content.WriteString(optionStyle.Render(fmt.Sprintf(" %s", opt)))
693 }
694 content.WriteString("\n")
695 }
696
697 // Footer
698 content.WriteString("\n")
699 content.WriteString(DividerStyle.Render(strings.Repeat("─", modalWidth-4)))
700 content.WriteString("\n")
701
702 footerStyle := lipgloss.NewStyle().Foreground(MutedColor)
703 content.WriteString(footerStyle.Render("↑/↓: Navigate Enter: Select Esc: Back"))
704
705 // Modal box
706 modalStyle := lipgloss.NewStyle().
707 Border(lipgloss.RoundedBorder()).
708 BorderForeground(ErrorColor).
709 Padding(1, 2).

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