Extra usage in Claude's terracotta; extra usage in the panel (switch) #20

Merged
claude merged 7 commits from oss-oo/extra-usage-panel-orange into main 2026-10-28 19:31:49 +00:00
Member

Claudiu's follow-up on 1.1.0 (relayed by the parent session, his words verbatim):

„die farbe ist zwar besser, aber ich würde wohl eher das claude orange von andern stellen oder aehnliches nehmen, der kontrast von blau zum grün, ist der, der mir nicht gefällt (also die 2 farben des balkens)“
„… chatgpt kann seine AIC auch im panel anzeigen lassen mit config schalter, das sollten wir für unsre extra-usage auch implementieren“
„hoff wenn extra-limit off ist, wirds wieder einzeilig einfach mit extra: off“

1. Claude's terracotta instead of the blue

EXTRA_USAGE_COLOR is #d97757 (Claude's terracotta, the deep end of the title's coral) for the balance, its spend and the graph segments; dark popups get the coral highlight on top, light themes legibleAccent. Measured against the rendered dark popup colors (CIEDE2000):

candidate vs quota green deuteranopia protanopia vs warning #f6d32d vs critical #ff4d8d contrast on popup
blue #62c7f5 (1.1.0) 39.1 39.1 39.9 53.3 61.0 7.0:1
coral #f0a27f 44.6 3.9 5.9 29.6 28.3 6.5:1
badge #f2a15f 41.8 9.0 6.4 23.4 37.0 6.4:1
terracotta #d97757 52.3 9.3 17.0 38.0 23.6 4.3:1

Every orange separates more from the green than the blue for normal vision; the terracotta, darker than the green, keeps the most separation for red-green colour vision and the most distance from the warning yellow.

2. Extra usage in the panel

show-extra-usage-in-panel (switch, off by default, below the model-limits switch) adds one compact panel item like chatgpt-usage's AIC credits (UsageFormat.buildPanelExtraUsage): the icon and the currency above what the credits in hand can still pay, min(credits left, monthly limit left). That is the purchased credits normally and with auto-reload (as claude.ai lists them), the limit's rest where it binds, 0.00 once it is reached or the credits ran out. Amounts round like the popup's, whole units from 100 on, k/M from 10,000; -- without a readable balance; nothing while extra usage is off or not reported. With window labels off a horizontal panel joins currency and amount ("$8.92"); vertical panels keep the currency row. The tooltip and the accessible name add the row and a binding monthly limit. z-usage's retired show-credits-in-panel key stays retired.

3. "Extra usage: off" stays one row

Already the behavior (buildExtraUsageDisplay returns no limit row when inactive); tests/test-extra-usage.js now pins it, also with a monthly limit still reported.

Netguard hardening (from the review of its sibling ports)

tests/netguard/sitecustomize.py bypasses proxies (NO_PROXY=*; a loopback proxy carried requests past it), guards gethostbyname*, gethostbyaddr, getnameinfo and sendto too; tests/test_netguard.py probes connect/sendto on closed sockets, proves each lookup guarded before calling it, fails when the guard is only half set up, and its child checks the guard before any lookup. Identical in cinnamon-z-usage #30 and cinnamon-chatgpt-usage #13.

Validation

  • make verify: 143 Python tests, 18 cjs suites; CI green on every push.
  • New tests fail on the old code; baselined mutation runs over the change ended 68/68, 77/77 and 83/83.
  • Clock shifts 0, ±30 d, +1 y, +5 y green; Mint-Y light-theme probe readable.
  • README screenshots retaken (graph, row, horizontal panel with Fable and extra usage, settings with the new switch); a proof recapture of the final head differs only in ring countdowns.
  • Fresh independent read-only review, three rounds (round 1: two should-fix, six nits; round 2: one should-fix, four nits; round 3: three nits), every finding fixed; the netguard parts also went through a three-round review of the sibling ports.

Version 1.2.0.

🤖 Generated with Claude Code

