fix(theming): restore gruvbox as default via Default() helper

This commit is contained in:
MDietermann
2026-04-14 13:42:58 +02:00
parent 4f7411ca95
commit 698271a235
6 changed files with 28 additions and 14 deletions

View File

@@ -97,6 +97,21 @@ func List() []Theme {
return out
}
// Default returns the archduino default theme. Used by the wizard's fresh-
// install default and by callers that resolve an unknown theme ID.
// The identity here is stable policy: gruvbox is the project's long-standing
// default (carried over from the pre-Go installer). Changing this changes
// the out-of-box experience on fresh systems.
func Default() Theme {
if t, ok := Get("gruvbox"); ok {
return t
}
if len(discovered) > 0 {
return discovered[0]
}
return Theme{ID: "gruvbox", DisplayName: "Gruvbox Dark", NvChadTheme: "gruvbox"}
}
// Get returns the theme with the given ID, if present.
func Get(id string) (Theme, bool) {
for _, t := range discovered {

View File

@@ -192,3 +192,9 @@ func TestApplyEachThemeWritesStarship(t *testing.T) {
})
}
}
func TestDefaultIsGruvbox(t *testing.T) {
if got := Default(); got.ID != "gruvbox" {
t.Fatalf("Default().ID = %q, want gruvbox", got.ID)
}
}