refactor(ui-logging): replace unicode symbols with ASCII status codes [OK]/[KO]
- commit
- bc0926673dfd83856eb0ae71afe6f156c5a47a98
- author
- bnema · · 2025-10-28 22:53 UTC
- committer
- bnema · · 2025-10-28 19:15 UTC
- parent
- cc22049
- signature
- unsigned
3 files · +7 -12
M internal/ui/styles/theme.go +2 -2
| @@ -283,7 +283,7 @@ func HuhTheme() *huh.Theme { | |||
| 283 | 283 | theme.Focused.Option = lipgloss.NewStyle().Foreground(lipgloss.Color("7")) // White | |
| 284 | 284 | theme.Focused.MultiSelectSelector = lipgloss.NewStyle().Foreground(lipgloss.Color("14")).SetString("> ") | |
| 285 | 285 | theme.Focused.SelectedOption = lipgloss.NewStyle().Foreground(lipgloss.Color("14")) // Bright cyan | |
| 286 | - | theme.Focused.SelectedPrefix = lipgloss.NewStyle().Foreground(lipgloss.Color("10")).SetString("✓ ") // Bright green | |
| 286 | + | theme.Focused.SelectedPrefix = lipgloss.NewStyle().Foreground(lipgloss.Color("10")).SetString("[OK] ") // Bright green | |
| 287 | 287 | theme.Focused.UnselectedOption = lipgloss.NewStyle().Foreground(lipgloss.Color("7")) // White | |
| 288 | 288 | theme.Focused.UnselectedPrefix = lipgloss.NewStyle().Foreground(lipgloss.Color("8")).SetString("○ ") // Grey | |
| 289 | 289 | ||
| @@ -317,7 +317,7 @@ func HuhTheme() *huh.Theme { | |||
| 317 | 317 | theme.Focused.TextInput.Prompt = lipgloss.NewStyle().Foreground(lipgloss.Color("14")).Bold(true) // Bright cyan | |
| 318 | 318 | ||
| 319 | 319 | // Error styles | |
| 320 | - | theme.Focused.ErrorIndicator = lipgloss.NewStyle().Foreground(lipgloss.Color("9")).SetString("✗ ") // Bright red | |
| 320 | + | theme.Focused.ErrorIndicator = lipgloss.NewStyle().Foreground(lipgloss.Color("9")).SetString("[KO] ") // Bright red | |
| 321 | 321 | theme.Focused.ErrorMessage = lipgloss.NewStyle().Foreground(lipgloss.Color("9")).Bold(true) // Bright red | |
| 322 | 322 | ||
| 323 | 323 | return theme | |
| @@ -283,7 +283,7 @@ func HuhTheme() *huh.Theme { | |||||
| 283 | theme.Focused.Option = lipgloss.NewStyle().Foreground(lipgloss.Color("7")) // White | 283 | theme.Focused.Option = lipgloss.NewStyle().Foreground(lipgloss.Color("7")) // White | ||
| 284 | theme.Focused.MultiSelectSelector = lipgloss.NewStyle().Foreground(lipgloss.Color("14")).SetString("> ") | 284 | theme.Focused.MultiSelectSelector = lipgloss.NewStyle().Foreground(lipgloss.Color("14")).SetString("> ") | ||
| 285 | theme.Focused.SelectedOption = lipgloss.NewStyle().Foreground(lipgloss.Color("14")) // Bright cyan | 285 | theme.Focused.SelectedOption = lipgloss.NewStyle().Foreground(lipgloss.Color("14")) // Bright cyan | ||
| 286 | - | theme.Focused.SelectedPrefix = lipgloss.NewStyle().Foreground(lipgloss.Color("10")).SetString("✓ ") // Bright green | 286 | + | theme.Focused.SelectedPrefix = lipgloss.NewStyle().Foreground(lipgloss.Color("10")).SetString("[OK] ") // Bright green |
| 287 | theme.Focused.UnselectedOption = lipgloss.NewStyle().Foreground(lipgloss.Color("7")) // White | 287 | theme.Focused.UnselectedOption = lipgloss.NewStyle().Foreground(lipgloss.Color("7")) // White | ||
| 288 | theme.Focused.UnselectedPrefix = lipgloss.NewStyle().Foreground(lipgloss.Color("8")).SetString("○ ") // Grey | 288 | theme.Focused.UnselectedPrefix = lipgloss.NewStyle().Foreground(lipgloss.Color("8")).SetString("○ ") // Grey | ||
| 289 | 289 | ||||
| @@ -317,7 +317,7 @@ func HuhTheme() *huh.Theme { | |||||
| 317 | theme.Focused.TextInput.Prompt = lipgloss.NewStyle().Foreground(lipgloss.Color("14")).Bold(true) // Bright cyan | 317 | theme.Focused.TextInput.Prompt = lipgloss.NewStyle().Foreground(lipgloss.Color("14")).Bold(true) // Bright cyan | ||
| 318 | 318 | ||||
| 319 | // Error styles | 319 | // Error styles | ||
| 320 | - | theme.Focused.ErrorIndicator = lipgloss.NewStyle().Foreground(lipgloss.Color("9")).SetString("✗ ") // Bright red | 320 | + | theme.Focused.ErrorIndicator = lipgloss.NewStyle().Foreground(lipgloss.Color("9")).SetString("[KO] ") // Bright red |
| 321 | theme.Focused.ErrorMessage = lipgloss.NewStyle().Foreground(lipgloss.Color("9")).Bold(true) // Bright red | 321 | theme.Focused.ErrorMessage = lipgloss.NewStyle().Foreground(lipgloss.Color("9")).Bold(true) // Bright red | ||
| 322 | 322 | ||||
| 323 | return theme | 323 | return theme | ||
M internal/ui/views/network.go +2 -2
| @@ -21,12 +21,12 @@ func RenderNetworkCheck(m model.UI) string { | |||
| 21 | 21 | } else if m.NetworkErr() != nil { | |
| 22 | 22 | // Network check failed | |
| 23 | 23 | errorMsg := fmt.Sprintf("Network error: %v", m.NetworkErr()) | |
| 24 | - | content = CenterText(styles.ErrorStyle.Render("✗ Network Check Failed"), m.Width()) + "\n\n" + | |
| 24 | + | content = CenterText(styles.ErrorStyle.Render("[KO] Network Check Failed"), m.Width()) + "\n\n" + | |
| 25 | 25 | CenterText(errorMsg, m.Width()) + "\n\n" + | |
| 26 | 26 | CenterText(styles.HelpStyle.Render("Press ENTER to retry or CTRL+C to exit"), m.Width()) | |
| 27 | 27 | } else { | |
| 28 | 28 | // Network check passed | |
| 29 | - | content = CenterText(styles.SuccessStyle.Render("✓ Network Check Passed"), m.Width()) + "\n\n" + | |
| 29 | + | content = CenterText(styles.SuccessStyle.Render("[OK] Network Check Passed"), m.Width()) + "\n\n" + | |
| 30 | 30 | CenterText(styles.HelpStyle.Render("Press ENTER to continue"), m.Width()) | |
| 31 | 31 | } | |
| 32 | 32 | ||
| @@ -21,12 +21,12 @@ func RenderNetworkCheck(m model.UI) string { | |||||
| 21 | } else if m.NetworkErr() != nil { | 21 | } else if m.NetworkErr() != nil { | ||
| 22 | // Network check failed | 22 | // Network check failed | ||
| 23 | errorMsg := fmt.Sprintf("Network error: %v", m.NetworkErr()) | 23 | errorMsg := fmt.Sprintf("Network error: %v", m.NetworkErr()) | ||
| 24 | - | content = CenterText(styles.ErrorStyle.Render("✗ Network Check Failed"), m.Width()) + "\n\n" + | 24 | + | content = CenterText(styles.ErrorStyle.Render("[KO] Network Check Failed"), m.Width()) + "\n\n" + |
| 25 | CenterText(errorMsg, m.Width()) + "\n\n" + | 25 | CenterText(errorMsg, m.Width()) + "\n\n" + | ||
| 26 | CenterText(styles.HelpStyle.Render("Press ENTER to retry or CTRL+C to exit"), m.Width()) | 26 | CenterText(styles.HelpStyle.Render("Press ENTER to retry or CTRL+C to exit"), m.Width()) | ||
| 27 | } else { | 27 | } else { | ||
| 28 | // Network check passed | 28 | // Network check passed | ||
| 29 | - | content = CenterText(styles.SuccessStyle.Render("✓ Network Check Passed"), m.Width()) + "\n\n" + | 29 | + | content = CenterText(styles.SuccessStyle.Render("[OK] Network Check Passed"), m.Width()) + "\n\n" + |
| 30 | CenterText(styles.HelpStyle.Render("Press ENTER to continue"), m.Width()) | 30 | CenterText(styles.HelpStyle.Render("Press ENTER to continue"), m.Width()) | ||
| 31 | } | 31 | } | ||
| 32 | 32 | ||||
M internal/ui/views/results.go +3 -8
| @@ -12,19 +12,14 @@ import ( | |||
| 12 | 12 | func RenderSuccess(m model.UI, duration time.Duration, phaseDurations map[string]time.Duration) string { | |
| 13 | 13 | cfg := m.Config() | |
| 14 | 14 | ||
| 15 | - | s := styles.SuccessStyle.Render("✓ Installation Complete!") + "\n\n" | |
| 15 | + | s := styles.SuccessStyle.Render("[OK] Installation Complete!") + "\n\n" | |
| 16 | 16 | s += "Installation Summary:\n" | |
| 17 | 17 | s += fmt.Sprintf(" Hostname: %s\n", cfg.Hostname) | |
| 18 | 18 | s += fmt.Sprintf(" Disk: %s\n", cfg.TargetDisk) | |
| 19 | 19 | s += fmt.Sprintf(" Kernel: %s\n", cfg.KernelChoice) | |
| 20 | 20 | s += fmt.Sprintf(" Total Time: %s\n\n", formatDuration(duration)) | |
| 21 | 21 | ||
| 22 | - | s += "Phase Breakdown:\n" | |
| 23 | - | for phase, dur := range phaseDurations { | |
| 24 | - | s += fmt.Sprintf(" %s: %s\n", phase, formatDuration(dur)) | |
| 25 | - | } | |
| 26 | - | ||
| 27 | - | s += "\nNext Steps:\n" | |
| 22 | + | s += "Next Steps:\n" | |
| 28 | 23 | s += " 1. Remove installation media\n" | |
| 29 | 24 | s += " 2. Reboot the system\n" | |
| 30 | 25 | s += " 3. First-boot setup will run automatically\n\n" | |
| @@ -35,7 +30,7 @@ func RenderSuccess(m model.UI, duration time.Duration, phaseDurations map[string | |||
| 35 | 30 | ||
| 36 | 31 | // RenderError renders the error screen with log tail (centered) | |
| 37 | 32 | func RenderError(m model.UI, err error, phaseName string, duration time.Duration) string { | |
| 38 | - | s := styles.ErrorStyle.Render("✗ Installation Failed") + "\n\n" | |
| 33 | + | s := styles.ErrorStyle.Render("[KO] Installation Failed") + "\n\n" | |
| 39 | 34 | s += fmt.Sprintf("Phase: %s\n", phaseName) | |
| 40 | 35 | s += fmt.Sprintf("Error: %v\n", err) | |
| 41 | 36 | s += fmt.Sprintf("Duration before failure: %s\n\n", formatDuration(duration)) | |
| @@ -12,19 +12,14 @@ import ( | |||||
| 12 | func RenderSuccess(m model.UI, duration time.Duration, phaseDurations map[string]time.Duration) string { | 12 | func RenderSuccess(m model.UI, duration time.Duration, phaseDurations map[string]time.Duration) string { | ||
| 13 | cfg := m.Config() | 13 | cfg := m.Config() | ||
| 14 | 14 | ||||
| 15 | - | s := styles.SuccessStyle.Render("✓ Installation Complete!") + "\n\n" | 15 | + | s := styles.SuccessStyle.Render("[OK] Installation Complete!") + "\n\n" |
| 16 | s += "Installation Summary:\n" | 16 | s += "Installation Summary:\n" | ||
| 17 | s += fmt.Sprintf(" Hostname: %s\n", cfg.Hostname) | 17 | s += fmt.Sprintf(" Hostname: %s\n", cfg.Hostname) | ||
| 18 | s += fmt.Sprintf(" Disk: %s\n", cfg.TargetDisk) | 18 | s += fmt.Sprintf(" Disk: %s\n", cfg.TargetDisk) | ||
| 19 | s += fmt.Sprintf(" Kernel: %s\n", cfg.KernelChoice) | 19 | s += fmt.Sprintf(" Kernel: %s\n", cfg.KernelChoice) | ||
| 20 | s += fmt.Sprintf(" Total Time: %s\n\n", formatDuration(duration)) | 20 | s += fmt.Sprintf(" Total Time: %s\n\n", formatDuration(duration)) | ||
| 21 | 21 | ||||
| 22 | - | s += "Phase Breakdown:\n" | 22 | + | s += "Next Steps:\n" |
| 23 | - | for phase, dur := range phaseDurations { | |||
| 24 | - | s += fmt.Sprintf(" %s: %s\n", phase, formatDuration(dur)) | |||
| 25 | - | } | |||
| 26 | - | ||||
| 27 | - | s += "\nNext Steps:\n" | |||
| 28 | s += " 1. Remove installation media\n" | 23 | s += " 1. Remove installation media\n" | ||
| 29 | s += " 2. Reboot the system\n" | 24 | s += " 2. Reboot the system\n" | ||
| 30 | s += " 3. First-boot setup will run automatically\n\n" | 25 | s += " 3. First-boot setup will run automatically\n\n" | ||
| @@ -35,7 +30,7 @@ func RenderSuccess(m model.UI, duration time.Duration, phaseDurations map[string | |||||
| 35 | 30 | ||||
| 36 | // RenderError renders the error screen with log tail (centered) | 31 | // RenderError renders the error screen with log tail (centered) | ||
| 37 | func RenderError(m model.UI, err error, phaseName string, duration time.Duration) string { | 32 | func RenderError(m model.UI, err error, phaseName string, duration time.Duration) string { | ||
| 38 | - | s := styles.ErrorStyle.Render("✗ Installation Failed") + "\n\n" | 33 | + | s := styles.ErrorStyle.Render("[KO] Installation Failed") + "\n\n" |
| 39 | s += fmt.Sprintf("Phase: %s\n", phaseName) | 34 | s += fmt.Sprintf("Phase: %s\n", phaseName) | ||
| 40 | s += fmt.Sprintf("Error: %v\n", err) | 35 | s += fmt.Sprintf("Error: %v\n", err) | ||
| 41 | s += fmt.Sprintf("Duration before failure: %s\n\n", formatDuration(duration)) | 36 | s += fmt.Sprintf("Duration before failure: %s\n\n", formatDuration(duration)) | ||