Commit Graph
1 Commits
Author SHA1 Message Date
yetone 766356cd3f plugins: a row's "Serves" chip names the providers the plugin registers (#3902)
The chip named only built-ins moved onto a plugin (provider.MovedOnto),
so a plugin magpie never shipped as a built-in, like
magpie-magicrew-auth signing in to letsmagic.cn and magicrew.ai, said
nothing about what it carries. /api/plugins now sends `serves`: the
names of the providers the plugin registers (plugin.Cached, which the
row's provider names already come from), once each, leaving out the
moved ones (a moved built-in's id is the plugin's provider id; the page
names it as the built-in). It is sent when the plugin has a moved
built-in or registers two or more providers: a lone provider is the
row's title already. No package.json field. The "in place of the
built-in" tooltip stays on a chip that names a moved built-in only.
plugins.js is 27 bytes smaller; no budget touched.

Analysis and the proposal by MYCF711 (mycf_711 on Discord) in #3902.

Run:
- go test ./internal/gui -count=1: ok (107s)
- TestPluginServesItsProviders red with servesBeside returning nil
  (three cases), green restored
- plugin-release.test.cjs (chromium + webkit, en + zh): 6/6; with
  origin/main's plugins.js 0/6
- plugin-*.test.cjs plugins-*.test.cjs i18n-keys.test.cjs: 661/664.
  The 3 reds are on main too: i18n-keys "a plugin's words are its own"
  (#3897) and plugin-card-update webkit en under load (#3079; 2 of 5
  red on origin/main's plugins.js too, load ~65)
- gofmt -l, go vet, GOOS=windows go vet, GOOS=linux go vet -tags nogui
  on internal/gui: clean
Not tried: a real install of magpie-magicrew-auth in the window.
2026-10-27 23:37:46 +08:00