Commit Graph
4 Commits
Author SHA1 Message Date
yetone 277c911658 plugins: a plugin's Sign in asks which subscription, and Qoder CN is Qoder 中国版 in Chinese
小武 on Discord: "Qoder 只支持国际版 请添加 Qoder中国版", then "有Qoder CN
没有添加账号的入口". The Qoder plugin serves four subscriptions (qoder,
qoder-cn, qwenwork, qwenwork-enterprise), but the Plugins page's Sign in
on its card and on its Installed row always took the first one not signed
in, qoder.com. Qoder CN was never offered there. In the Add sheet it was
called "Qoder CN" in every language, so a search for 中国版 found nothing.

- plugins.js: with more than one subscription not signed in, Sign in opens
  the app's menu (openProtoMenu), headed "Sign in to which subscription"
  and listing each one by its Add-sheet name (subName). With one, it signs
  in to it directly, as before. The Installed row says "Sign in to
  another…" when more than one is left. The pm-sub lines and tips use the
  same names.
- app.js: the qoder-cn SUBS entry's name goes through t(). openProtoMenu
  passes the click event to a single-choice choose, so the sign-in it
  starts has a fresh trusted event.
- i18n.js: Qoder 中国版 (qoder.cn) / Qoder 中國版 (qoder.cn) / Qoder 中国版 /
  Qoder CN, plus the menu's heading and "Sign in to another…", in zh,
  zh-TW, ja and de.
- The core scripts' budget is unchanged. The ~800 bytes added are paid for
  by cutting two of plugins.js's GitHub-section comments
  (1,533,657 <= 1,533,802).

The registry's Qoder summary was updated to name Qoder 中国版 in
magpie-community/plugins 2595d48. No plugin code changed, so there is no
new npm version and no mover min raise.