Claudiu's follow-up on 1.1.0 (relayed by the parent session, his words verbatim): > „die farbe ist zwar besser, aber ich würde wohl eher das claude orange von andern stellen oder aehnliches nehmen, der kontrast von blau zum grün, ist der, der mir nicht gefällt (also die 2 farben des balkens)“ > „… chatgpt kann seine AIC auch im panel anzeigen lassen mit config schalter, das sollten wir für unsre extra-usage auch implementieren“ > „hoff wenn extra-limit off ist, wirds wieder einzeilig einfach mit extra: off“ ## 1. Claude's terracotta instead of the blue `EXTRA_USAGE_COLOR` is `#d97757` (Claude's terracotta, the deep end of the title's coral) for the balance, its spend and the graph segments; dark popups get the coral highlight on top, light themes `legibleAccent`. Measured against the rendered dark popup colors (CIEDE2000): | candidate | vs quota green | deuteranopia | protanopia | vs warning #f6d32d | vs critical #ff4d8d | contrast on popup | | --- | --- | --- | --- | --- | --- | --- | | blue #62c7f5 (1.1.0) | 39.1 | 39.1 | 39.9 | 53.3 | 61.0 | 7.0:1 | | coral #f0a27f | 44.6 | 3.9 | 5.9 | 29.6 | 28.3 | 6.5:1 | | badge #f2a15f | 41.8 | 9.0 | 6.4 | 23.4 | 37.0 | 6.4:1 | | **terracotta #d97757** | **52.3** | **9.3** | **17.0** | **38.0** | **23.6** | **4.3:1** | Every orange separates more from the green than the blue for normal vision; the terracotta, darker than the green, keeps the most separation for red-green colour vision and the most distance from the warning yellow. ## 2. Extra usage in the panel `show-extra-usage-in-panel` (switch, off by default, below the model-limits switch) adds one compact panel item like chatgpt-usage's AIC credits (`UsageFormat.buildPanelExtraUsage`): the icon and the currency above what the credits in hand can still pay, min(credits left, monthly limit left). That is the purchased credits normally and with auto-reload (as claude.ai lists them), the limit's rest where it binds, `0.00` once it is reached or the credits ran out. Amounts round like the popup's, whole units from 100 on, k/M from 10,000; `--` without a readable balance; nothing while extra usage is off or not reported. With window labels off a horizontal panel joins currency and amount ("$8.92"); vertical panels keep the currency row. The tooltip and the accessible name add the row and a binding monthly limit. z-usage's retired `show-credits-in-panel` key stays retired. ## 3. "Extra usage: off" stays one row Already the behavior (`buildExtraUsageDisplay` returns no limit row when inactive); `tests/test-extra-usage.js` now pins it, also with a monthly limit still reported. ## Netguard hardening (from the review of its sibling ports) `tests/netguard/sitecustomize.py` bypasses proxies (`NO_PROXY=*`; a loopback proxy carried requests past it), guards `gethostbyname*`, `gethostbyaddr`, `getnameinfo` and `sendto` too; `tests/test_netguard.py` probes connect/sendto on closed sockets, proves each lookup guarded before calling it, fails when the guard is only half set up, and its child checks the guard before any lookup. Identical in cinnamon-z-usage #30 and cinnamon-chatgpt-usage #13. ## Validation - `make verify`: 143 Python tests, 18 cjs suites; CI green on every push. - New tests fail on the old code; baselined mutation runs over the change ended 68/68, 77/77 and 83/83. - Clock shifts 0, ±30 d, +1 y, +5 y green; Mint-Y light-theme probe readable. - README screenshots retaken (graph, row, horizontal panel with Fable and extra usage, settings with the new switch); a proof recapture of the final head differs only in ring countdowns. - Fresh independent read-only review, three rounds (round 1: two should-fix, six nits; round 2: one should-fix, four nits; round 3: three nits), every finding fixed; the netguard parts also went through a three-round review of the sibling ports. Version 1.2.0. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
claude agent added 1 commit 2026-10-28 18:23:15 +00:00
Extra usage in Claude's terracotta; extra usage in the panel (switch)
All checks were successful
Checks / Functional checks (pull_request) Successful in 36s
497d29ddfa
- EXTRA_USAGE_COLOR is Claude's terracotta #d97757 instead of z's blue
  (Claudiu preferred Claude orange to the blue next to the green): the
  balance, its spend and the graph segments, coral top on dark popups,
  legibleAccent on light ones. Measured on the dark popup: ΔE2000 52 to the
  quota green, 38 to the warning yellow, 24 to the critical pink; darker
  than the green, so the two bar colors stay apart for red-green vision
  (deuteranopia 9.3, protanopia 17.0, the best of the oranges tried).
