renderCleanConfirmation renders the clean confirmation dialog.
(modalWidth, modalHeight int)
| 872 | |
| 873 | // renderCleanConfirmation renders the clean confirmation dialog. |
| 874 | func (p *PRDPicker) renderCleanConfirmation(modalWidth, modalHeight int) string { |
| 875 | var content strings.Builder |
| 876 | cc := p.cleanConfirmation |
| 877 | |
| 878 | // Title |
| 879 | titleStyle := lipgloss.NewStyle(). |
| 880 | Bold(true). |
| 881 | Foreground(WarningColor). |
| 882 | Padding(0, 1) |
| 883 | content.WriteString(titleStyle.Render("Clean Worktree")) |
| 884 | content.WriteString("\n") |
| 885 | content.WriteString(DividerStyle.Render(strings.Repeat("─", modalWidth-4))) |
| 886 | content.WriteString("\n\n") |
| 887 | |
| 888 | // Show what will be removed |
| 889 | infoStyle := lipgloss.NewStyle(). |
| 890 | Foreground(TextColor). |
| 891 | Padding(0, 1) |
| 892 | content.WriteString(infoStyle.Render(fmt.Sprintf("PRD: %s", cc.EntryName))) |
| 893 | content.WriteString("\n") |
| 894 | content.WriteString(infoStyle.Render(fmt.Sprintf("Worktree: %s", cc.WorktreeDir))) |
| 895 | content.WriteString("\n") |
| 896 | if cc.Branch != "" { |
| 897 | content.WriteString(infoStyle.Render(fmt.Sprintf("Branch: %s", cc.Branch))) |
| 898 | content.WriteString("\n") |
| 899 | } |
| 900 | content.WriteString("\n") |
| 901 | |
| 902 | // Options |
| 903 | options := []struct { |
| 904 | label string |
| 905 | hint string |
| 906 | }{ |
| 907 | {"Remove worktree + delete branch (Recommended)", "Removes worktree directory and deletes the local branch"}, |
| 908 | {"Remove worktree only (keep branch)", "Removes worktree directory but keeps the branch for later use"}, |
| 909 | {"Cancel", ""}, |
| 910 | } |
| 911 | |
| 912 | for i, opt := range options { |
| 913 | prefix := " " |
| 914 | style := lipgloss.NewStyle().Foreground(TextColor) |
| 915 | if i == cc.SelectedIdx { |
| 916 | prefix = "▸ " |
| 917 | style = style.Bold(true).Foreground(TextBrightColor) |
| 918 | } |
| 919 | content.WriteString(style.Render(prefix + opt.label)) |
| 920 | content.WriteString("\n") |
| 921 | if opt.hint != "" && i == cc.SelectedIdx { |
| 922 | hintStyle := lipgloss.NewStyle().Foreground(MutedColor).Padding(0, 2) |
| 923 | content.WriteString(hintStyle.Render(" " + opt.hint)) |
| 924 | content.WriteString("\n") |
| 925 | } |
| 926 | } |
| 927 | |
| 928 | // Footer |
| 929 | content.WriteString("\n") |
| 930 | content.WriteString(DividerStyle.Render(strings.Repeat("─", modalWidth-4))) |
| 931 | content.WriteString("\n") |
no test coverage detected