claude-code-cost 0.25.0 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-cost",
3
- "version": "0.25.0",
3
+ "version": "0.26.0",
4
4
  "description": "Cost dashboard for Claude Code usage",
5
5
  "main": "server.js",
6
6
  "type": "commonjs",
package/public/app.js CHANGED
@@ -488,11 +488,28 @@ function purgeLegacyLocalCache() {
488
488
  keys.forEach((k) => localStorage.removeItem(k));
489
489
  }
490
490
 
491
+ // A re-render can ask for a URL whose first request is still in flight (the hub's theme message
492
+ // arrives during the first load and re-renders the view), so it joins that request.
493
+ const pendingFetches = new Map();
494
+
491
495
  async function fetchJSON(url, skipCache) {
492
- if (!skipCache) {
493
- const cached = getCached(url);
494
- if (cached) return cached;
496
+ if (skipCache) return requestJSON(url);
497
+ const cached = getCached(url);
498
+ if (cached) return cached;
499
+ const pending = pendingFetches.get(url);
500
+ if (pending) return pending;
501
+ const request = requestJSON(url);
502
+ pendingFetches.set(url, request);
503
+ try {
504
+ const data = await request;
505
+ cacheData(url, data);
506
+ return data;
507
+ } finally {
508
+ pendingFetches.delete(url);
495
509
  }
510
+ }
511
+
512
+ async function requestJSON(url) {
496
513
  const res = await fetch(url);
497
514
  if (!res.ok) {
498
515
  const err = new Error(`HTTP ${res.status}`);
@@ -501,7 +518,6 @@ async function fetchJSON(url, skipCache) {
501
518
  }
502
519
  const data = await res.json();
503
520
  dataFetchedAt = Date.now();
504
- if (!skipCache) cacheData(url, data);
505
521
  return data;
506
522
  }
507
523
 
package/public/style.css CHANGED
@@ -12,7 +12,7 @@
12
12
  --text-muted: #7d808a;
13
13
  --accent: #e86f33;
14
14
  --accent-text: #f0a070;
15
- --accent-dim: rgba(232, 111, 51, 0.22);
15
+ --accent-dim: rgba(232, 111, 51, 0.25);
16
16
  --accent-glow: rgba(232, 111, 51, 0.55);
17
17
  --chart-fill: rgba(232, 111, 51, 0.32);
18
18
  --success: #3ecf8e;
@@ -2185,17 +2185,17 @@ kbd {
2185
2185
  body.light {
2186
2186
  --bg-deep: #e8e6e3;
2187
2187
  --bg-surface: #efede9;
2188
- --bg-elevated: #f7f4f0;
2188
+ --bg-elevated: #fbfaf9;
2189
2189
  --bg-hover: #d2d0cc;
2190
2190
  --border: #cfcbc4;
2191
2191
  --text-primary: #0a0a0a;
2192
- --text-secondary: #444444;
2193
- --text-tertiary: #666666;
2194
- --text-muted: #888888;
2192
+ --text-secondary: #2c2c2c;
2193
+ --text-tertiary: #565656;
2194
+ --text-muted: #767676;
2195
2195
  --accent-text: #a0501c;
2196
- --accent-dim: rgba(232, 111, 51, 0.18);
2196
+ --accent-dim: rgba(184, 90, 32, 0.18);
2197
2197
  --accent-glow: rgba(232, 111, 51, 0.5);
2198
- --chart-fill: rgba(232, 111, 51, 0.28);
2198
+ --chart-fill: rgba(232, 111, 51, 0.32);
2199
2199
  --success: #1a8a5a;
2200
2200
  --success-dim: rgba(26, 138, 90, 0.15);
2201
2201
  --warning: #b07d0a;
package/public/themes.css CHANGED
@@ -38,6 +38,40 @@ body.light .theme-swatch-vitesse { --sw-bg: #f7f7f7; --sw-accent: #1c6b48; --sw-
38
38
  .theme-swatch-synthwave { --sw-bg: #262335; --sw-accent: #ff7edb; --sw-ink: #ffffff; --sw-border: #495495; }
39
39
  body.light .theme-swatch-synthwave { --sw-bg: #efecf6; --sw-accent: #c936a6; --sw-ink: #241b2f; --sw-border: #c5bcdd; }
40
40
 
41
+ /* Ember */
42
+ body:not([data-color-theme]):not(.light) {
43
+ --accent: #e86f33;
44
+ --accent-text: #f0a070;
45
+ --accent-dim: rgba(232,111,51,0.25);
46
+ --accent-glow: rgba(232, 111, 51, 0.55);
47
+ --bg-deep: #101114;
48
+ --bg-surface: #16181c;
49
+ --bg-elevated: #1e2025;
50
+ --bg-hover: #282a30;
51
+ --border: #363840;
52
+ --text-primary: #f0f1f3;
53
+ --text-secondary: #c2c4c9;
54
+ --text-tertiary: #9a9da5;
55
+ --text-muted: #7d808a;
56
+ --chart-fill: rgba(232, 111, 51, 0.32);
57
+ }
58
+ body.light:not([data-color-theme]) {
59
+ --accent: #e86f33;
60
+ --accent-text: #a0501c;
61
+ --accent-dim: rgba(184,90,32,0.18);
62
+ --accent-glow: rgba(232, 111, 51, 0.5);
63
+ --bg-deep: #e8e6e3;
64
+ --bg-surface: #efede9;
65
+ --bg-elevated: #fbfaf9;
66
+ --bg-hover: #d2d0cc;
67
+ --border: #cfcbc4;
68
+ --text-primary: #0a0a0a;
69
+ --text-secondary: #2c2c2c;
70
+ --text-tertiary: #565656;
71
+ --text-muted: #767676;
72
+ --chart-fill: rgba(232, 111, 51, 0.32);
73
+ }
74
+
41
75
  /* Gruvbox */
42
76
  body[data-color-theme="gruvbox"]:not(.light) {
43
77
  --accent: #fe8019;