Files
magpie/docs
yetone 70f4593e62 provider: a key's typed balance can refill each day (Kelen_Yc on X)
A key's balance typed by hand refilled each month or each week. A relay
key with a daily allowance had no way to say so. Now it can refill each
day, at local midnight, like the others:

- provider: Refill{Every: "day", Day: 0} (RefillDay). Last is today's
  midnight in now's location, Next tomorrow's. check takes it with day 0
  only; ParseRefill reads daily/day/d (daily:1 refused); String is
  "daily". A magpie before this drops such a refill on read, as one
  written by hand that isn't one, and counts from when it was typed.
- CLI: `magpie provider key-balance <id> <key> --refill daily`; usage
  lines updated.
- GUI: the pill's menu has "Refills each day" after "Refills each
  week…", posting {every: day, day: 0} at once (no day to pick, so no
  ellipsis), with its toast; en, zh, zh-TW, ja, de.
- docs/subsystems/providers-accounts.md names it.

Tests: TestRefillDays gains daily rows (midday, exactly midnight, a
month's and a year's end, Asia/Shanghai). New
TestTypedBalanceRefillsDaily holds the clock in Pacific/Kiritimati
(UTC+14), Pacific/Pago_Pago (UTC-11) and UTC: a minute before local
midnight the spend counts from when it was typed, a minute after it
counts from local midnight and the next refill is the following one.
TestOwnBalanceParsedInYuanAndRefill and TestTypedBalanceRefills cover
parsing, the bad {day, 1}, and read-back; TestKeyBalanceCmd sets
--refill daily. key-own-balance.test.cjs picks Refills each day in
every language, both engines, 900 and 400px, checks the post and that
the menu then shows it picked.

Run on mica at 889758605 + this: go test -count=1
./internal/provider ./internal/cli ./internal/gui ok; go vet darwin,
GOOS=linux -tags nogui, GOOS=windows ok; gofmt clean; GUI
key-own-balance, i18n-keys, i18n-en-no-cjk, key-balance-expiring in
chromium and webkit ok (48/48). Rebased on c5adcbaab (library, site;
nothing of this change's files), then at the pushed head: go test
./internal/gui, ./internal/provider -run Refill|TypedBalance|OwnBalance|
KeyOwnBalance|Budget ok, i18n-keys and i18n-en-no-cjk ok. key-balance-card is red in de at 560px
(view-usage 635>560) in both engines on the clean base 889758605 too:
#6414.

Broken by hand: daily Last taken from UTC's midnight instead of local:
TestRefillDays and TestTypedBalanceRefillsDaily (Kiritimati) red.

Not tried: the real app with a real relay key; the full suite (started
after the tag).
2026-11-13 11:59:54 +08:00
..