Skip to content

Commit 82db2b9

Browse files
author
weiesky.wangc
committed
ui(proxy-stats): align retry stats chart colors with app theme; release 1.7.11
BarChart's grouped-series colors no longer reuse --color-success/-warning (misreadable as good/bad on the upstream-vs-downstream availability bars). Added a dedicated --color-chart-series-2 identity color, validated against --color-primary for CVD separation and lightness band in both themes. statusColor() and two inline Tag colors switched from antd's preset palette names ('green'/'orange'/'red') to antd's semantic status names ('success'/'warning'/'error'), matching the convention already used by DetailPanel's HTTP status Tag.
1 parent 0f3c16d commit 82db2b9

6 files changed

Lines changed: 29 additions & 12 deletions

File tree

history.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
## 1.7.11 (2026-07-29)
6+
7+
- ui(proxy-stats): **retry stats chart colors aligned with the app's theme tokens**`BarChart`'s grouped-series colors no longer reuse `--color-success`/`--color-warning` (misreadable as "good/bad" on the upstream-vs-downstream availability bars); added a dedicated `--color-chart-series-2` identity color, validated against `--color-primary` for CVD separation and lightness band in both themes. `statusColor()` and two inline `Tag` colors switched from antd's preset palette names (`'green'`/`'orange'`/`'red'`) to antd's semantic status names (`'success'`/`'warning'`/`'error'`), matching the convention already used by `DetailPanel`'s HTTP status Tag.
8+
59
- fix(test): **stop viewer resources before removing CLI-test temp directories**`server-ports-busy` and `branch-server` now tear down `server.js` timers/watchers before deleting their isolated `CCV_LOG_DIR`; shared best-effort cleanup uses `fs.promises.rm` with native retries for transient `EBUSY`/`ENOTEMPTY`/`EPERM` failures.
610

711
- fix(migrate): **迁移完成后仍反复提示迁移**`pendingOf()` 仅按文件大小比对判断是否需要迁移,忽略了 `wire-v2-convert-state.json` 中的 `status: 'done'` 标记。迁移完成后活跃的 v1 日志继续增长(双写),大小不匹配导致误判为待迁移。修复:`pendingOf()` 检测到 `status === 'done'` 时直接返回无需迁移。

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cc-viewer",
3-
"version": "1.7.10",
3+
"version": "1.7.11",
44
"description": "Claude Code logging, visualization, and management toolkit — launch a web viewer alongside Claude Code with full request/response tracing, proxy, and mobile support",
55
"license": "MIT",
66
"main": "server.js",

src/components/charts/BarChart.jsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@ import React, { useEffect, useRef, useState } from 'react';
22
import styles from './BarChart.module.css';
33
import { foldBars, groupedBarTitle, singleBarTitle } from './barChartHelpers.js';
44

5-
// Default colors cycle for grouped bars. Maps to the app's REAL semantic
6-
// tokens (global.css :root) so bars theme correctly in light AND dark mode;
7-
// hex fallbacks only apply if the tokens are somehow absent.
5+
// Default colors cycle for grouped bars. These are IDENTITY colors (which
6+
// series is this bar), not status colors — deliberately distinct from
7+
// --color-success/-warning/-error so a chart series never gets misread as
8+
// "good/bad" (e.g. upstream-vs-downstream availability bars). Maps to the
9+
// app's REAL tokens (global.css :root) so bars theme correctly in light AND
10+
// dark mode; hex fallbacks match the dark-theme values (the default root)
11+
// and only apply if the tokens are somehow absent.
812
const DEFAULT_COLORS = [
913
'var(--color-primary, #1668dc)',
10-
'var(--color-success, #22c55e)',
11-
'var(--color-warning, #f59e0b)',
14+
'var(--color-chart-series-2, #cf6c48)',
1215
];
1316

1417
// Pure-SVG vertical bar chart, single or grouped series.

src/components/proxy-stats/ProxyStatsDashboard.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,13 @@ export default function ProxyStatsDashboard() {
121121
<Space>
122122
<span>{t('ui.proxyStats.currentStreak')}:</span>
123123
<Tag icon={s.currentStreakType === 'success' ? <CheckCircleOutlined /> : <CloseCircleOutlined />}
124-
color={s.currentStreakType === 'success' ? 'green' : 'red'}>
124+
color={s.currentStreakType === 'success' ? 'success' : 'error'}>
125125
{s.currentStreakType === 'success' ? t('ui.proxyStats.success') : t('ui.proxyStats.failure')} × {s.currentStreakCount}
126126
</Tag>
127127
</Space>
128128
<Space>
129129
<span>{t('ui.proxyStats.worstFailureStreak')}:</span>
130-
<Tag color="red">{s.worstFailureStreak}</Tag>
130+
<Tag color="error">{s.worstFailureStreak}</Tag>
131131
</Space>
132132
</div>
133133
{/* Dual availability grouped bars: upstream vs downstream per model */}

src/components/proxy-stats/RetryStatsHelpers.jsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,15 @@ export function fmtMs(ms) {
1111
return `${(ms / 1000).toFixed(2)} s`;
1212
}
1313

14-
// Status code → antd Tag color
14+
// Status code → antd Tag color. Uses antd's preset STATUS names (not preset
15+
// palette names like 'green'/'orange'/'red') so this Tag's success/warning/error
16+
// reads consistently with the rest of the app's status Tags (e.g. DetailPanel's
17+
// HTTP status Tag) rather than a second, unrelated antd color scale.
1518
export function statusColor(status) {
1619
if (status === 0) return 'default';
17-
if (status < 400) return 'green';
18-
if (status < 500) return 'orange';
19-
return 'red';
20+
if (status < 400) return 'success';
21+
if (status < 500) return 'warning';
22+
return 'error';
2023
}
2124

2225
// Availability percentage → semantic CSS color. Uses the app's REAL tokens

src/global.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@
8585
--color-info-light: #7dd3fc;
8686
--color-code-purple: #a78bfa;
8787
--color-code-orange: #d97757;
88+
/* Chart categorical series (identity, not status — see BarChart.jsx).
89+
series-1 reuses --color-primary; series-2 is a dedicated orange step
90+
(NOT --color-warning/-success) chosen to clear the dataviz skill's
91+
CVD/lightness-band checks against primary in both themes. */
92+
--color-chart-series-2: #cf6c48;
8893
--code-keyword: #f87171;
8994
--code-string: #7dd3fc;
9095
--code-comment: #888;
@@ -238,6 +243,8 @@
238243
--color-info-light: #0969DA;
239244
--color-code-purple: #8250DF;
240245
--color-code-orange: #953800;
246+
/* Chart categorical series (identity, not status) — see dark-theme block for rationale. */
247+
--color-chart-series-2: #953800;
241248
--code-keyword: #0000FF;
242249
--code-string: #A31515;
243250
--code-comment: #6A9955;

0 commit comments

Comments
 (0)