detached c0c90a2

feat(config): add theme.palette toggle (default on)

commit
c0c90a29cbbb7045dcd0f0b642f79a85bba50b4b
author
brice · · 2026-07-17 08:08 UTC
parent
c646480
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
3 files · +65 -1
M internal/adapters/config/config.go +7 -0
@@ -68,6 +68,13 @@ func Parse(r io.Reader) (domain.Config, []domain.Warning, error) {
6868 continue
6969 }
7070 cfg.Theme = mode
71+ case key == "theme.palette":
72+ on, ok := parseOnOff(value)
73+ if !ok {
74+ warnings = append(warnings, domain.Warning{Line: lineNo, Msg: fmt.Sprintf("invalid theme.palette %q", value)})
75+ continue
76+ }
77+ cfg.ThemePalette = on
7178 case key == "bar.top-right":
7279 command, ok := parseBarCommand(value)
7380 if !ok {
@@ -68,6 +68,13 @@ func Parse(r io.Reader) (domain.Config, []domain.Warning, error) {
68 continue68 continue
69 }69 }
70 cfg.Theme = mode70 cfg.Theme = mode
71+ case key == "theme.palette":
72+ on, ok := parseOnOff(value)
73+ if !ok {
74+ warnings = append(warnings, domain.Warning{Line: lineNo, Msg: fmt.Sprintf("invalid theme.palette %q", value)})
75+ continue
76+ }
77+ cfg.ThemePalette = on
71 case key == "bar.top-right":78 case key == "bar.top-right":
72 command, ok := parseBarCommand(value)79 command, ok := parseBarCommand(value)
73 if !ok {80 if !ok {
M internal/adapters/config/config_test.go +55 -0
@@ -332,6 +332,9 @@ func TestParse(t *testing.T) {
332332 t.Run(tt.name, func(t *testing.T) {
333333 t.Parallel()
334334
335+ if !tt.want.ThemePalette {
336+ tt.want.ThemePalette = domain.Defaults().ThemePalette
337+ }
335338 if tt.want.Bar.Interval == 0 {
336339 tt.want.Bar = domain.Defaults().Bar
337340 }
@@ -364,6 +367,58 @@ func TestParse(t *testing.T) {
364367 }
365368 }
366369
370+func TestParseThemePalette(t *testing.T) {
371+ t.Parallel()
372+
373+ tests := []struct {
374+ name string
375+ input string
376+ want bool
377+ wantWarnings []domain.Warning
378+ }{
379+ {
380+ name: "on enables terminal palette inheritance",
381+ input: "theme.palette = on\n",
382+ want: true,
383+ },
384+ {
385+ name: "off disables terminal palette inheritance",
386+ input: "theme.palette = off\n",
387+ want: false,
388+ },
389+ {
390+ name: "invalid value warns once and keeps default",
391+ input: "theme.palette = maybe\n",
392+ want: true,
393+ wantWarnings: []domain.Warning{
394+ {Line: 1, Msg: "invalid theme.palette \"maybe\""},
395+ },
396+ },
397+ {
398+ name: "absent key keeps default",
399+ input: "theme = dark\n",
400+ want: true,
401+ },
402+ }
403+
404+ for _, tt := range tests {
405+ t.Run(tt.name, func(t *testing.T) {
406+ t.Parallel()
407+
408+ got, warnings, err := Parse(strings.NewReader(tt.input))
409+ require.NoError(t, err)
410+ require.Equal(t, tt.want, got.ThemePalette)
411+ require.Equal(t, tt.wantWarnings, warnings)
412+ })
413+ }
414+}
415+
416+func TestDefaultsThemePalette(t *testing.T) {
417+ t.Parallel()
418+
419+ require.True(t, domain.Defaults().ThemePalette)
420+}
421+
367422 func TestParseTabsTerminalTitle(t *testing.T) {
368423 t.Parallel()
369424
@@ -332,6 +332,9 @@ func TestParse(t *testing.T) {
332 t.Run(tt.name, func(t *testing.T) {332 t.Run(tt.name, func(t *testing.T) {
333 t.Parallel()333 t.Parallel()
334 334
335+ if !tt.want.ThemePalette {
336+ tt.want.ThemePalette = domain.Defaults().ThemePalette
337+ }
335 if tt.want.Bar.Interval == 0 {338 if tt.want.Bar.Interval == 0 {
336 tt.want.Bar = domain.Defaults().Bar339 tt.want.Bar = domain.Defaults().Bar
337 }340 }
@@ -364,6 +367,58 @@ func TestParse(t *testing.T) {
364 }367 }
365 }368 }
366 369
370+func TestParseThemePalette(t *testing.T) {
371+ t.Parallel()
372+
373+ tests := []struct {
374+ name string
375+ input string
376+ want bool
377+ wantWarnings []domain.Warning
378+ }{
379+ {
380+ name: "on enables terminal palette inheritance",
381+ input: "theme.palette = on\n",
382+ want: true,
383+ },
384+ {
385+ name: "off disables terminal palette inheritance",
386+ input: "theme.palette = off\n",
387+ want: false,
388+ },
389+ {
390+ name: "invalid value warns once and keeps default",
391+ input: "theme.palette = maybe\n",
392+ want: true,
393+ wantWarnings: []domain.Warning{
394+ {Line: 1, Msg: "invalid theme.palette \"maybe\""},
395+ },
396+ },
397+ {
398+ name: "absent key keeps default",
399+ input: "theme = dark\n",
400+ want: true,
401+ },
402+ }
403+
404+ for _, tt := range tests {
405+ t.Run(tt.name, func(t *testing.T) {
406+ t.Parallel()
407+
408+ got, warnings, err := Parse(strings.NewReader(tt.input))
409+ require.NoError(t, err)
410+ require.Equal(t, tt.want, got.ThemePalette)
411+ require.Equal(t, tt.wantWarnings, warnings)
412+ })
413+ }
414+}
415+
416+func TestDefaultsThemePalette(t *testing.T) {
417+ t.Parallel()
418+
419+ require.True(t, domain.Defaults().ThemePalette)
420+}
421+
367 func TestParseTabsTerminalTitle(t *testing.T) {422 func TestParseTabsTerminalTitle(t *testing.T) {
368 t.Parallel()423 t.Parallel()
369 424
M internal/domain/config.go +3 -1
@@ -81,6 +81,7 @@ type TabsConfig struct {
8181 // layer can decide which actions it understands.
8282 type Config struct {
8383 Theme ThemeMode
84+ ThemePalette bool
8485 Bar BarConfig
8586 BindingEntries []ConfigEntry
8687 Codes map[string]string
@@ -101,7 +102,8 @@ type Warning struct {
101102 // Defaults returns vev's default configuration.
102103 func Defaults() Config {
103104 return Config{
104- Theme: ThemeAuto,
105+ Theme: ThemeAuto,
106+ ThemePalette: true,
105107 Bar: BarConfig{
106108 TopRight: "vev-bar-top-right",
107109 BottomRight: "vev-bar-bottom-right",
@@ -81,6 +81,7 @@ type TabsConfig struct {
81 // layer can decide which actions it understands.81 // layer can decide which actions it understands.
82 type Config struct {82 type Config struct {
83 Theme ThemeMode83 Theme ThemeMode
84+ ThemePalette bool
84 Bar BarConfig85 Bar BarConfig
85 BindingEntries []ConfigEntry86 BindingEntries []ConfigEntry
86 Codes map[string]string87 Codes map[string]string
@@ -101,7 +102,8 @@ type Warning struct {
101 // Defaults returns vev's default configuration.102 // Defaults returns vev's default configuration.
102 func Defaults() Config {103 func Defaults() Config {
103 return Config{104 return Config{
104- Theme: ThemeAuto,105+ Theme: ThemeAuto,
106+ ThemePalette: true,
105 Bar: BarConfig{107 Bar: BarConfig{
106 TopRight: "vev-bar-top-right",108 TopRight: "vev-bar-top-right",
107 BottomRight: "vev-bar-bottom-right",109 BottomRight: "vev-bar-bottom-right",

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 12

Tags 11

↑↓ moveenter openesc close