Files
cburn/cmd/tui.go
teernisse 19b8bab5d8 fix(tui): force TrueColor profile for consistent background rendering
Set lipgloss.SetColorProfile(termenv.TrueColor) before launching the
Bubble Tea program to ensure ANSI escape codes are always generated
for background styling.

Without this fix, lipgloss may default to the Ascii profile on some
terminals, causing all background colors to be stripped. This manifests
as cards with missing backgrounds and inconsistent visual appearance
where borders render but fills don't.

This is particularly important for the visual polish work where
components like cards, status bars, and tab bars rely heavily on
background colors to create depth and visual hierarchy.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-28 00:05:26 -05:00

44 lines
1.0 KiB
Go

package cmd
import (
"fmt"
"github.com/theirongolddev/cburn/internal/config"
"github.com/theirongolddev/cburn/internal/tui"
"github.com/theirongolddev/cburn/internal/tui/theme"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
"github.com/muesli/termenv"
"github.com/spf13/cobra"
)
var tuiCmd = &cobra.Command{
Use: "tui",
Short: "Launch interactive TUI dashboard",
RunE: runTUI,
}
func init() {
rootCmd.AddCommand(tuiCmd)
}
func runTUI(_ *cobra.Command, _ []string) error {
// Load config for theme
cfg, _ := config.Load()
theme.SetActive(cfg.Appearance.Theme)
// Force TrueColor profile so all background styling produces ANSI codes
// Without this, lipgloss may default to Ascii profile (no colors)
lipgloss.SetColorProfile(termenv.TrueColor)
app := tui.NewApp(flagDataDir, flagDays, flagProject, flagModel, !flagNoSubagents)
p := tea.NewProgram(app, tea.WithAltScreen())
if _, err := p.Run(); err != nil {
return fmt.Errorf("TUI error: %w", err)
}
return nil
}