on main help sign in
chore: run `gofumpt`
commit09274460dee8ac0619df4f2d921335e548ed5617 authorAndrey Nering <andreynering@users.noreply.github.com> dateThu 22 May 2025, 17:31 (1 year ago) parentf6386bd
17 files changed+117−121
internal/app/lsp.go+5−5 internal/config/init.go−1 internal/llm/prompt/prompt_test.go+3−3 internal/llm/provider/azure.go−1 internal/llm/provider/bedrock.go−1 internal/llm/tools/ls_test.go+27−27 internal/llm/tools/shell/shell.go+4−4 internal/tui/components/dialog/custom_commands.go+1−2 internal/tui/components/dialog/custom_commands_test.go+10−10 internal/tui/theme/dracula.go+1−1 internal/tui/theme/flexoki.go+35−35 internal/tui/theme/gruvbox.go+6−6 internal/tui/theme/monokai.go+1−1 internal/tui/theme/onedark.go+1−1 internal/tui/theme/theme_test.go+16−16 internal/tui/theme/tokyonight.go+6−6 internal/tui/theme/tron.go+1−1
internal/app/lsp.go+5−5
@@ -25,7 +25,7 @@ func (app *App) initLSPClients(ctx context.Context) {
2525func (app *App) createAndStartLSPClient(ctx context.Context, name string, command string, args ...string) {
2626 // Create a specific context for initialization with a timeout
2727 logging.Info("Creating LSP client", "name", name, "command", command, "args", args)
28−
28+
2929 // Create the LSP client
3030 lspClient, err := lsp.NewClient(ctx, command, args...)
3131 if err != nil {
@@ -36,7 +36,7 @@ func (app *App) createAndStartLSPClient(ctx context.Context, name string, comman
3636 // Create a longer timeout for initialization (some servers take time to start)
3737 initCtx, cancel := context.WithTimeout(ctx, 30*time.Second)
3838 defer cancel()
39−
39+
4040 // Initialize with the initialization context
4141 _, err = lspClient.InitializeLSPClient(initCtx, config.WorkingDirectory())
4242 if err != nil {
@@ -57,13 +57,13 @@ func (app *App) createAndStartLSPClient(ctx context.Context, name string, comman
5757 }
5858
5959 logging.Info("LSP client initialized", "name", name)
60−
60+
6161 // Create a child context that can be canceled when the app is shutting down
6262 watchCtx, cancelFunc := context.WithCancel(ctx)
63−
63+
6464 // Create a context with the server name for better identification
6565 watchCtx = context.WithValue(watchCtx, "serverName", name)
66−
66+
6767 // Create the workspace watcher
6868 workspaceWatcher := watcher.NewWorkspaceWatcher(lspClient)
6969
internal/config/init.go−1
@@ -58,4 +58,3 @@ func MarkProjectInitialized() error {
5858
5959 return nil
6060}
61−
internal/llm/prompt/prompt_test.go+3−3
@@ -44,13 +44,13 @@ func createTestFiles(t *testing.T, tmpDir string, testFiles []string) {
4444 for _, path := range testFiles {
4545 fullPath := filepath.Join(tmpDir, path)
4646 if path[len(path)-1] == '/' {
47− err := os.MkdirAll(fullPath, 0755)
47+ err := os.MkdirAll(fullPath, 0o755)
4848 require.NoError(t, err)
4949 } else {
5050 dir := filepath.Dir(fullPath)
51− err := os.MkdirAll(dir, 0755)
51+ err := os.MkdirAll(dir, 0o755)
5252 require.NoError(t, err)
53− err = os.WriteFile(fullPath, []byte(path+": test content"), 0644)
53+ err = os.WriteFile(fullPath, []byte(path+": test content"), 0o644)
5454 require.NoError(t, err)
5555 }
5656 }
internal/llm/provider/azure.go−1
@@ -16,7 +16,6 @@ type azureClient struct {
1616type AzureClient ProviderClient
1717
1818func newAzureClient(opts providerClientOptions) AzureClient {
19−
2019 endpoint := os.Getenv("AZURE_OPENAI_ENDPOINT") // ex: https://foo.openai.azure.com
2120 apiVersion := os.Getenv("AZURE_OPENAI_API_VERSION") // ex: 2025-04-01-preview
2221
internal/llm/provider/bedrock.go−1
@@ -98,4 +98,3 @@ func (b *bedrockClient) stream(ctx context.Context, messages []message.Message,
9898
9999 return b.childProvider.stream(ctx, messages, tools)
100100}
101−
internal/llm/tools/ls_test.go+27−27
@@ -56,14 +56,14 @@ func TestLsTool_Run(t *testing.T) {
5656 // Create directories
5757 for _, dir := range testDirs {
5858 dirPath := filepath.Join(tempDir, dir)
59− err := os.MkdirAll(dirPath, 0755)
59+ err := os.MkdirAll(dirPath, 0o755)
6060 require.NoError(t, err)
6161 }
6262
6363 // Create files
6464 for _, file := range testFiles {
6565 filePath := filepath.Join(tempDir, file)
66− err := os.WriteFile(filePath, []byte("test content"), 0644)
66+ err := os.WriteFile(filePath, []byte("test content"), 0o644)
6767 require.NoError(t, err)
6868 }
6969
@@ -83,19 +83,19 @@ func TestLsTool_Run(t *testing.T) {
8383
8484 response, err := tool.Run(context.Background(), call)
8585 require.NoError(t, err)
86−
86+
8787 // Check that visible directories and files are included
8888 assert.Contains(t, response.Content, "dir1")
8989 assert.Contains(t, response.Content, "dir2")
9090 assert.Contains(t, response.Content, "dir3")
9191 assert.Contains(t, response.Content, "file1.txt")
9292 assert.Contains(t, response.Content, "file2.txt")
93−
93+
9494 // Check that hidden files and directories are not included
9595 assert.NotContains(t, response.Content, ".hidden_dir")
9696 assert.NotContains(t, response.Content, ".hidden_file.txt")
9797 assert.NotContains(t, response.Content, ".hidden_root_file.txt")
98−
98+
9999 // Check that __pycache__ is not included
100100 assert.NotContains(t, response.Content, "__pycache__")
101101 })
@@ -122,7 +122,7 @@ func TestLsTool_Run(t *testing.T) {
122122 t.Run("handles empty path parameter", func(t *testing.T) {
123123 // For this test, we need to mock the config.WorkingDirectory function
124124 // Since we can't easily do that, we'll just check that the response doesn't contain an error message
125−
125+
126126 tool := NewLsTool()
127127 params := LSParams{
128128 Path: "",
@@ -138,7 +138,7 @@ func TestLsTool_Run(t *testing.T) {
138138
139139 response, err := tool.Run(context.Background(), call)
140140 require.NoError(t, err)
141−
141+
142142 // The response should either contain a valid directory listing or an error
143143 // We'll just check that it's not empty
144144 assert.NotEmpty(t, response.Content)
@@ -173,11 +173,11 @@ func TestLsTool_Run(t *testing.T) {
173173
174174 response, err := tool.Run(context.Background(), call)
175175 require.NoError(t, err)
176−
176+
177177 // The output format is a tree, so we need to check for specific patterns
178178 // Check that file1.txt is not directly mentioned
179179 assert.NotContains(t, response.Content, "- file1.txt")
180−
180+
181181 // Check that dir1/ is not directly mentioned
182182 assert.NotContains(t, response.Content, "- dir1/")
183183 })
@@ -189,12 +189,12 @@ func TestLsTool_Run(t *testing.T) {
189189 defer func() {
190190 os.Chdir(origWd)
191191 }()
192−
192+
193193 // Change to a directory above the temp directory
194194 parentDir := filepath.Dir(tempDir)
195195 err = os.Chdir(parentDir)
196196 require.NoError(t, err)
197−
197+
198198 tool := NewLsTool()
199199 params := LSParams{
200200 Path: filepath.Base(tempDir),
@@ -210,7 +210,7 @@ func TestLsTool_Run(t *testing.T) {
210210
211211 response, err := tool.Run(context.Background(), call)
212212 require.NoError(t, err)
213−
213+
214214 // Should list the temp directory contents
215215 assert.Contains(t, response.Content, "dir1")
216216 assert.Contains(t, response.Content, "file1.txt")
@@ -291,22 +291,22 @@ func TestCreateFileTree(t *testing.T) {
291291 }
292292
293293 tree := createFileTree(paths)
294−
294+
295295 // Check the structure of the tree
296296 assert.Len(t, tree, 1) // Should have one root node
297−
297+
298298 // Check the root node
299299 rootNode := tree[0]
300300 assert.Equal(t, "path", rootNode.Name)
301301 assert.Equal(t, "directory", rootNode.Type)
302302 assert.Len(t, rootNode.Children, 1)
303−
303+
304304 // Check the "to" node
305305 toNode := rootNode.Children[0]
306306 assert.Equal(t, "to", toNode.Name)
307307 assert.Equal(t, "directory", toNode.Type)
308308 assert.Len(t, toNode.Children, 3) // file1.txt, dir1, dir2
309−
309+
310310 // Find the dir1 node
311311 var dir1Node *TreeNode
312312 for _, child := range toNode.Children {
@@ -315,7 +315,7 @@ func TestCreateFileTree(t *testing.T) {
315315 break
316316 }
317317 }
318−
318+
319319 require.NotNil(t, dir1Node)
320320 assert.Equal(t, "directory", dir1Node.Type)
321321 assert.Len(t, dir1Node.Children, 2) // file2.txt and subdir
@@ -354,9 +354,9 @@ func TestPrintTree(t *testing.T) {
354354 Type: "file",
355355 },
356356 }
357−
357+
358358 result := printTree(tree, "/root")
359−
359+
360360 // Check the output format
361361 assert.Contains(t, result, "- /root/")
362362 assert.Contains(t, result, " - dir1/")
@@ -390,14 +390,14 @@ func TestListDirectory(t *testing.T) {
390390 // Create directories
391391 for _, dir := range testDirs {
392392 dirPath := filepath.Join(tempDir, dir)
393− err := os.MkdirAll(dirPath, 0755)
393+ err := os.MkdirAll(dirPath, 0o755)
394394 require.NoError(t, err)
395395 }
396396
397397 // Create files
398398 for _, file := range testFiles {
399399 filePath := filepath.Join(tempDir, file)
400− err := os.WriteFile(filePath, []byte("test content"), 0644)
400+ err := os.WriteFile(filePath, []byte("test content"), 0o644)
401401 require.NoError(t, err)
402402 }
403403
@@ -405,7 +405,7 @@ func TestListDirectory(t *testing.T) {
405405 files, truncated, err := listDirectory(tempDir, []string{}, 1000)
406406 require.NoError(t, err)
407407 assert.False(t, truncated)
408−
408+
409409 // Check that visible files and directories are included
410410 containsPath := func(paths []string, target string) bool {
411411 targetPath := filepath.Join(tempDir, target)
@@ -416,12 +416,12 @@ func TestListDirectory(t *testing.T) {
416416 }
417417 return false
418418 }
419−
419+
420420 assert.True(t, containsPath(files, "dir1"))
421421 assert.True(t, containsPath(files, "file1.txt"))
422422 assert.True(t, containsPath(files, "file2.txt"))
423423 assert.True(t, containsPath(files, "dir1/file3.txt"))
424−
424+
425425 // Check that hidden files and directories are not included
426426 assert.False(t, containsPath(files, ".hidden_dir"))
427427 assert.False(t, containsPath(files, ".hidden_file.txt"))
@@ -438,12 +438,12 @@ func TestListDirectory(t *testing.T) {
438438 files, truncated, err := listDirectory(tempDir, []string{"*.txt"}, 1000)
439439 require.NoError(t, err)
440440 assert.False(t, truncated)
441−
441+
442442 // Check that no .txt files are included
443443 for _, file := range files {
444444 assert.False(t, strings.HasSuffix(file, ".txt"), "Found .txt file: %s", file)
445445 }
446−
446+
447447 // But directories should still be included
448448 containsDir := false
449449 for _, file := range files {
@@ -454,4 +454,4 @@ func TestListDirectory(t *testing.T) {
454454 }
455455 assert.True(t, containsDir)
456456 })
457−}
457+}
internal/llm/tools/shell/shell.go+4−4
@@ -61,23 +61,23 @@ func GetPersistentShell(workingDir string) *PersistentShell {
6161func newPersistentShell(cwd string) *PersistentShell {
6262 // Get shell configuration from config
6363 cfg := config.Get()
64−
64+
6565 // Default to environment variable if config is not set or nil
6666 var shellPath string
6767 var shellArgs []string
68−
68+
6969 if cfg != nil {
7070 shellPath = cfg.Shell.Path
7171 shellArgs = cfg.Shell.Args
7272 }
73−
73+
7474 if shellPath == "" {
7575 shellPath = os.Getenv("SHELL")
7676 if shellPath == "" {
7777 shellPath = "/bin/bash"
7878 }
7979 }
80−
80+
8181 // Default shell args
8282 if len(shellArgs) == 0 {
8383 shellArgs = []string{"-l"}
internal/tui/components/dialog/custom_commands.go+1−2
@@ -82,7 +82,7 @@ func loadCommandsFromDir(commandsDir string, prefix string) ([]Command, error) {
8282 // Check if the commands directory exists
8383 if _, err := os.Stat(commandsDir); os.IsNotExist(err) {
8484 // Create the commands directory if it doesn't exist
85− if err := os.MkdirAll(commandsDir, 0755); err != nil {
85+ if err := os.MkdirAll(commandsDir, 0o755); err != nil {
8686 return nil, fmt.Errorf("failed to create commands directory %s: %w", commandsDir, err)
8787 }
8888 // Return empty list since we just created the directory
@@ -171,7 +171,6 @@ func loadCommandsFromDir(commandsDir string, prefix string) ([]Command, error) {
171171 commands = append(commands, command)
172172 return nil
173173 })
174−
175174 if err != nil {
176175 return nil, fmt.Errorf("failed to load custom commands from %s: %w", commandsDir, err)
177176 }
internal/tui/components/dialog/custom_commands_test.go+10−10
@@ -1,8 +1,8 @@
11package dialog
22
33import (
4− "testing"
54 "regexp"
5+ "testing"
66)
77
88func TestNamedArgPattern(t *testing.T) {
@@ -38,11 +38,11 @@ func TestNamedArgPattern(t *testing.T) {
3838
3939 for _, tc := range testCases {
4040 matches := namedArgPattern.FindAllStringSubmatch(tc.input, -1)
41−
41+
4242 // Extract unique argument names
4343 argNames := make([]string, 0)
4444 argMap := make(map[string]bool)
45−
45+
4646 for _, match := range matches {
4747 argName := match[1] // Group 1 is the name without $
4848 if !argMap[argName] {
@@ -50,13 +50,13 @@ func TestNamedArgPattern(t *testing.T) {
5050 argNames = append(argNames, argName)
5151 }
5252 }
53−
53+
5454 // Check if we got the expected number of arguments
5555 if len(argNames) != len(tc.expected) {
5656 t.Errorf("Expected %d arguments, got %d for input: %s", len(tc.expected), len(argNames), tc.input)
5757 continue
5858 }
59−
59+
6060 // Check if we got the expected argument names
6161 for _, expectedArg := range tc.expected {
6262 found := false
@@ -75,7 +75,7 @@ func TestNamedArgPattern(t *testing.T) {
7575
7676func TestRegexPattern(t *testing.T) {
7777 pattern := regexp.MustCompile(`\$([A-Z][A-Z0-9_]*)`)
78−
78+
7979 validMatches := []string{
8080 "$FOO",
8181 "$BAR",
@@ -83,7 +83,7 @@ func TestRegexPattern(t *testing.T) {
8383 "$BAZ123",
8484 "$ARGUMENTS",
8585 }
86−
86+
8787 invalidMatches := []string{
8888 "$foo",
8989 "$1BAR",
@@ -91,16 +91,16 @@ func TestRegexPattern(t *testing.T) {
9191 "FOO",
9292 "$",
9393 }
94−
94+
9595 for _, valid := range validMatches {
9696 if !pattern.MatchString(valid) {
9797 t.Errorf("Expected %s to match, but it didn't", valid)
9898 }
9999 }
100−
100+
101101 for _, invalid := range invalidMatches {
102102 if pattern.MatchString(invalid) {
103103 t.Errorf("Expected %s not to match, but it did", invalid)
104104 }
105105 }
106−}
106+}
internal/tui/theme/dracula.go+1−1
@@ -103,4 +103,4 @@ func NewDraculaTheme() *DraculaTheme {
103103func init() {
104104 // Register the Dracula theme with the theme manager
105105 RegisterTheme("dracula", NewDraculaTheme())
106−}
106+}
internal/tui/theme/flexoki.go+35−35
@@ -7,20 +7,20 @@ import (
77// Flexoki color palette constants
88const (
99 // Base colors
10− flexokiPaper = "#FFFCF0" // Paper (lightest)
11− flexokiBase50 = "#F2F0E5" // bg-2 (light)
12− flexokiBase100 = "#E6E4D9" // ui (light)
13− flexokiBase150 = "#DAD8CE" // ui-2 (light)
14− flexokiBase200 = "#CECDC3" // ui-3 (light)
15− flexokiBase300 = "#B7B5AC" // tx-3 (light)
16− flexokiBase500 = "#878580" // tx-2 (light)
17− flexokiBase600 = "#6F6E69" // tx (light)
18− flexokiBase700 = "#575653" // tx-3 (dark)
19− flexokiBase800 = "#403E3C" // ui-3 (dark)
20− flexokiBase850 = "#343331" // ui-2 (dark)
21− flexokiBase900 = "#282726" // ui (dark)
22− flexokiBase950 = "#1C1B1A" // bg-2 (dark)
23− flexokiBlack = "#100F0F" // bg (darkest)
10+ flexokiPaper = "#FFFCF0" // Paper (lightest)
11+ flexokiBase50 = "#F2F0E5" // bg-2 (light)
12+ flexokiBase100 = "#E6E4D9" // ui (light)
13+ flexokiBase150 = "#DAD8CE" // ui-2 (light)
14+ flexokiBase200 = "#CECDC3" // ui-3 (light)
15+ flexokiBase300 = "#B7B5AC" // tx-3 (light)
16+ flexokiBase500 = "#878580" // tx-2 (light)
17+ flexokiBase600 = "#6F6E69" // tx (light)
18+ flexokiBase700 = "#575653" // tx-3 (dark)
19+ flexokiBase800 = "#403E3C" // ui-3 (dark)
20+ flexokiBase850 = "#343331" // ui-2 (dark)
21+ flexokiBase900 = "#282726" // ui (dark)
22+ flexokiBase950 = "#1C1B1A" // bg-2 (dark)
23+ flexokiBlack = "#100F0F" // bg (darkest)
2424
2525 // Accent colors - Light theme (600)
2626 flexokiRed600 = "#AF3029"
@@ -86,11 +86,11 @@ func NewFlexokiDarkTheme() *FlexokiTheme {
8686 theme.DiffHunkHeaderColor = lipgloss.Color(flexokiBase700)
8787 theme.DiffHighlightAddedColor = lipgloss.Color(flexokiGreen400)
8888 theme.DiffHighlightRemovedColor = lipgloss.Color(flexokiRed400)
89− theme.DiffAddedBgColor = lipgloss.Color("#1D2419") // Darker green background
89+ theme.DiffAddedBgColor = lipgloss.Color("#1D2419") // Darker green background
9090 theme.DiffRemovedBgColor = lipgloss.Color("#241919") // Darker red background
9191 theme.DiffContextBgColor = lipgloss.Color(flexokiBlack)
9292 theme.DiffLineNumberColor = lipgloss.Color(flexokiBase700)
93− theme.DiffAddedLineNumberBgColor = lipgloss.Color("#1A2017") // Slightly darker green
93+ theme.DiffAddedLineNumberBgColor = lipgloss.Color("#1A2017") // Slightly darker green
9494 theme.DiffRemovedLineNumberBgColor = lipgloss.Color("#201717") // Slightly darker red
9595
9696 // Markdown colors
@@ -110,14 +110,14 @@ func NewFlexokiDarkTheme() *FlexokiTheme {
110110 theme.MarkdownCodeBlockColor = lipgloss.Color(flexokiBase300)
111111
112112 // Syntax highlighting colors (based on Flexoki's mappings)
113− theme.SyntaxCommentColor = lipgloss.Color(flexokiBase700) // tx-3
114− theme.SyntaxKeywordColor = lipgloss.Color(flexokiGreen400) // gr
115− theme.SyntaxFunctionColor = lipgloss.Color(flexokiOrange400) // or
116− theme.SyntaxVariableColor = lipgloss.Color(flexokiBlue400) // bl
117− theme.SyntaxStringColor = lipgloss.Color(flexokiCyan400) // cy
118− theme.SyntaxNumberColor = lipgloss.Color(flexokiPurple400) // pu
119− theme.SyntaxTypeColor = lipgloss.Color(flexokiYellow400) // ye
120− theme.SyntaxOperatorColor = lipgloss.Color(flexokiBase500) // tx-2
113+ theme.SyntaxCommentColor = lipgloss.Color(flexokiBase700) // tx-3
114+ theme.SyntaxKeywordColor = lipgloss.Color(flexokiGreen400) // gr
115+ theme.SyntaxFunctionColor = lipgloss.Color(flexokiOrange400) // or
116+ theme.SyntaxVariableColor = lipgloss.Color(flexokiBlue400) // bl
117+ theme.SyntaxStringColor = lipgloss.Color(flexokiCyan400) // cy
118+ theme.SyntaxNumberColor = lipgloss.Color(flexokiPurple400) // pu
119+ theme.SyntaxTypeColor = lipgloss.Color(flexokiYellow400) // ye
120+ theme.SyntaxOperatorColor = lipgloss.Color(flexokiBase500) // tx-2
121121 theme.SyntaxPunctuationColor = lipgloss.Color(flexokiBase500) // tx-2
122122
123123 return theme
@@ -160,11 +160,11 @@ func NewFlexokiLightTheme() *FlexokiTheme {
160160 theme.DiffHunkHeaderColor = lipgloss.Color(flexokiBase500)
161161 theme.DiffHighlightAddedColor = lipgloss.Color(flexokiGreen600)
162162 theme.DiffHighlightRemovedColor = lipgloss.Color(flexokiRed600)
163− theme.DiffAddedBgColor = lipgloss.Color("#EFF2E2") // Light green background
163+ theme.DiffAddedBgColor = lipgloss.Color("#EFF2E2") // Light green background
164164 theme.DiffRemovedBgColor = lipgloss.Color("#F2E2E2") // Light red background
165165 theme.DiffContextBgColor = lipgloss.Color(flexokiPaper)
166166 theme.DiffLineNumberColor = lipgloss.Color(flexokiBase500)
167− theme.DiffAddedLineNumberBgColor = lipgloss.Color("#E5EBD9") // Light green
167+ theme.DiffAddedLineNumberBgColor = lipgloss.Color("#E5EBD9") // Light green
168168 theme.DiffRemovedLineNumberBgColor = lipgloss.Color("#EBD9D9") // Light red
169169
170170 // Markdown colors
@@ -184,14 +184,14 @@ func NewFlexokiLightTheme() *FlexokiTheme {
184184 theme.MarkdownCodeBlockColor = lipgloss.Color(flexokiBase600)
185185
186186 // Syntax highlighting colors (based on Flexoki's mappings)
187− theme.SyntaxCommentColor = lipgloss.Color(flexokiBase300) // tx-3
188− theme.SyntaxKeywordColor = lipgloss.Color(flexokiGreen600) // gr
189− theme.SyntaxFunctionColor = lipgloss.Color(flexokiOrange600) // or
190− theme.SyntaxVariableColor = lipgloss.Color(flexokiBlue600) // bl
191− theme.SyntaxStringColor = lipgloss.Color(flexokiCyan600) // cy
192− theme.SyntaxNumberColor = lipgloss.Color(flexokiPurple600) // pu
193− theme.SyntaxTypeColor = lipgloss.Color(flexokiYellow600) // ye
194− theme.SyntaxOperatorColor = lipgloss.Color(flexokiBase500) // tx-2
187+ theme.SyntaxCommentColor = lipgloss.Color(flexokiBase300) // tx-3
188+ theme.SyntaxKeywordColor = lipgloss.Color(flexokiGreen600) // gr
189+ theme.SyntaxFunctionColor = lipgloss.Color(flexokiOrange600) // or
190+ theme.SyntaxVariableColor = lipgloss.Color(flexokiBlue600) // bl
191+ theme.SyntaxStringColor = lipgloss.Color(flexokiCyan600) // cy
192+ theme.SyntaxNumberColor = lipgloss.Color(flexokiPurple600) // pu
193+ theme.SyntaxTypeColor = lipgloss.Color(flexokiYellow600) // ye
194+ theme.SyntaxOperatorColor = lipgloss.Color(flexokiBase500) // tx-2
195195 theme.SyntaxPunctuationColor = lipgloss.Color(flexokiBase500) // tx-2
196196
197197 return theme
@@ -201,4 +201,4 @@ func init() {
201201 // Register the Flexoki themes with the theme manager
202202 RegisterTheme("flexoki-dark", NewFlexokiDarkTheme())
203203 RegisterTheme("flexoki-light", NewFlexokiLightTheme())
204−}
204+}
internal/tui/theme/gruvbox.go+6−6
@@ -106,12 +106,12 @@ func NewGruvboxTheme() *GruvboxTheme {
106106 theme.DiffHunkHeaderColor = lipgloss.Color(gruvboxDarkFg3)
107107 theme.DiffHighlightAddedColor = lipgloss.Color(gruvboxDarkGreenBright)
108108 theme.DiffHighlightRemovedColor = lipgloss.Color(gruvboxDarkRedBright)
109− theme.DiffAddedBgColor = lipgloss.Color("#3C4C3C") // Darker green background
110− theme.DiffRemovedBgColor = lipgloss.Color("#4C3C3C") // Darker red background
109+ theme.DiffAddedBgColor = lipgloss.Color("#3C4C3C") // Darker green background
110+ theme.DiffRemovedBgColor = lipgloss.Color("#4C3C3C") // Darker red background
111111 theme.DiffContextBgColor = lipgloss.Color(gruvboxDarkBg0)
112112 theme.DiffLineNumberColor = lipgloss.Color(gruvboxDarkFg4)
113113 theme.DiffAddedLineNumberBgColor = lipgloss.Color("#32432F") // Slightly darker green
114− theme.DiffRemovedLineNumberBgColor = lipgloss.Color("#43322F") // Slightly darker red
114+ theme.DiffRemovedLineNumberBgColor = lipgloss.Color("#43322F") // Slightly darker red
115115
116116 // Markdown colors
117117 theme.MarkdownTextColor = lipgloss.Color(gruvboxDarkFg1)
@@ -180,11 +180,11 @@ func NewGruvboxLightTheme() *GruvboxTheme {
180180 theme.DiffHunkHeaderColor = lipgloss.Color(gruvboxLightFg3)
181181 theme.DiffHighlightAddedColor = lipgloss.Color(gruvboxLightGreenBright)
182182 theme.DiffHighlightRemovedColor = lipgloss.Color(gruvboxLightRedBright)
183− theme.DiffAddedBgColor = lipgloss.Color("#E8F5E9") // Light green background
183+ theme.DiffAddedBgColor = lipgloss.Color("#E8F5E9") // Light green background
184184 theme.DiffRemovedBgColor = lipgloss.Color("#FFEBEE") // Light red background
185185 theme.DiffContextBgColor = lipgloss.Color(gruvboxLightBg0)
186186 theme.DiffLineNumberColor = lipgloss.Color(gruvboxLightFg4)
187− theme.DiffAddedLineNumberBgColor = lipgloss.Color("#C8E6C9") // Light green
187+ theme.DiffAddedLineNumberBgColor = lipgloss.Color("#C8E6C9") // Light green
188188 theme.DiffRemovedLineNumberBgColor = lipgloss.Color("#FFCDD2") // Light red
189189
190190 // Markdown colors
@@ -221,4 +221,4 @@ func init() {
221221 // Register the Gruvbox themes with the theme manager
222222 RegisterTheme("gruvbox", NewGruvboxTheme())
223223 RegisterTheme("gruvbox-light", NewGruvboxLightTheme())
224−}
224+}
internal/tui/theme/monokai.go+1−1
@@ -192,4 +192,4 @@ func init() {
192192 // Register the Monokai Pro themes with the theme manager
193193 RegisterTheme("monokai", NewMonokaiProTheme())
194194 RegisterTheme("monokai-light", NewMonokaiProLightTheme())
195−}
195+}
internal/tui/theme/onedark.go+1−1
@@ -193,4 +193,4 @@ func init() {
193193 // Register the One Dark and One Light themes with the theme manager
194194 RegisterTheme("onedark", NewOneDarkTheme())
195195 RegisterTheme("onelight", NewOneLightTheme())
196−}
196+}
internal/tui/theme/theme_test.go+16−16
@@ -7,7 +7,7 @@ import (
77func TestThemeRegistration(t *testing.T) {
88 // Get list of available themes
99 availableThemes := AvailableThemes()
10−
10+
1111 // Check if "catppuccin" theme is registered
1212 catppuccinFound := false
1313 for _, themeName := range availableThemes {
@@ -16,11 +16,11 @@ func TestThemeRegistration(t *testing.T) {
1616 break
1717 }
1818 }
19−
19+
2020 if !catppuccinFound {
2121 t.Errorf("Catppuccin theme is not registered")
2222 }
23−
23+
2424 // Check if "gruvbox" theme is registered
2525 gruvboxFound := false
2626 for _, themeName := range availableThemes {
@@ -29,11 +29,11 @@ func TestThemeRegistration(t *testing.T) {
2929 break
3030 }
3131 }
32−
32+
3333 if !gruvboxFound {
3434 t.Errorf("Gruvbox theme is not registered")
3535 }
36−
36+
3737 // Check if "monokai" theme is registered
3838 monokaiFound := false
3939 for _, themeName := range availableThemes {
@@ -42,48 +42,48 @@ func TestThemeRegistration(t *testing.T) {
4242 break
4343 }
4444 }
45−
45+
4646 if !monokaiFound {
4747 t.Errorf("Monokai theme is not registered")
4848 }
49−
49+
5050 // Try to get the themes and make sure they're not nil
5151 catppuccin := GetTheme("catppuccin")
5252 if catppuccin == nil {
5353 t.Errorf("Catppuccin theme is nil")
5454 }
55−
55+
5656 gruvbox := GetTheme("gruvbox")
5757 if gruvbox == nil {
5858 t.Errorf("Gruvbox theme is nil")
5959 }
60−
60+
6161 monokai := GetTheme("monokai")
6262 if monokai == nil {
6363 t.Errorf("Monokai theme is nil")
6464 }
65−
65+
6666 // Test switching theme
6767 originalTheme := CurrentThemeName()
68−
68+
6969 err := SetTheme("gruvbox")
7070 if err != nil {
7171 t.Errorf("Failed to set theme to gruvbox: %v", err)
7272 }
73−
73+
7474 if CurrentThemeName() != "gruvbox" {
7575 t.Errorf("Theme not properly switched to gruvbox")
7676 }
77−
77+
7878 err = SetTheme("monokai")
7979 if err != nil {
8080 t.Errorf("Failed to set theme to monokai: %v", err)
8181 }
82−
82+
8383 if CurrentThemeName() != "monokai" {
8484 t.Errorf("Theme not properly switched to monokai")
8585 }
86−
86+
8787 // Switch back to original theme
8888 _ = SetTheme(originalTheme)
89−}
89+}
internal/tui/theme/tokyonight.go+6−6
@@ -57,11 +57,11 @@ func NewTokyoNightTheme() *TokyoNightTheme {
5757 theme.BorderDimColor = lipgloss.Color(darkSelection)
5858
5959 // Diff view colors
60− theme.DiffAddedColor = lipgloss.Color("#4fd6be") // teal from palette
61− theme.DiffRemovedColor = lipgloss.Color("#c53b53") // red1 from palette
62− theme.DiffContextColor = lipgloss.Color("#828bb8") // fg_dark from palette
63− theme.DiffHunkHeaderColor = lipgloss.Color("#828bb8") // fg_dark from palette
64− theme.DiffHighlightAddedColor = lipgloss.Color("#b8db87") // git.add from palette
60+ theme.DiffAddedColor = lipgloss.Color("#4fd6be") // teal from palette
61+ theme.DiffRemovedColor = lipgloss.Color("#c53b53") // red1 from palette
62+ theme.DiffContextColor = lipgloss.Color("#828bb8") // fg_dark from palette
63+ theme.DiffHunkHeaderColor = lipgloss.Color("#828bb8") // fg_dark from palette
64+ theme.DiffHighlightAddedColor = lipgloss.Color("#b8db87") // git.add from palette
6565 theme.DiffHighlightRemovedColor = lipgloss.Color("#e26a75") // git.delete from palette
6666 theme.DiffAddedBgColor = lipgloss.Color("#20303b")
6767 theme.DiffRemovedBgColor = lipgloss.Color("#37222c")
@@ -193,4 +193,4 @@ func init() {
193193 // Register the Tokyo Night themes with the theme manager
194194 RegisterTheme("tokyonight", NewTokyoNightTheme())
195195 RegisterTheme("tokyonight-day", NewTokyoNightDayTheme())
196−}
196+}
internal/tui/theme/tron.go+1−1
@@ -195,4 +195,4 @@ func init() {
195195 // Register the Tron themes with the theme manager
196196 RegisterTheme("tron", NewTronTheme())
197197 RegisterTheme("tron-light", NewTronLightTheme())
198−}
198+}