Skip to content
This repository was archived by the owner on Sep 18, 2025. It is now read-only.

Commit e359209

Browse files
committed
remove old theme
1 parent dfd2378 commit e359209

17 files changed

Lines changed: 24 additions & 2152 deletions

File tree

internal/app/app.go

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import (
1919
"github.com/opencode-ai/opencode/internal/message"
2020
"github.com/opencode-ai/opencode/internal/permission"
2121
"github.com/opencode-ai/opencode/internal/session"
22-
"github.com/opencode-ai/opencode/internal/tui/theme"
2322
)
2423

2524
type App struct {
@@ -53,9 +52,6 @@ func New(ctx context.Context, conn *sql.DB) (*App, error) {
5352
LSPClients: make(map[string]*lsp.Client),
5453
}
5554

56-
// Initialize theme based on configuration
57-
app.initTheme()
58-
5955
// Initialize LSP clients in the background
6056
go app.initLSPClients(ctx)
6157

@@ -80,22 +76,6 @@ func New(ctx context.Context, conn *sql.DB) (*App, error) {
8076
return app, nil
8177
}
8278

83-
// initTheme sets the application theme based on the configuration
84-
func (app *App) initTheme() {
85-
cfg := config.Get()
86-
if cfg == nil || cfg.TUI.Theme == "" {
87-
return // Use default theme
88-
}
89-
90-
// Try to set the theme from config
91-
err := theme.SetTheme(cfg.TUI.Theme)
92-
if err != nil {
93-
logging.Warn("Failed to set theme from config, using default theme", "theme", cfg.TUI.Theme, "error", err)
94-
} else {
95-
logging.Debug("Set theme from config", "theme", cfg.TUI.Theme)
96-
}
97-
}
98-
9979
// RunNonInteractive handles the execution flow when a prompt is provided via CLI flag.
10080
func (a *App) RunNonInteractive(ctx context.Context, prompt string, outputFormat string, quiet bool) error {
10181
logging.Info("Running in non-interactive mode")

internal/tui/components/dialog/permission.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,17 +157,17 @@ func (p *permissionDialogCmp) renderButtons() string {
157157
// Style the selected button
158158
switch p.selectedOption {
159159
case 0:
160-
allowStyle = allowStyle.Background(t.Primary)
160+
allowStyle = allowStyle.Background(t.Secondary)
161161
allowSessionStyle = allowSessionStyle.Background(t.BgSubtle)
162162
denyStyle = denyStyle.Background(t.BgSubtle)
163163
case 1:
164164
allowStyle = allowStyle.Background(t.BgSubtle)
165-
allowSessionStyle = allowSessionStyle.Background(t.Primary)
165+
allowSessionStyle = allowSessionStyle.Background(t.Secondary)
166166
denyStyle = denyStyle.Background(t.BgSubtle)
167167
case 2:
168168
allowStyle = allowStyle.Background(t.BgSubtle)
169169
allowSessionStyle = allowSessionStyle.Background(t.BgSubtle)
170-
denyStyle = denyStyle.Background(t.Primary)
170+
denyStyle = denyStyle.Background(t.Secondary)
171171
}
172172

173173
allowButton := allowStyle.Padding(0, 1).Render("Allow (a)")

internal/tui/components/dialogs/quit/quit.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ func (q *quitDialogCmp) View() tea.View {
7474
noStyle := yesStyle
7575

7676
if q.selectedNo {
77-
noStyle = noStyle.Background(t.Primary)
77+
noStyle = noStyle.Background(t.Secondary)
7878
yesStyle = yesStyle.Background(t.BgSubtle)
7979
} else {
80-
yesStyle = yesStyle.Background(t.Primary)
80+
yesStyle = yesStyle.Background(t.Secondary)
8181
noStyle = noStyle.Background(t.BgSubtle)
8282
}
8383

84-
yesButton := yesStyle.Padding(0, 1).Render("Yes")
85-
noButton := noStyle.Padding(0, 1).Render("No")
84+
yesButton := yesStyle.Padding(0, 1).Render("Yep!")
85+
noButton := noStyle.Padding(0, 1).Render("Nope")
8686

8787
buttons := baseStyle.Width(lipgloss.Width(question)).Align(lipgloss.Right).Render(
8888
lipgloss.JoinHorizontal(lipgloss.Center, yesButton, " ", noButton),

internal/tui/components/logs/details.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"github.com/charmbracelet/lipgloss/v2"
1212
"github.com/opencode-ai/opencode/internal/logging"
1313
"github.com/opencode-ai/opencode/internal/tui/layout"
14-
"github.com/opencode-ai/opencode/internal/tui/theme"
14+
"github.com/opencode-ai/opencode/internal/tui/styles"
1515
"github.com/opencode-ai/opencode/internal/tui/util"
1616
)
1717

@@ -50,10 +50,10 @@ func (i *detailCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
5050

5151
func (i *detailCmp) updateContent() {
5252
var content strings.Builder
53-
t := theme.CurrentTheme()
53+
t := styles.CurrentTheme()
5454

5555
// Format the header with timestamp and level
56-
timeStyle := lipgloss.NewStyle().Foreground(t.TextMuted())
56+
timeStyle := t.S().Muted
5757
levelStyle := getLevelStyle(i.currentLog.Level)
5858

5959
header := lipgloss.JoinHorizontal(
@@ -67,21 +67,21 @@ func (i *detailCmp) updateContent() {
6767
content.WriteString("\n\n")
6868

6969
// Message with styling
70-
messageStyle := lipgloss.NewStyle().Bold(true).Foreground(t.Text())
70+
messageStyle := t.S().Text.Bold(true)
7171
content.WriteString(messageStyle.Render("Message:"))
7272
content.WriteString("\n")
7373
content.WriteString(lipgloss.NewStyle().Padding(0, 2).Render(i.currentLog.Message))
7474
content.WriteString("\n\n")
7575

7676
// Attributes section
7777
if len(i.currentLog.Attributes) > 0 {
78-
attrHeaderStyle := lipgloss.NewStyle().Bold(true).Foreground(t.Text())
78+
attrHeaderStyle := t.S().Text.Bold(true)
7979
content.WriteString(attrHeaderStyle.Render("Attributes:"))
8080
content.WriteString("\n")
8181

8282
// Create a table-like display for attributes
83-
keyStyle := lipgloss.NewStyle().Foreground(t.Primary()).Bold(true)
84-
valueStyle := lipgloss.NewStyle().Foreground(t.Text())
83+
keyStyle := t.S().Base.Foreground(t.Primary).Bold(true)
84+
valueStyle := t.S().Text
8585

8686
for _, attr := range i.currentLog.Attributes {
8787
attrLine := fmt.Sprintf("%s: %s",
@@ -97,20 +97,20 @@ func (i *detailCmp) updateContent() {
9797
}
9898

9999
func getLevelStyle(level string) lipgloss.Style {
100-
style := lipgloss.NewStyle().Bold(true)
101-
t := theme.CurrentTheme()
100+
t := styles.CurrentTheme()
101+
style := t.S().Base.Bold(true)
102102

103103
switch strings.ToLower(level) {
104104
case "info":
105-
return style.Foreground(t.Info())
105+
return style.Foreground(t.Info)
106106
case "warn", "warning":
107-
return style.Foreground(t.Warning())
107+
return style.Foreground(t.Warning)
108108
case "error", "err":
109-
return style.Foreground(t.Error())
109+
return style.Foreground(t.Error)
110110
case "debug":
111-
return style.Foreground(t.Success())
111+
return style.Foreground(t.Success)
112112
default:
113-
return style.Foreground(t.Text())
113+
return style.Foreground(t.FgBase)
114114
}
115115
}
116116

internal/tui/components/logs/table.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/opencode-ai/opencode/internal/logging"
1111
"github.com/opencode-ai/opencode/internal/pubsub"
1212
"github.com/opencode-ai/opencode/internal/tui/layout"
13-
"github.com/opencode-ai/opencode/internal/tui/theme"
13+
"github.com/opencode-ai/opencode/internal/tui/styles"
1414
"github.com/opencode-ai/opencode/internal/tui/util"
1515
)
1616

@@ -61,9 +61,9 @@ func (i *tableCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
6161
}
6262

6363
func (i *tableCmp) View() tea.View {
64-
t := theme.CurrentTheme()
64+
t := styles.CurrentTheme()
6565
defaultStyles := table.DefaultStyles()
66-
defaultStyles.Selected = defaultStyles.Selected.Foreground(t.Primary())
66+
defaultStyles.Selected = defaultStyles.Selected.Foreground(t.Primary)
6767
i.table.SetStyles(defaultStyles)
6868
return tea.NewView(i.table.View())
6969
}

internal/tui/theme/catppuccin.go

Lines changed: 0 additions & 172 deletions
This file was deleted.

0 commit comments

Comments
 (0)