- "Show extra usage in the panel" (show-extra-usage-in-panel, off by
  default; z's retired show-credits-in-panel stays retired): one more
  compact panel value like chatgpt-usage's AIC credits, the currency above
  the purchased credits left (UsageFormat.buildPanelExtraUsage), whole
  units from 100 on, "--" without a readable balance, 0.00 out of credits,
  nothing while extra usage is off; tooltip lines for the row and a binding
  monthly limit.
- A switched-off extra usage stays the single "Extra usage: off" row, also
  with a monthly limit still reported (test).
- Version 1.2.0, changelog, README, docs, translations, capture switch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent added 1 commit 2026-10-28 18:25:30 +00:00
README screenshots and social preview for 1.2.0
All checks were successful
Checks / Functional checks (pull_request) Successful in 43s
c7de03e8e5
Recaptured in a private Xvfb session from 497d29d with the synthetic
fixture: usage-menu, usage-menu-plan-only and usage-menu-horizontal show
the terracotta extra usage row and graph segments, the horizontal one also
the Fable week and the extra usage left as panel items; both settings
captures grew by the new switch's row. panel-tooltip was pixel-identical
and stays. Social preview re-rendered, rights inventory hashes refreshed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent added 1 commit 2026-10-28 18:48:05 +00:00
Review round 1: the panel shows what the credits in hand can still pay
All checks were successful
Checks / Functional checks (pull_request) Successful in 38s
7070f468fc
Fixes for the fresh review of c7de03e (no blocker):
- should-fix: the panel value ignored the monthly limit (a reached limit
  still showed "$ 8.92"). It is now min(credits left, limit left): the
  purchased credits normally and with auto-reload (as on claude.ai), the
  limit's rest where it binds, 0.00 once it is reached or the credits ran
  out, also without the amounts.
- should-fix: pinned the unpinned behaviours: yen in whole units, exactly
  100, the tooltip's limit line only while the limit binds, an empty
  separator, the vertical label width.
- With window labels off the currency joins the amount ("$8.92"): one row
  like the percentages when the icon is off too.
- Panel amounts round like the popup's; k/M from 10,000 keep a vertical
  panel narrow; KRW gets its symbol.
- Wording: the terracotta is the best separated of the oranges tried for
  red-green colour vision, not "kept apart"; "a deeper shade of the title's
  coral"; the last blue in test-credits-fit.js; the switch tooltip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent added 1 commit 2026-10-28 19:04:56 +00:00
Review round 2: limit-aware name, used-up limit row, hardened netguard
All checks were successful
Checks / Functional checks (pull_request) Successful in 40s
7b4fdc9b38
1.2.0 review round 2 (no blocker):
- should-fix: the panel item's accessible name names the binding limit
  too, so a 0.00 is explained; a limit used up without the reached flag
  shows its row ($0.00 left) also without a readable balance.
- From 999,500 on the panel shows M (never "1000k"); tests pin the limit
  clamp (spent over the limit), 9999.5 → 10k and 999,700 → 1M.
- Vertical panels keep the currency row with window labels off ("CA$8.92"
  would not fit); the money comment names the panel's compact form.

Netguard (review of the sibling ports, same files here):
- Proxies are bypassed (NO_PROXY=*): a loopback proxy carried a request to
  any host past the checks. gethostbyname*, gethostbyaddr, getnameinfo and
  sendto are guarded too.
- test_netguard: connect/connect_ex/sendto probed on closed sockets (the
  connect half was never exercised), the child proves the guard before its
  lookup of example.invalid, and a half set-up guard fails instead of
  skipping. Docs say what the guard covers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent added 1 commit 2026-10-28 19:12:24 +00:00
Review round 3 nits: changelog wording, the child proves INSTALLED
All checks were successful
Checks / Functional checks (pull_request) Successful in 43s
52765929e7
- CHANGELOG: the currency joins the amount only in horizontal panels; the
  used-up limit row without a readable balance is named.
- test_netguard's child checks sitecustomize.INSTALLED (explicitly, so
  python -O cannot drop it) before its lookup of example.invalid.
- The guard's lookup wrappers keep the real functions' names
  (functools.wraps), so a failing subtest says which lookup broke.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent added 1 commit 2026-10-28 19:19:48 +00:00
Netguard: lookups proven guarded before the call; localhost only
All checks were successful
Checks / Functional checks (pull_request) Successful in 40s
8704510cd9
From the netguard review of the sibling ports (same files in all three):
- test_netguard asserts each lookup is the guard's wrapper (__wrapped__)
  before calling it, so a guard that lost one never sends that lookup to
  the real resolver; getnameinfo keeps its name too.
- Only "localhost" passes by name: localhost.localdomain may be missing from
  /etc/hosts (containers) and would go to DNS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent added 1 commit 2026-10-28 19:29:58 +00:00
Netguard round 3 nit: the child and setUp check before any lookup
All checks were successful
Checks / Functional checks (pull_request) Successful in 42s
66f259ebef
- The child exits unless the guard is installed and getaddrinfo is still
  its wrapper, so even a guard that lost that wrapper never asks the real
  resolver from the child.
- setUp checks the loopback decision before any lookup probe runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent merged commit 84a8a7d6c1 into main 2026-10-28 19:31:49 +00:00
claude agent deleted branch oss-oo/extra-usage-panel-orange 2026-10-28 19:31:49 +00:00
claude agent referenced this pull request from a commit 2026-10-28 19:39:36 +00:00
claude agent referenced this pull request from a commit 2026-10-28 19:40:18 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
OSS-Singularity/cinnamon-claude-usage!20
No description provided.