From ac1a8a4f85678509d3c0b68e7ac2adbc7fc88f1d Mon Sep 17 00:00:00 2001 From: yetone Date: Sat, 3 Oct 2026 17:47:07 +0800 Subject: [PATCH] =?UTF-8?q?gui:=20Trae=20CN's=20plugin=20shows=20Trae's=20?= =?UTF-8?q?logo=20(owner:=20trae=20cn=20plugin=20=E6=B2=A1=E6=9C=89=20logo?= =?UTF-8?q?)=20=E2=80=94=20the=20registry=20gives=20it=20the=20icon=20"tra?= =?UTF-8?q?e",=20which=20magpie=20didn't=20have,=20so=20its=20tile=20and?= =?UTF-8?q?=20provider=20row=20had=20none.=20Adds=20lobe-icons'=20mono=20T?= =?UTF-8?q?RAE=20mark=20as=20icons/trae.svg=20(taking=20the=20text=20colou?= =?UTF-8?q?r,=20as=20qoder's=20does).=20TestMarketIconsAreBundled=20checks?= =?UTF-8?q?=20every=20icon=20the=20built-in=20list,=20the=20older=20plugin?= =?UTF-8?q?s=20and=20the=20registry=20name=20is=20among=20the=20GUI's=20pi?= =?UTF-8?q?ctures;=20it=20fails=20without=20trae.svg.=20Seen=20on=20the=20?= =?UTF-8?q?Plugins=20page=20of=20a=20sandbox=20built=20from=20this=20tree.?= =?UTF-8?q?=20go=20vet,=20builds=20(darwin,=20GOOS=3Dlinux=20-tags=20nogui?= =?UTF-8?q?,=20GOOS=3Dwindows)=20and=20go=20test=20-tags=20nogui=20./inter?= =?UTF-8?q?nal/plugin=20./internal/gui=20pass.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/gui/assets/icons/trae.svg | 1 + internal/plugin/market_icons_test.go | 39 ++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 internal/gui/assets/icons/trae.svg create mode 100644 internal/plugin/market_icons_test.go 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) + } + } +}