diff --git a/internal/gui/assets/icons/trae.svg b/internal/gui/assets/icons/trae.svg new file mode 100644 index 000000000..8f42e96f1 --- /dev/null +++ b/internal/gui/assets/icons/trae.svg @@ -0,0 +1 @@ +TRAE \ No newline at end of file diff --git a/internal/plugin/market_icons_test.go b/internal/plugin/market_icons_test.go new file mode 100644 index 000000000..330253f3b --- /dev/null +++ b/internal/plugin/market_icons_test.go @@ -0,0 +1,39 @@ +package plugin + +import ( + "os" + "path/filepath" + "testing" +) + +// Every icon a listing or an older plugin names is a picture the GUI has: +// one it lacks shows the plugin's provider with no logo at all (Trae CN's +// "trae" did). +func TestMarketIconsAreBundled(t *testing.T) { + l, err := parseMarket(builtinMarket) + if err != nil { + t.Fatal(err) + } + names := map[string]string{} + for _, x := range l { + names[x.Icon] = x.Package + } + for k, ic := range otherIcons { + names[ic] = k + } + extra := []string{"trae"} // the registry's, past the built-in list + for _, ic := range extra { + names[ic] = "registry" + } + for ic, from := range names { + found := false + for _, ext := range []string{".svg", ".png"} { + if _, err := os.Stat(filepath.Join("..", "gui", "assets", "icons", ic+ext)); err == nil { + found = true + } + } + if !found { + t.Errorf("%s: icon %q isn't in internal/gui/assets/icons", from, ic) + } + } +}