gui: Trae CN's plugin shows Trae's logo (owner: trae cn plugin 没有 logo) — the registry gives it the icon "trae", which magpie didn't have, so its tile and provider row had none. Adds lobe-icons' mono TRAE mark as icons/trae.svg (taking the text colour, as qoder's does). TestMarketIconsAreBundled checks every icon the built-in list, the older plugins and the registry name is among the GUI's pictures; it fails without trae.svg. Seen on the Plugins page of a sandbox built from this tree. go vet, builds (darwin, GOOS=linux -tags nogui, GOOS=windows) and go test -tags nogui ./internal/plugin ./internal/gui pass.

This commit is contained in:
yetone
2026-10-03 17:47:07 +08:00
parent 33e59f93da
commit ac1a8a4f85
2 changed files with 40 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>TRAE</title><path d="M24 20.541H3.428v-3.426H0V3.4h24V20.54zM3.428 17.115h17.144V6.827H3.428v10.288zm8.573-5.196l-2.425 2.424-2.424-2.424 2.424-2.424 2.425 2.424zm6.857-.001l-2.424 2.423-2.425-2.423 2.425-2.425 2.424 2.425z"></path></svg>

After

Width:  |  Height:  |  Size: 402 B

+39
View File
@@ -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)
}
}
}