trae 0.1.6: the usage card says Trae CN's credits in the Credits row, as WorkBuddy's, not as an English balance line under it (yetone/magpie#694, Hu9956 on magpie 0.1.784: 积分显示的样式有点不一样 — WorkBuddy's cards read "积分 1,689.01 / 2,400 积分 · 剩余 70.4%", Trae CN's "积分 剩余 60.7%" with "余额 2307.42 of 3800 credits left" in large type below) — usage gave the share alone on its Credits window and the count as a balance string, "<left> of <limit> credits left", which magpie shows as a separate 余额 row (balanceRow, beside windows) in the plugin's own English and number format, and never flips with 已用/剩余. The window now carries the count as WorkBuddy's does (amount = credits used, limit = the packs' total, unit "credits", magpie#659), so magpie's quotaCount writes "2,307.42 / 3,800 积分 · 剩余 60.7%" (or "1,492.58 / 3,800 积分 · 已用 39.3%"; "credits" in English) in the row itself, and the balance is left out; an unlimited account still says "unlimited" as its balance. No magpie change needed: plugin_usage.go already passes a plugin window's amount, limit and unit to the card. usage.test.mjs now expects the window's amount/limit/unit and no balance (fails on 0.1.5); HOME=$(mktemp -d) bun test (465 pass) and bun scripts/check.mjs trae pass. Checked in magpie's Usage page (webkit, zh and en, API faked with the old and new shapes beside WorkBuddy and WorkBuddy AI cards): the Trae CN card's row reads like WorkBuddy's and the 余额 line is gone. Not tried with a real Trae CN account.

This commit is contained in:
yetone
2026-10-04 13:07:10 +08:00
parent b2ddbc5017
commit 2caced14ef
4 changed files with 11 additions and 7 deletions
+2 -2
View File
@@ -22,8 +22,8 @@ test("credits are the packs' limits and what they used", async () => {
expect(u.plan).toBe("Free")
expect(u.user).toBe("Ann")
expect(u.signIn).toBe("kept")
expect(u.balance).toBe("300 of 400 credits left")
expect(u.windows).toEqual([{ name: "Credits", used: 25, resetsAt: new Date(1790000000 * 1000).toISOString() }])
expect(u.balance).toBeUndefined() // the window carries the count (yetone/magpie#694)
expect(u.windows).toEqual([{ name: "Credits", used: 25, amount: 100, limit: 400, unit: "credits", resetsAt: new Date(1790000000 * 1000).toISOString() }])
})
test("unlimited packs say so", () => {