summaryrefslogtreecommitdiffhomepage
path: root/internal/tui
diff options
context:
space:
mode:
authoradamdottv <[email protected]>2025-05-12 10:45:03 -0500
committeradamdottv <[email protected]>2025-05-12 10:45:03 -0500
commit8cbfc581b5243aece96d32fc97c72ada5df3ae54 (patch)
treef7a6c45d6ea3f767526e37f0104f020da9481ffe /internal/tui
parent4bb350a09ba5c88a830f4ab07fcc99b4febda0dc (diff)
downloadopencode-8cbfc581b5243aece96d32fc97c72ada5df3ae54.tar.gz
opencode-8cbfc581b5243aece96d32fc97c72ada5df3ae54.zip
chore: cleanup
Diffstat (limited to 'internal/tui')
-rw-r--r--internal/tui/components/dialog/arguments.go1
-rw-r--r--internal/tui/components/dialog/commands.go2
-rw-r--r--internal/tui/components/dialog/init.go2
-rw-r--r--internal/tui/components/dialog/permission.go18
-rw-r--r--internal/tui/components/dialog/quit.go2
-rw-r--r--internal/tui/components/logs/details.go2
-rw-r--r--internal/tui/layout/container.go4
-rw-r--r--internal/tui/page/logs.go4
-rw-r--r--internal/tui/theme/catppuccin.go2
-rw-r--r--internal/tui/theme/dracula.go2
-rw-r--r--internal/tui/theme/flexoki.go30
-rw-r--r--internal/tui/theme/gruvbox.go10
-rw-r--r--internal/tui/theme/monokai.go2
-rw-r--r--internal/tui/theme/onedark.go2
-rw-r--r--internal/tui/theme/opencode.go1
-rw-r--r--internal/tui/theme/theme.go176
-rw-r--r--internal/tui/theme/theme_test.go32
-rw-r--r--internal/tui/theme/tokyonight.go2
-rw-r--r--internal/tui/theme/tron.go2
19 files changed, 151 insertions, 145 deletions
diff --git a/internal/tui/components/dialog/arguments.go b/internal/tui/components/dialog/arguments.go
index 7c9e0f863..9dda94e8e 100644
--- a/internal/tui/components/dialog/arguments.go
+++ b/internal/tui/components/dialog/arguments.go
@@ -170,4 +170,3 @@ type ShowArgumentsDialogMsg struct {
CommandID string
Content string
}
-
diff --git a/internal/tui/components/dialog/commands.go b/internal/tui/components/dialog/commands.go
index c725f020c..3524dfd5e 100644
--- a/internal/tui/components/dialog/commands.go
+++ b/internal/tui/components/dialog/commands.go
@@ -115,7 +115,7 @@ func (c *commandDialogCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
func (c *commandDialogCmp) View() string {
t := theme.CurrentTheme()
baseStyle := styles.BaseStyle()
-
+
if len(c.commands) == 0 {
return baseStyle.Padding(1, 2).
Border(lipgloss.RoundedBorder()).
diff --git a/internal/tui/components/dialog/init.go b/internal/tui/components/dialog/init.go
index 16fb070e6..55961b733 100644
--- a/internal/tui/components/dialog/init.go
+++ b/internal/tui/components/dialog/init.go
@@ -95,7 +95,7 @@ func (m InitDialogCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
func (m InitDialogCmp) View() string {
t := theme.CurrentTheme()
baseStyle := styles.BaseStyle()
-
+
// Calculate width needed for content
maxWidth := 60 // Width for explanation text
diff --git a/internal/tui/components/dialog/permission.go b/internal/tui/components/dialog/permission.go
index c8c34a570..609719941 100644
--- a/internal/tui/components/dialog/permission.go
+++ b/internal/tui/components/dialog/permission.go
@@ -150,7 +150,7 @@ func (p *permissionDialogCmp) selectCurrentOption() tea.Cmd {
func (p *permissionDialogCmp) renderButtons() string {
t := theme.CurrentTheme()
baseStyle := styles.BaseStyle()
-
+
allowStyle := baseStyle
allowSessionStyle := baseStyle
denyStyle := baseStyle
@@ -196,7 +196,7 @@ func (p *permissionDialogCmp) renderButtons() string {
func (p *permissionDialogCmp) renderHeader() string {
t := theme.CurrentTheme()
baseStyle := styles.BaseStyle()
-
+
toolKey := baseStyle.Foreground(t.TextMuted()).Bold(true).Render("Tool")
toolValue := baseStyle.
Foreground(t.Text()).
@@ -242,13 +242,13 @@ func (p *permissionDialogCmp) renderHeader() string {
func (p *permissionDialogCmp) renderBashContent() string {
t := theme.CurrentTheme()
baseStyle := styles.BaseStyle()
-
+
if pr, ok := p.permission.Params.(tools.BashPermissionsParams); ok {
content := fmt.Sprintf("```bash\n%s\n```", pr.Command)
// Use the cache for markdown rendering
renderedContent := p.GetOrSetMarkdown(p.permission.ID, func() (string, error) {
- r := styles.GetMarkdownRenderer(p.width-10)
+ r := styles.GetMarkdownRenderer(p.width - 10)
s, err := r.Render(content)
return styles.ForceReplaceBackgroundWithLipgloss(s, t.Background()), err
})
@@ -302,13 +302,13 @@ func (p *permissionDialogCmp) renderWriteContent() string {
func (p *permissionDialogCmp) renderFetchContent() string {
t := theme.CurrentTheme()
baseStyle := styles.BaseStyle()
-
+
if pr, ok := p.permission.Params.(tools.FetchPermissionsParams); ok {
content := fmt.Sprintf("```bash\n%s\n```", pr.URL)
// Use the cache for markdown rendering
renderedContent := p.GetOrSetMarkdown(p.permission.ID, func() (string, error) {
- r := styles.GetMarkdownRenderer(p.width-10)
+ r := styles.GetMarkdownRenderer(p.width - 10)
s, err := r.Render(content)
return styles.ForceReplaceBackgroundWithLipgloss(s, t.Background()), err
})
@@ -325,12 +325,12 @@ func (p *permissionDialogCmp) renderFetchContent() string {
func (p *permissionDialogCmp) renderDefaultContent() string {
t := theme.CurrentTheme()
baseStyle := styles.BaseStyle()
-
+
content := p.permission.Description
// Use the cache for markdown rendering
renderedContent := p.GetOrSetMarkdown(p.permission.ID, func() (string, error) {
- r := styles.GetMarkdownRenderer(p.width-10)
+ r := styles.GetMarkdownRenderer(p.width - 10)
s, err := r.Render(content)
return styles.ForceReplaceBackgroundWithLipgloss(s, t.Background()), err
})
@@ -358,7 +358,7 @@ func (p *permissionDialogCmp) styleViewport() string {
func (p *permissionDialogCmp) render() string {
t := theme.CurrentTheme()
baseStyle := styles.BaseStyle()
-
+
title := baseStyle.
Bold(true).
Width(p.width - 4).
diff --git a/internal/tui/components/dialog/quit.go b/internal/tui/components/dialog/quit.go
index f755fa272..bf1090060 100644
--- a/internal/tui/components/dialog/quit.go
+++ b/internal/tui/components/dialog/quit.go
@@ -84,7 +84,7 @@ func (q *quitDialogCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
func (q *quitDialogCmp) View() string {
t := theme.CurrentTheme()
baseStyle := styles.BaseStyle()
-
+
yesStyle := baseStyle
noStyle := baseStyle
spacerStyle := baseStyle.Background(t.Background())
diff --git a/internal/tui/components/logs/details.go b/internal/tui/components/logs/details.go
index da6edff13..3b712fe15 100644
--- a/internal/tui/components/logs/details.go
+++ b/internal/tui/components/logs/details.go
@@ -96,7 +96,7 @@ func (i *detailCmp) updateContent() {
valueStyle := lipgloss.NewStyle().Foreground(t.Text())
for key, value := range i.currentLog.Attributes {
- attrLine := fmt.Sprintf("%s: %s",
+ attrLine := fmt.Sprintf("%s: %s",
keyStyle.Render(key),
valueStyle.Render(value),
)
diff --git a/internal/tui/layout/container.go b/internal/tui/layout/container.go
index 75c0fe110..f960bd5f3 100644
--- a/internal/tui/layout/container.go
+++ b/internal/tui/layout/container.go
@@ -31,7 +31,7 @@ type container struct {
borderBottom bool
borderLeft bool
borderStyle lipgloss.Border
-
+
focused bool // Track focus state
}
@@ -69,7 +69,7 @@ func (c *container) View() string {
width--
}
style = style.Border(c.borderStyle, c.borderTop, c.borderRight, c.borderBottom, c.borderLeft)
-
+
// Use primary color for border if focused
if c.focused {
style = style.BorderBackground(t.Background()).BorderForeground(t.Primary())
diff --git a/internal/tui/page/logs.go b/internal/tui/page/logs.go
index 1495de8cf..b0e20ff00 100644
--- a/internal/tui/page/logs.go
+++ b/internal/tui/page/logs.go
@@ -196,7 +196,7 @@ func (p *logsPage) Init() tea.Cmd {
var cmds []tea.Cmd
cmds = append(cmds, p.table.Init())
cmds = append(cmds, p.details.Init())
-
+
// Send a key down and then key up to select the first row
// This ensures the details pane is populated when returning to the logs page
cmds = append(cmds, func() tea.Msg {
@@ -205,7 +205,7 @@ func (p *logsPage) Init() tea.Cmd {
cmds = append(cmds, func() tea.Msg {
return tea.KeyMsg{Type: tea.KeyUp}
})
-
+
return tea.Batch(cmds...)
}
diff --git a/internal/tui/theme/catppuccin.go b/internal/tui/theme/catppuccin.go
index a843100ab..c3c32501e 100644
--- a/internal/tui/theme/catppuccin.go
+++ b/internal/tui/theme/catppuccin.go
@@ -245,4 +245,4 @@ func NewCatppuccinTheme() *CatppuccinTheme {
func init() {
// Register the Catppuccin theme with the theme manager
RegisterTheme("catppuccin", NewCatppuccinTheme())
-} \ No newline at end of file
+}
diff --git a/internal/tui/theme/dracula.go b/internal/tui/theme/dracula.go
index e625206ae..29a1457d4 100644
--- a/internal/tui/theme/dracula.go
+++ b/internal/tui/theme/dracula.go
@@ -271,4 +271,4 @@ func NewDraculaTheme() *DraculaTheme {
func init() {
// Register the Dracula theme with the theme manager
RegisterTheme("dracula", NewDraculaTheme())
-} \ No newline at end of file
+}
diff --git a/internal/tui/theme/flexoki.go b/internal/tui/theme/flexoki.go
index 49d94beb1..5da5683c5 100644
--- a/internal/tui/theme/flexoki.go
+++ b/internal/tui/theme/flexoki.go
@@ -7,20 +7,20 @@ import (
// Flexoki color palette constants
const (
// Base colors
- flexokiPaper = "#FFFCF0" // Paper (lightest)
- flexokiBase50 = "#F2F0E5" // bg-2 (light)
- flexokiBase100 = "#E6E4D9" // ui (light)
- flexokiBase150 = "#DAD8CE" // ui-2 (light)
- flexokiBase200 = "#CECDC3" // ui-3 (light)
- flexokiBase300 = "#B7B5AC" // tx-3 (light)
- flexokiBase500 = "#878580" // tx-2 (light)
- flexokiBase600 = "#6F6E69" // tx (light)
- flexokiBase700 = "#575653" // tx-3 (dark)
- flexokiBase800 = "#403E3C" // ui-3 (dark)
- flexokiBase850 = "#343331" // ui-2 (dark)
- flexokiBase900 = "#282726" // ui (dark)
- flexokiBase950 = "#1C1B1A" // bg-2 (dark)
- flexokiBlack = "#100F0F" // bg (darkest)
+ flexokiPaper = "#FFFCF0" // Paper (lightest)
+ flexokiBase50 = "#F2F0E5" // bg-2 (light)
+ flexokiBase100 = "#E6E4D9" // ui (light)
+ flexokiBase150 = "#DAD8CE" // ui-2 (light)
+ flexokiBase200 = "#CECDC3" // ui-3 (light)
+ flexokiBase300 = "#B7B5AC" // tx-3 (light)
+ flexokiBase500 = "#878580" // tx-2 (light)
+ flexokiBase600 = "#6F6E69" // tx (light)
+ flexokiBase700 = "#575653" // tx-3 (dark)
+ flexokiBase800 = "#403E3C" // ui-3 (dark)
+ flexokiBase850 = "#343331" // ui-2 (dark)
+ flexokiBase900 = "#282726" // ui (dark)
+ flexokiBase950 = "#1C1B1A" // bg-2 (dark)
+ flexokiBlack = "#100F0F" // bg (darkest)
// Accent colors - Light theme (600)
flexokiRed600 = "#AF3029"
@@ -279,4 +279,4 @@ func NewFlexokiTheme() *FlexokiTheme {
func init() {
// Register the Flexoki theme with the theme manager
RegisterTheme("flexoki", NewFlexokiTheme())
-} \ No newline at end of file
+}
diff --git a/internal/tui/theme/gruvbox.go b/internal/tui/theme/gruvbox.go
index ed544b84d..51719faaa 100644
--- a/internal/tui/theme/gruvbox.go
+++ b/internal/tui/theme/gruvbox.go
@@ -173,11 +173,11 @@ func NewGruvboxTheme() *GruvboxTheme {
Light: gruvboxLightRedBright,
}
theme.DiffAddedBgColor = lipgloss.AdaptiveColor{
- Dark: "#3C4C3C", // Darker green background
+ Dark: "#3C4C3C", // Darker green background
Light: "#E8F5E9", // Light green background
}
theme.DiffRemovedBgColor = lipgloss.AdaptiveColor{
- Dark: "#4C3C3C", // Darker red background
+ Dark: "#4C3C3C", // Darker red background
Light: "#FFEBEE", // Light red background
}
theme.DiffContextBgColor = lipgloss.AdaptiveColor{
@@ -189,11 +189,11 @@ func NewGruvboxTheme() *GruvboxTheme {
Light: gruvboxLightFg4,
}
theme.DiffAddedLineNumberBgColor = lipgloss.AdaptiveColor{
- Dark: "#32432F", // Slightly darker green
+ Dark: "#32432F", // Slightly darker green
Light: "#C8E6C9", // Light green
}
theme.DiffRemovedLineNumberBgColor = lipgloss.AdaptiveColor{
- Dark: "#43322F", // Slightly darker red
+ Dark: "#43322F", // Slightly darker red
Light: "#FFCDD2", // Light red
}
@@ -299,4 +299,4 @@ func NewGruvboxTheme() *GruvboxTheme {
func init() {
// Register the Gruvbox theme with the theme manager
RegisterTheme("gruvbox", NewGruvboxTheme())
-} \ No newline at end of file
+}
diff --git a/internal/tui/theme/monokai.go b/internal/tui/theme/monokai.go
index 4695fefa9..7511d3333 100644
--- a/internal/tui/theme/monokai.go
+++ b/internal/tui/theme/monokai.go
@@ -270,4 +270,4 @@ func NewMonokaiProTheme() *MonokaiProTheme {
func init() {
// Register the Monokai Pro theme with the theme manager
RegisterTheme("monokai", NewMonokaiProTheme())
-} \ No newline at end of file
+}
diff --git a/internal/tui/theme/onedark.go b/internal/tui/theme/onedark.go
index 2b4dee50d..a2c1447ca 100644
--- a/internal/tui/theme/onedark.go
+++ b/internal/tui/theme/onedark.go
@@ -271,4 +271,4 @@ func NewOneDarkTheme() *OneDarkTheme {
func init() {
// Register the One Dark theme with the theme manager
RegisterTheme("onedark", NewOneDarkTheme())
-} \ No newline at end of file
+}
diff --git a/internal/tui/theme/opencode.go b/internal/tui/theme/opencode.go
index efec86154..7ee6f15e5 100644
--- a/internal/tui/theme/opencode.go
+++ b/internal/tui/theme/opencode.go
@@ -274,4 +274,3 @@ func init() {
// Register the OpenCode theme with the theme manager
RegisterTheme("opencode", NewOpenCodeTheme())
}
-
diff --git a/internal/tui/theme/theme.go b/internal/tui/theme/theme.go
index d0c64eb43..fffd316ba 100644
--- a/internal/tui/theme/theme.go
+++ b/internal/tui/theme/theme.go
@@ -83,25 +83,25 @@ type Theme interface {
// that can be embedded in concrete theme implementations.
type BaseTheme struct {
// Base colors
- PrimaryColor lipgloss.AdaptiveColor
- SecondaryColor lipgloss.AdaptiveColor
- AccentColor lipgloss.AdaptiveColor
+ PrimaryColor lipgloss.AdaptiveColor
+ SecondaryColor lipgloss.AdaptiveColor
+ AccentColor lipgloss.AdaptiveColor
// Status colors
- ErrorColor lipgloss.AdaptiveColor
- WarningColor lipgloss.AdaptiveColor
- SuccessColor lipgloss.AdaptiveColor
- InfoColor lipgloss.AdaptiveColor
+ ErrorColor lipgloss.AdaptiveColor
+ WarningColor lipgloss.AdaptiveColor
+ SuccessColor lipgloss.AdaptiveColor
+ InfoColor lipgloss.AdaptiveColor
// Text colors
- TextColor lipgloss.AdaptiveColor
- TextMutedColor lipgloss.AdaptiveColor
+ TextColor lipgloss.AdaptiveColor
+ TextMutedColor lipgloss.AdaptiveColor
TextEmphasizedColor lipgloss.AdaptiveColor
// Background colors
- BackgroundColor lipgloss.AdaptiveColor
+ BackgroundColor lipgloss.AdaptiveColor
BackgroundSecondaryColor lipgloss.AdaptiveColor
- BackgroundDarkerColor lipgloss.AdaptiveColor
+ BackgroundDarkerColor lipgloss.AdaptiveColor
// Border colors
BorderNormalColor lipgloss.AdaptiveColor
@@ -109,105 +109,113 @@ type BaseTheme struct {
BorderDimColor lipgloss.AdaptiveColor
// Diff view colors
- DiffAddedColor lipgloss.AdaptiveColor
- DiffRemovedColor lipgloss.AdaptiveColor
- DiffContextColor lipgloss.AdaptiveColor
- DiffHunkHeaderColor lipgloss.AdaptiveColor
- DiffHighlightAddedColor lipgloss.AdaptiveColor
- DiffHighlightRemovedColor lipgloss.AdaptiveColor
- DiffAddedBgColor lipgloss.AdaptiveColor
- DiffRemovedBgColor lipgloss.AdaptiveColor
- DiffContextBgColor lipgloss.AdaptiveColor
- DiffLineNumberColor lipgloss.AdaptiveColor
- DiffAddedLineNumberBgColor lipgloss.AdaptiveColor
+ DiffAddedColor lipgloss.AdaptiveColor
+ DiffRemovedColor lipgloss.AdaptiveColor
+ DiffContextColor lipgloss.AdaptiveColor
+ DiffHunkHeaderColor lipgloss.AdaptiveColor
+ DiffHighlightAddedColor lipgloss.AdaptiveColor
+ DiffHighlightRemovedColor lipgloss.AdaptiveColor
+ DiffAddedBgColor lipgloss.AdaptiveColor
+ DiffRemovedBgColor lipgloss.AdaptiveColor
+ DiffContextBgColor lipgloss.AdaptiveColor
+ DiffLineNumberColor lipgloss.AdaptiveColor
+ DiffAddedLineNumberBgColor lipgloss.AdaptiveColor
DiffRemovedLineNumberBgColor lipgloss.AdaptiveColor
// Markdown colors
- MarkdownTextColor lipgloss.AdaptiveColor
- MarkdownHeadingColor lipgloss.AdaptiveColor
- MarkdownLinkColor lipgloss.AdaptiveColor
- MarkdownLinkTextColor lipgloss.AdaptiveColor
- MarkdownCodeColor lipgloss.AdaptiveColor
- MarkdownBlockQuoteColor lipgloss.AdaptiveColor
- MarkdownEmphColor lipgloss.AdaptiveColor
- MarkdownStrongColor lipgloss.AdaptiveColor
- MarkdownHorizontalRuleColor lipgloss.AdaptiveColor
- MarkdownListItemColor lipgloss.AdaptiveColor
+ MarkdownTextColor lipgloss.AdaptiveColor
+ MarkdownHeadingColor lipgloss.AdaptiveColor
+ MarkdownLinkColor lipgloss.AdaptiveColor
+ MarkdownLinkTextColor lipgloss.AdaptiveColor
+ MarkdownCodeColor lipgloss.AdaptiveColor
+ MarkdownBlockQuoteColor lipgloss.AdaptiveColor
+ MarkdownEmphColor lipgloss.AdaptiveColor
+ MarkdownStrongColor lipgloss.AdaptiveColor
+ MarkdownHorizontalRuleColor lipgloss.AdaptiveColor
+ MarkdownListItemColor lipgloss.AdaptiveColor
MarkdownListEnumerationColor lipgloss.AdaptiveColor
- MarkdownImageColor lipgloss.AdaptiveColor
- MarkdownImageTextColor lipgloss.AdaptiveColor
- MarkdownCodeBlockColor lipgloss.AdaptiveColor
+ MarkdownImageColor lipgloss.AdaptiveColor
+ MarkdownImageTextColor lipgloss.AdaptiveColor
+ MarkdownCodeBlockColor lipgloss.AdaptiveColor
// Syntax highlighting colors
- SyntaxCommentColor lipgloss.AdaptiveColor
- SyntaxKeywordColor lipgloss.AdaptiveColor
- SyntaxFunctionColor lipgloss.AdaptiveColor
- SyntaxVariableColor lipgloss.AdaptiveColor
- SyntaxStringColor lipgloss.AdaptiveColor
- SyntaxNumberColor lipgloss.AdaptiveColor
- SyntaxTypeColor lipgloss.AdaptiveColor
- SyntaxOperatorColor lipgloss.AdaptiveColor
+ SyntaxCommentColor lipgloss.AdaptiveColor
+ SyntaxKeywordColor lipgloss.AdaptiveColor
+ SyntaxFunctionColor lipgloss.AdaptiveColor
+ SyntaxVariableColor lipgloss.AdaptiveColor
+ SyntaxStringColor lipgloss.AdaptiveColor
+ SyntaxNumberColor lipgloss.AdaptiveColor
+ SyntaxTypeColor lipgloss.AdaptiveColor
+ SyntaxOperatorColor lipgloss.AdaptiveColor
SyntaxPunctuationColor lipgloss.AdaptiveColor
}
// Implement the Theme interface for BaseTheme
-func (t *BaseTheme) Primary() lipgloss.AdaptiveColor { return t.PrimaryColor }
+func (t *BaseTheme) Primary() lipgloss.AdaptiveColor { return t.PrimaryColor }
func (t *BaseTheme) Secondary() lipgloss.AdaptiveColor { return t.SecondaryColor }
-func (t *BaseTheme) Accent() lipgloss.AdaptiveColor { return t.AccentColor }
+func (t *BaseTheme) Accent() lipgloss.AdaptiveColor { return t.AccentColor }
-func (t *BaseTheme) Error() lipgloss.AdaptiveColor { return t.ErrorColor }
+func (t *BaseTheme) Error() lipgloss.AdaptiveColor { return t.ErrorColor }
func (t *BaseTheme) Warning() lipgloss.AdaptiveColor { return t.WarningColor }
func (t *BaseTheme) Success() lipgloss.AdaptiveColor { return t.SuccessColor }
-func (t *BaseTheme) Info() lipgloss.AdaptiveColor { return t.InfoColor }
+func (t *BaseTheme) Info() lipgloss.AdaptiveColor { return t.InfoColor }
-func (t *BaseTheme) Text() lipgloss.AdaptiveColor { return t.TextColor }
-func (t *BaseTheme) TextMuted() lipgloss.AdaptiveColor { return t.TextMutedColor }
+func (t *BaseTheme) Text() lipgloss.AdaptiveColor { return t.TextColor }
+func (t *BaseTheme) TextMuted() lipgloss.AdaptiveColor { return t.TextMutedColor }
func (t *BaseTheme) TextEmphasized() lipgloss.AdaptiveColor { return t.TextEmphasizedColor }
-func (t *BaseTheme) Background() lipgloss.AdaptiveColor { return t.BackgroundColor }
+func (t *BaseTheme) Background() lipgloss.AdaptiveColor { return t.BackgroundColor }
func (t *BaseTheme) BackgroundSecondary() lipgloss.AdaptiveColor { return t.BackgroundSecondaryColor }
-func (t *BaseTheme) BackgroundDarker() lipgloss.AdaptiveColor { return t.BackgroundDarkerColor }
+func (t *BaseTheme) BackgroundDarker() lipgloss.AdaptiveColor { return t.BackgroundDarkerColor }
-func (t *BaseTheme) BorderNormal() lipgloss.AdaptiveColor { return t.BorderNormalColor }
+func (t *BaseTheme) BorderNormal() lipgloss.AdaptiveColor { return t.BorderNormalColor }
func (t *BaseTheme) BorderFocused() lipgloss.AdaptiveColor { return t.BorderFocusedColor }
-func (t *BaseTheme) BorderDim() lipgloss.AdaptiveColor { return t.BorderDimColor }
+func (t *BaseTheme) BorderDim() lipgloss.AdaptiveColor { return t.BorderDimColor }
-func (t *BaseTheme) DiffAdded() lipgloss.AdaptiveColor { return t.DiffAddedColor }
-func (t *BaseTheme) DiffRemoved() lipgloss.AdaptiveColor { return t.DiffRemovedColor }
-func (t *BaseTheme) DiffContext() lipgloss.AdaptiveColor { return t.DiffContextColor }
-func (t *BaseTheme) DiffHunkHeader() lipgloss.AdaptiveColor { return t.DiffHunkHeaderColor }
-func (t *BaseTheme) DiffHighlightAdded() lipgloss.AdaptiveColor { return t.DiffHighlightAddedColor }
+func (t *BaseTheme) DiffAdded() lipgloss.AdaptiveColor { return t.DiffAddedColor }
+func (t *BaseTheme) DiffRemoved() lipgloss.AdaptiveColor { return t.DiffRemovedColor }
+func (t *BaseTheme) DiffContext() lipgloss.AdaptiveColor { return t.DiffContextColor }
+func (t *BaseTheme) DiffHunkHeader() lipgloss.AdaptiveColor { return t.DiffHunkHeaderColor }
+func (t *BaseTheme) DiffHighlightAdded() lipgloss.AdaptiveColor { return t.DiffHighlightAddedColor }
func (t *BaseTheme) DiffHighlightRemoved() lipgloss.AdaptiveColor { return t.DiffHighlightRemovedColor }
-func (t *BaseTheme) DiffAddedBg() lipgloss.AdaptiveColor { return t.DiffAddedBgColor }
-func (t *BaseTheme) DiffRemovedBg() lipgloss.AdaptiveColor { return t.DiffRemovedBgColor }
-func (t *BaseTheme) DiffContextBg() lipgloss.AdaptiveColor { return t.DiffContextBgColor }
-func (t *BaseTheme) DiffLineNumber() lipgloss.AdaptiveColor { return t.DiffLineNumberColor }
-func (t *BaseTheme) DiffAddedLineNumberBg() lipgloss.AdaptiveColor { return t.DiffAddedLineNumberBgColor }
-func (t *BaseTheme) DiffRemovedLineNumberBg() lipgloss.AdaptiveColor { return t.DiffRemovedLineNumberBgColor }
-
-func (t *BaseTheme) MarkdownText() lipgloss.AdaptiveColor { return t.MarkdownTextColor }
-func (t *BaseTheme) MarkdownHeading() lipgloss.AdaptiveColor { return t.MarkdownHeadingColor }
-func (t *BaseTheme) MarkdownLink() lipgloss.AdaptiveColor { return t.MarkdownLinkColor }
-func (t *BaseTheme) MarkdownLinkText() lipgloss.AdaptiveColor { return t.MarkdownLinkTextColor }
-func (t *BaseTheme) MarkdownCode() lipgloss.AdaptiveColor { return t.MarkdownCodeColor }
+func (t *BaseTheme) DiffAddedBg() lipgloss.AdaptiveColor { return t.DiffAddedBgColor }
+func (t *BaseTheme) DiffRemovedBg() lipgloss.AdaptiveColor { return t.DiffRemovedBgColor }
+func (t *BaseTheme) DiffContextBg() lipgloss.AdaptiveColor { return t.DiffContextBgColor }
+func (t *BaseTheme) DiffLineNumber() lipgloss.AdaptiveColor { return t.DiffLineNumberColor }
+func (t *BaseTheme) DiffAddedLineNumberBg() lipgloss.AdaptiveColor {
+ return t.DiffAddedLineNumberBgColor
+}
+func (t *BaseTheme) DiffRemovedLineNumberBg() lipgloss.AdaptiveColor {
+ return t.DiffRemovedLineNumberBgColor
+}
+
+func (t *BaseTheme) MarkdownText() lipgloss.AdaptiveColor { return t.MarkdownTextColor }
+func (t *BaseTheme) MarkdownHeading() lipgloss.AdaptiveColor { return t.MarkdownHeadingColor }
+func (t *BaseTheme) MarkdownLink() lipgloss.AdaptiveColor { return t.MarkdownLinkColor }
+func (t *BaseTheme) MarkdownLinkText() lipgloss.AdaptiveColor { return t.MarkdownLinkTextColor }
+func (t *BaseTheme) MarkdownCode() lipgloss.AdaptiveColor { return t.MarkdownCodeColor }
func (t *BaseTheme) MarkdownBlockQuote() lipgloss.AdaptiveColor { return t.MarkdownBlockQuoteColor }
-func (t *BaseTheme) MarkdownEmph() lipgloss.AdaptiveColor { return t.MarkdownEmphColor }
-func (t *BaseTheme) MarkdownStrong() lipgloss.AdaptiveColor { return t.MarkdownStrongColor }
-func (t *BaseTheme) MarkdownHorizontalRule() lipgloss.AdaptiveColor { return t.MarkdownHorizontalRuleColor }
+func (t *BaseTheme) MarkdownEmph() lipgloss.AdaptiveColor { return t.MarkdownEmphColor }
+func (t *BaseTheme) MarkdownStrong() lipgloss.AdaptiveColor { return t.MarkdownStrongColor }
+func (t *BaseTheme) MarkdownHorizontalRule() lipgloss.AdaptiveColor {
+ return t.MarkdownHorizontalRuleColor
+}
func (t *BaseTheme) MarkdownListItem() lipgloss.AdaptiveColor { return t.MarkdownListItemColor }
-func (t *BaseTheme) MarkdownListEnumeration() lipgloss.AdaptiveColor { return t.MarkdownListEnumerationColor }
-func (t *BaseTheme) MarkdownImage() lipgloss.AdaptiveColor { return t.MarkdownImageColor }
+func (t *BaseTheme) MarkdownListEnumeration() lipgloss.AdaptiveColor {
+ return t.MarkdownListEnumerationColor
+}
+func (t *BaseTheme) MarkdownImage() lipgloss.AdaptiveColor { return t.MarkdownImageColor }
func (t *BaseTheme) MarkdownImageText() lipgloss.AdaptiveColor { return t.MarkdownImageTextColor }
func (t *BaseTheme) MarkdownCodeBlock() lipgloss.AdaptiveColor { return t.MarkdownCodeBlockColor }
-func (t *BaseTheme) SyntaxComment() lipgloss.AdaptiveColor { return t.SyntaxCommentColor }
-func (t *BaseTheme) SyntaxKeyword() lipgloss.AdaptiveColor { return t.SyntaxKeywordColor }
-func (t *BaseTheme) SyntaxFunction() lipgloss.AdaptiveColor { return t.SyntaxFunctionColor }
-func (t *BaseTheme) SyntaxVariable() lipgloss.AdaptiveColor { return t.SyntaxVariableColor }
-func (t *BaseTheme) SyntaxString() lipgloss.AdaptiveColor { return t.SyntaxStringColor }
-func (t *BaseTheme) SyntaxNumber() lipgloss.AdaptiveColor { return t.SyntaxNumberColor }
-func (t *BaseTheme) SyntaxType() lipgloss.AdaptiveColor { return t.SyntaxTypeColor }
-func (t *BaseTheme) SyntaxOperator() lipgloss.AdaptiveColor { return t.SyntaxOperatorColor }
+func (t *BaseTheme) SyntaxComment() lipgloss.AdaptiveColor { return t.SyntaxCommentColor }
+func (t *BaseTheme) SyntaxKeyword() lipgloss.AdaptiveColor { return t.SyntaxKeywordColor }
+func (t *BaseTheme) SyntaxFunction() lipgloss.AdaptiveColor { return t.SyntaxFunctionColor }
+func (t *BaseTheme) SyntaxVariable() lipgloss.AdaptiveColor { return t.SyntaxVariableColor }
+func (t *BaseTheme) SyntaxString() lipgloss.AdaptiveColor { return t.SyntaxStringColor }
+func (t *BaseTheme) SyntaxNumber() lipgloss.AdaptiveColor { return t.SyntaxNumberColor }
+func (t *BaseTheme) SyntaxType() lipgloss.AdaptiveColor { return t.SyntaxTypeColor }
+func (t *BaseTheme) SyntaxOperator() lipgloss.AdaptiveColor { return t.SyntaxOperatorColor }
func (t *BaseTheme) SyntaxPunctuation() lipgloss.AdaptiveColor { return t.SyntaxPunctuationColor }
// ParseAdaptiveColor parses a color value from the config file into a lipgloss.AdaptiveColor.
@@ -254,4 +262,4 @@ func ParseAdaptiveColor(value any) (lipgloss.AdaptiveColor, error) {
}
return lipgloss.AdaptiveColor{}, fmt.Errorf("color must be either a hex string or an object with dark/light keys")
-} \ No newline at end of file
+}
diff --git a/internal/tui/theme/theme_test.go b/internal/tui/theme/theme_test.go
index 5ec810e33..790ee3aa8 100644
--- a/internal/tui/theme/theme_test.go
+++ b/internal/tui/theme/theme_test.go
@@ -7,7 +7,7 @@ import (
func TestThemeRegistration(t *testing.T) {
// Get list of available themes
availableThemes := AvailableThemes()
-
+
// Check if "catppuccin" theme is registered
catppuccinFound := false
for _, themeName := range availableThemes {
@@ -16,11 +16,11 @@ func TestThemeRegistration(t *testing.T) {
break
}
}
-
+
if !catppuccinFound {
t.Errorf("Catppuccin theme is not registered")
}
-
+
// Check if "gruvbox" theme is registered
gruvboxFound := false
for _, themeName := range availableThemes {
@@ -29,11 +29,11 @@ func TestThemeRegistration(t *testing.T) {
break
}
}
-
+
if !gruvboxFound {
t.Errorf("Gruvbox theme is not registered")
}
-
+
// Check if "monokai" theme is registered
monokaiFound := false
for _, themeName := range availableThemes {
@@ -42,48 +42,48 @@ func TestThemeRegistration(t *testing.T) {
break
}
}
-
+
if !monokaiFound {
t.Errorf("Monokai theme is not registered")
}
-
+
// Try to get the themes and make sure they're not nil
catppuccin := GetTheme("catppuccin")
if catppuccin == nil {
t.Errorf("Catppuccin theme is nil")
}
-
+
gruvbox := GetTheme("gruvbox")
if gruvbox == nil {
t.Errorf("Gruvbox theme is nil")
}
-
+
monokai := GetTheme("monokai")
if monokai == nil {
t.Errorf("Monokai theme is nil")
}
-
+
// Test switching theme
originalTheme := CurrentThemeName()
-
+
err := SetTheme("gruvbox")
if err != nil {
t.Errorf("Failed to set theme to gruvbox: %v", err)
}
-
+
if CurrentThemeName() != "gruvbox" {
t.Errorf("Theme not properly switched to gruvbox")
}
-
+
err = SetTheme("monokai")
if err != nil {
t.Errorf("Failed to set theme to monokai: %v", err)
}
-
+
if CurrentThemeName() != "monokai" {
t.Errorf("Theme not properly switched to monokai")
}
-
+
// Switch back to original theme
_ = SetTheme(originalTheme)
-} \ No newline at end of file
+}
diff --git a/internal/tui/theme/tokyonight.go b/internal/tui/theme/tokyonight.go
index acd9dbf6c..a6499a25d 100644
--- a/internal/tui/theme/tokyonight.go
+++ b/internal/tui/theme/tokyonight.go
@@ -271,4 +271,4 @@ func NewTokyoNightTheme() *TokyoNightTheme {
func init() {
// Register the Tokyo Night theme with the theme manager
RegisterTheme("tokyonight", NewTokyoNightTheme())
-} \ No newline at end of file
+}
diff --git a/internal/tui/theme/tron.go b/internal/tui/theme/tron.go
index 5f1bdfb0d..c4997a6d1 100644
--- a/internal/tui/theme/tron.go
+++ b/internal/tui/theme/tron.go
@@ -273,4 +273,4 @@ func NewTronTheme() *TronTheme {
func init() {
// Register the Tron theme with the theme manager
RegisterTheme("tron", NewTronTheme())
-} \ No newline at end of file
+}