Run at 3b3d32724 (this commit plus the next commit's market.json), rebased
on origin/main ce2e81da1, on mote:
- GUI: plugin-pick-sub (new), plugin-two-subs, plugin-replaced,
  qoder-cn-tile, signin-closes-sheet, i18n-keys, plugin-github,
  plugin-github-filter, plugin-github-hooks, plugin-github-wait and
  plugins-more-discover, chromium + webkit: 146/146 ok.
- go test ./internal/plugin ok; go test -run 'Budget|I18n|Lang|Words'
  ./internal/gui ok (TestCoreScriptBudget).
- Before the rebase, 82 reachable GUI files (anything naming plugins,
  Qoder, Sign in to, pm-row or pm-card, plus i18n and gui-*), on mote at
  load ~270: 1122/1145 ok. The reds that failed again when run alone fail
  the same way on origin/main a4916aec1 and ce2e81da1:
  - segs-press-redraw searchAllRow (#4566);
  - usage-fold "most on one screen" (#4790);
  - plugin-move-unserved "Try again" (#4410, #4392);
  - plugin-card-update webkit (#3079);
  - TestMainWindowCorners (#3949).
  account-mask, sessions-toolbar and signin-closes-sheet passed when run
  alone.

Again after rebasing on origin/main 834c6c7df (which changed
internal/plugin and gui/providers.go), at this tree: plugin-pick-sub,
plugin-two-subs, plugin-replaced, qoder-cn-tile, signin-closes-sheet,
i18n-keys and account-rows-fit, chromium + webkit, 69/69 ok;
go test ./internal/plugin ok; ./internal/gui Budget/I18n ok.

Broken by hand: with signInTo always signing in to the first subscription,
plugin-pick-sub goes red (en and zh, 980 and 420, chromium).

Not tried:
- a real Qoder CN sign-in, or the real app window (the GUI tests fake the
  API);
- the Linux WebKitGTK app;
- the whole GUI suite after the rebase.
2026-11-02 14:49:36 +08:00
yetone ce8b67de37 gui tests: a page's first load gets a minute, not a click's 5s (#4470)
claude-switch-only set page.setDefaultTimeout(5000) and then called
page.goto with no timeout of its own, so Playwright held the first load
of app.js, i18n.js and the plugins to the 5s bar meant for clicks. On a
busy box (a whole-suite run at load 130-160) that load took longer and
goto timed out. The same pattern is in 988 GUI test files (1174 pages):
every one of them now also sets setDefaultNavigationTimeout(60000) on
the same page, right after its default, so goto, reload and waitForURL
wait on the load itself with room, while clicks and waits keep their
short bar. group-from-model-add's own 20s navigation bar is raised to the
same minute. claude-switch-only also gives its first provider row (drawn
from the page's first reads) a minute before clicking it.

nav-timeout.test.cjs (no browser) reads every GUI test file and names
each page given a default under a minute without a navigation timeout of
at least a minute, so a new file can't bring the pattern back.

What was run (WSL magpie-desktop, Playwright 1.62.0, load 70-260 from
other sessions):
- node --check on every file in internal/gui/tests: all parse.
- nav-timeout.test.cjs against origin/main's test files: red (names the
  1174 pages); against this tree: its only reds were my own probe copies
  of the old files, since removed.
- By hand: claude-switch-only with app.js served 7s late (a busy box's
  first load), --test-name-pattern "1100 en": origin/main's file 4 of 4
  red with "page.goto: Timeout 5000ms exceeded"; this file 4 of 4 green.
- claude-switch-only.test.cjs, both engines, en/zh/ja/de, 1100 and 420:
  32 of 32. group-from-model-add, usage-access-key-card and i18n-keys:
  green. agent-plugin-agents: Chromium green; WebKit's de 420 subtest red
  on a 5s waitForFunction at line 115 (a wait after load, not the
  navigation), at load ~230.

Not tried: the whole GUI suite (about 1000 files; the change is one
mechanical line per page), Windows or mote (mote's browsers, #4125).
2026-10-31 02:09:18 +08:00
yetone ad93293885 gui: the Add sheet shows a new user only magpie's own subscriptions; a deprecated one is installed from Plugins (the owner: 对于新用户来说,这里应该只显示内置的 provider 啊,更多不是要点击那个链接跳转到插件页面让用户去主动安装吗?) — a fresh magpie listed all 18 subscription tiles, the deprecated built-ins (Cursor, Kiro, Zed, Qoder…) among them, each offering its plugin when clicked. A deprecated built-in with no account in magpie (unusedSub) is now left out of the Subscriptions section, which for a new user is Claude, ChatGPT, Copilot, Gemini CLI and Antigravity, then More in Plugins; a search naming a left-out one shows More in Plugins, which opens the Plugins page on that search, where its plugin is installed. One with an account stays, badged Deprecated; one moved to its plugin stays as before; one whose plugin is installed shows the plugin's tile (replacedSub). The tile's plugin offer (Install and sign in / Use the built-in), unreachable now, is removed with its CSS and zh strings. AGENTS.md says so. deprecated-subscriptions.test.cjs now checks Zed (no account) isn't in the sheet, a search for it shows More in Plugins and opens Plugins on "zed" with Zed's card, and nothing signs in or installs by itself; plugin-replaced.test.cjs expects no tile for an unused deprecated built-in and one for a signed-in one. Both pass in Chromium and WebKit (en/zh), as do add-sheet, provider-search, qoder-cn-tile, mobile-web, deprecation-notice, click-scroll, plugin-move-overflow, plugin-movable-review, plugin-move-unserved, plugin-progressive and plugin-check-updates; plugin-move's editor-scroll check in Chromium flakes the same on origin/main. 2026-10-03 00:52:41 +08:00
yetone 294cf1225d providers: a built-in subscription whose plugin the user installed is the plugin's, and the "+ provider" sheet lists it once (ARNO on Discord: the sheet had Qoder 国际版 and Qoder CN under 订阅, and Qoder ● 2 and Qoder CN ● under 来自插件, the same two subscriptions twice) — a deprecated built-in hands its id to its plugin only through an explicit Move (the editor's Move to plugin) or Adopt (clicking the built-in's tile before signing in, since v0.1.642); the automatic list, Retiring, is empty, and f099d07e (v0.1.659) gave Qoder CN its mover but moves nobody on its own. A user who installed the Qoder plugin from Plugins was never moved: the plugin's providers took the ids qoder-plugin and qoder-cn-plugin (provider.PluginID, as the built-in ids were not moved), the add sheet listed those under 来自插件, and the built-ins stayed under 订阅 as deprecated tiles. Qoder international (moved since 09-30) was listed twice the same way. Existing migration logic, unchanged: movers (built-in id → plugin package, min version, out/back of its accounts), Move (each account checked through the plugin, everything put back on any failure), Adopt (no accounts: install the plugin and mark it moved), MoveBack, the migrations.json states (moving, plugin, back, failed, a failed one retried after 6 h), and KeepRetiringMoved in the gateway (20 s after start, then hourly). Added: provider.HandOver, for each mover whose plugin is installed, enabled and at least its min, serving the built-in's id, not signed in under its own -plugin id, and not moved back or failed in the last 6 h: with no built-in accounts it Adopts at once; with accounts it Moves them, with Move's rollback, only from the hourly loop (HandOver(ctx, true) beside MoveRetiring). The GUI's plugin add/update/upgrade and the CLI's plugin add/update call HandOver(ctx, false) once they succeed. One the plugin is already signed in to under its -plugin id is left as it is: handing the id over would rename the models agents use (qoder-plugin/... to qoder/...). Until a hand-over happens, and whenever it can't, the add sheet hides a deprecated built-in whose plugin serves its id (replacedSub in app.js), keeping it only while it is signing in; a moved one was already one tile. With the plugin not installed the built-in tile stays, as clicking it is how a new user gets the plugin. A provider signed in through the built-in keeps working and stays in the provider list. AGENTS.md says so. The manual Check for updates button for plugins that was also asked for is not shipped: per the owner, official community plugins update on their own. TestHandOver (a fake plugin under a temp HOME: nothing without the plugin; no accounts: moved at once; moved back: left; built-in accounts: left by HandOver(false), moved by HandOver(true), the built-in's emptied and the plugin signed in; the plugin signed in on its own: left) is new. plugin-replaced.test.cjs (WebKit, en and zh: no plugin, both built-ins under Subscriptions; the plugin installed with Qoder signed in to two accounts, the plugin's two tiles alone; Qoder moved, its one tile under Subscriptions and Qoder CN the plugin's; a built-in Qoder CN signed in, its provider row still listed) fails without the app.js change (all four tiles) and passes with it. deprecated-subscriptions, plugin-move, click-scroll, add-button, mobile-web, signin-paste-key and every plugin-* test pass in WebKit. go vet ./internal/..., go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui -count=1 ./... under a temp HOME pass (TestFXInState failed on its TempDir cleanup, the known flake). 2026-10-02 20:31:19 +08:00