@@ -4257,7 +4257,7 @@ func main() {
42574257 }
42584258
42594259 if err := RunLogin (homeDir ); err != nil {
4260- fmt . Fprintf ( os . Stderr , "Login failed: %v \n " , err )
4260+ slog . Error ( "Login failed" , "error " , err )
42614261 os .Exit (1 )
42624262 }
42634263
@@ -4617,7 +4617,7 @@ func main() {
46174617 }
46184618
46194619 default :
4620- fmt . Fprintf ( os . Stderr , "Unknown command: %s \n " , cmd )
4620+ slog . Error ( "Unknown command" , "command " , cmd )
46214621 fmt .Printf ("Use %s -h for help\n " , os .Args [0 ])
46224622 os .Exit (1 )
46234623 }
@@ -4676,7 +4676,7 @@ func (p *UIProgress) InitItems(config *Config) {
46764676 // Start the program in a goroutine
46774677 go func () {
46784678 if _ , err := p .program .Run (); err != nil {
4679- fmt . Fprintf ( os . Stderr , "Error running Bubble Tea program: %v \n " , err )
4679+ slog . Error ( "Error running Bubble Tea program" , "error " , err )
46804680 }
46814681 }()
46824682
@@ -5090,42 +5090,27 @@ func (m model) View() string {
50905090 contentLines [i ] = line + strings .Repeat (" " , padding )
50915091 }
50925092 }
5093+
5094+ // Add title as first line of content
5095+ titleStyle := lipgloss .NewStyle ().Bold (true )
5096+ titleLine := titleStyle .Render ("GitHub 🧠 pull" )
5097+ // Pad title line to match content width
5098+ titlePadding := maxContentWidth - visibleLength (titleLine )
5099+ if titlePadding > 0 {
5100+ titleLine = titleLine + strings .Repeat (" " , titlePadding )
5101+ }
5102+ contentLines = append ([]string {titleLine }, contentLines ... )
50935103 content = strings .Join (contentLines , "\n " )
50945104
5095- // Create box without automatic width adjustment (we've done it ourselves)
5105+ // Create box with standard lipgloss borders
50965106 boxStyle := lipgloss .NewStyle ().
50975107 Border (lipgloss .RoundedBorder ()).
50985108 BorderForeground (borderColor ).
5099- Padding (0 , 1 ). // 1 space padding on left and right
5109+ Padding (0 , 1 ).
51005110 Align (lipgloss .Left )
51015111
51025112 box := boxStyle .Render (content )
51035113
5104- // Add title to the top border while maintaining color
5105- titleText := "GitHub 🧠 pull"
5106- titleStyle := lipgloss .NewStyle ().Bold (true ).Foreground (borderColor )
5107- borderStyle := lipgloss .NewStyle ().Foreground (borderColor )
5108-
5109- boxLines := strings .Split (box , "\n " )
5110- if len (boxLines ) > 0 {
5111- // Calculate the plain title width
5112- titlePlainWidth := visibleLength (titleText )
5113- // Get the full width of the first line
5114- firstLineWidth := lipgloss .Width (boxLines [0 ])
5115- // Calculate dashes needed: total width - "╭─ " (3) - title - " " (1) - "╮" (1)
5116- dashesNeeded := firstLineWidth - 3 - titlePlainWidth - 1 - 1
5117- if dashesNeeded < 0 {
5118- dashesNeeded = 0
5119- }
5120-
5121- // Build the title line with proper coloring
5122- boxLines [0 ] = borderStyle .Render ("╭─ " ) +
5123- titleStyle .Render (titleText ) +
5124- borderStyle .Render (" " + strings .Repeat ("─" , dashesNeeded ) + "╮" )
5125-
5126- box = strings .Join (boxLines , "\n " )
5127- }
5128-
51295114 return box + "\n "
51305115}
51315116
@@ -5403,39 +5388,27 @@ func (m loginModel) View() string {
54035388 maxContentWidth = 64
54045389 }
54055390
5406- // Create border style
5391+ // Create border style with title
54075392 borderStyle := lipgloss .NewStyle ().
54085393 Border (lipgloss .RoundedBorder ()).
54095394 BorderForeground (borderColor ).
5395+ BorderTop (true ).
5396+ BorderLeft (true ).
5397+ BorderRight (true ).
5398+ BorderBottom (true ).
54105399 Padding (0 , 1 ).
54115400 Width (maxContentWidth )
54125401
5413- // Title
5414- title := " GitHub 🧠 Login "
5415- titleStyle := lipgloss .NewStyle ().Bold (true )
5416-
54175402 box := borderStyle .Render (content )
5418-
5419- // Replace top border with title
5420- lines := strings .Split (box , "\n " )
5421- if len (lines ) > 0 {
5422- topBorder := lines [0 ]
5423- titlePos := 2
5424- if titlePos + len (title ) < len (topBorder ) {
5425- runes := []rune (topBorder )
5426- titleRunes := []rune (titleStyle .Render (title ))
5427- copy (runes [titlePos :], titleRunes )
5428- lines [0 ] = string (runes )
5429- }
5430- box = strings .Join (lines , "\n " )
5431- }
54325403
54335404 return box
54345405}
54355406
54365407func (m loginModel ) renderWaitingView () string {
54375408 var b strings.Builder
54385409
5410+ titleStyle := lipgloss .NewStyle ().Bold (true )
5411+ b .WriteString (titleStyle .Render (" GitHub 🧠 Login" ) + "\n " )
54395412 b .WriteString ("\n " )
54405413 b .WriteString (" 🔐 GitHub Authentication\n " )
54415414 b .WriteString ("\n " )
@@ -5471,8 +5444,10 @@ func (m loginModel) renderWaitingView() string {
54715444func (m loginModel ) renderOrgInputView () string {
54725445 var b strings.Builder
54735446
5447+ titleStyle := lipgloss .NewStyle ().Bold (true )
54745448 successStyle := lipgloss .NewStyle ().Foreground (lipgloss .Color ("10" ))
54755449
5450+ b .WriteString (titleStyle .Render (" GitHub 🧠 Login" ) + "\n " )
54765451 b .WriteString ("\n " )
54775452 b .WriteString (" " + successStyle .Render (fmt .Sprintf ("✅ Successfully authenticated as @%s" , m .username )) + "\n " )
54785453 b .WriteString ("\n " )
@@ -5488,8 +5463,10 @@ func (m loginModel) renderOrgInputView() string {
54885463func (m loginModel ) renderSuccessView () string {
54895464 var b strings.Builder
54905465
5466+ titleStyle := lipgloss .NewStyle ().Bold (true )
54915467 successStyle := lipgloss .NewStyle ().Foreground (lipgloss .Color ("10" ))
54925468
5469+ b .WriteString (titleStyle .Render (" GitHub 🧠 Login" ) + "\n " )
54935470 b .WriteString ("\n " )
54945471 b .WriteString (" " + successStyle .Render ("✅ Setup complete!" ) + "\n " )
54955472 b .WriteString ("\n " )
@@ -5509,8 +5486,10 @@ func (m loginModel) renderSuccessView() string {
55095486func (m loginModel ) renderErrorView () string {
55105487 var b strings.Builder
55115488
5489+ titleStyle := lipgloss .NewStyle ().Bold (true )
55125490 errorStyle := lipgloss .NewStyle ().Foreground (lipgloss .Color ("9" ))
55135491
5492+ b .WriteString (titleStyle .Render (" GitHub 🧠 Login" ) + "\n " )
55145493 b .WriteString ("\n " )
55155494 b .WriteString (" " + errorStyle .Render ("❌ Authentication failed" ) + "\n " )
55165495 b .WriteString ("\n " )
0 commit comments