renderAutoActions renders the auto-action progress section.
(innerWidth int)
| 417 | |
| 418 | // renderAutoActions renders the auto-action progress section. |
| 419 | func (c *CompletionScreen) renderAutoActions(innerWidth int) string { |
| 420 | var lines strings.Builder |
| 421 | |
| 422 | infoStyle := lipgloss.NewStyle().Foreground(TextColor) |
| 423 | successStyle := lipgloss.NewStyle().Foreground(SuccessColor) |
| 424 | errorStyle := lipgloss.NewStyle().Foreground(ErrorColor) |
| 425 | spinnerStyle := lipgloss.NewStyle().Foreground(PrimaryColor) |
| 426 | |
| 427 | // Push status |
| 428 | if c.pushState != AutoActionIdle { |
| 429 | switch c.pushState { |
| 430 | case AutoActionInProgress: |
| 431 | frame := spinnerChars[c.spinnerFrame%len(spinnerChars)] |
| 432 | lines.WriteString(spinnerStyle.Render(fmt.Sprintf("%s Pushing branch to remote...", frame))) |
| 433 | case AutoActionSuccess: |
| 434 | lines.WriteString(successStyle.Render("✓ Pushed branch to remote")) |
| 435 | case AutoActionError: |
| 436 | lines.WriteString(errorStyle.Render(fmt.Sprintf("✗ Push failed: %s", c.pushError))) |
| 437 | } |
| 438 | lines.WriteString("\n") |
| 439 | } |
| 440 | |
| 441 | // PR status |
| 442 | if c.prState != AutoActionIdle { |
| 443 | switch c.prState { |
| 444 | case AutoActionInProgress: |
| 445 | frame := spinnerChars[c.spinnerFrame%len(spinnerChars)] |
| 446 | lines.WriteString(spinnerStyle.Render(fmt.Sprintf("%s Creating pull request...", frame))) |
| 447 | case AutoActionSuccess: |
| 448 | lines.WriteString(successStyle.Render(fmt.Sprintf("✓ Created PR: %s", c.prTitle))) |
| 449 | lines.WriteString("\n") |
| 450 | lines.WriteString(infoStyle.Render(fmt.Sprintf(" %s", c.prURL))) |
| 451 | case AutoActionError: |
| 452 | lines.WriteString(errorStyle.Render(fmt.Sprintf("✗ PR creation failed: %s", c.prError))) |
| 453 | } |
| 454 | lines.WriteString("\n") |
| 455 | } |
| 456 | |
| 457 | _ = innerWidth |
| 458 | return lines.String() |
| 459 | } |
| 460 | |
| 461 | // formatPRDTitle converts a kebab-case PRD name to title case. |
| 462 | func formatPRDTitle(name string) string { |