renderHeader renders the dialog title and message.
(content *strings.Builder, modalWidth int)
| 277 | |
| 278 | // renderHeader renders the dialog title and message. |
| 279 | func (b *BranchWarning) renderHeader(content *strings.Builder, modalWidth int) { |
| 280 | titleStyle := lipgloss.NewStyle().Bold(true) |
| 281 | |
| 282 | switch b.context { |
| 283 | case DialogProtectedBranch: |
| 284 | content.WriteString(titleStyle.Foreground(WarningColor).Render("⚠️ Protected Branch Warning")) |
| 285 | content.WriteString("\n") |
| 286 | content.WriteString(DividerStyle.Render(strings.Repeat("─", modalWidth-4))) |
| 287 | content.WriteString("\n\n") |
| 288 | |
| 289 | messageStyle := lipgloss.NewStyle().Foreground(TextColor) |
| 290 | content.WriteString(messageStyle.Render(fmt.Sprintf("You are on the '%s' branch.", b.currentBranch))) |
| 291 | content.WriteString("\n") |
| 292 | content.WriteString(messageStyle.Render("It's recommended to create a separate branch.")) |
| 293 | content.WriteString("\n\n") |
| 294 | |
| 295 | case DialogAnotherPRDRunning: |
| 296 | content.WriteString(titleStyle.Foreground(PrimaryColor).Render("Directory In Use")) |
| 297 | content.WriteString("\n") |
| 298 | content.WriteString(DividerStyle.Render(strings.Repeat("─", modalWidth-4))) |
| 299 | content.WriteString("\n\n") |
| 300 | |
| 301 | messageStyle := lipgloss.NewStyle().Foreground(TextColor) |
| 302 | content.WriteString(messageStyle.Render("Another PRD is already running in this directory.")) |
| 303 | content.WriteString("\n") |
| 304 | content.WriteString(messageStyle.Render("A worktree will avoid file conflicts.")) |
| 305 | content.WriteString("\n\n") |
| 306 | |
| 307 | case DialogNoConflicts: |
| 308 | content.WriteString(titleStyle.Foreground(PrimaryColor).Render("Start PRD")) |
| 309 | content.WriteString("\n") |
| 310 | content.WriteString(DividerStyle.Render(strings.Repeat("─", modalWidth-4))) |
| 311 | content.WriteString("\n\n") |
| 312 | |
| 313 | messageStyle := lipgloss.NewStyle().Foreground(TextColor) |
| 314 | content.WriteString(messageStyle.Render("Choose where Claude should work:")) |
| 315 | content.WriteString("\n\n") |
| 316 | } |
| 317 | } |
| 318 | |
| 319 | // renderBranchName renders the branch name display/editor. |
| 320 | func (b *BranchWarning) renderBranchName(content *strings.Builder) { |