Skip to content

[Bug] 用量统计热力图在深色主题下颜色深浅与 token 用量相反 #1302

Closed

Description

@annasu3004

Affected area

Desktop UI (agent-gui / React)

Version or commit

main@11468af5 (introduced by #1300)

Environment

macOS / Apple Silicon,桌面开发版(make dev),深色主题。与模型供应商无关。

Steps to reproduce

  1. 使用深色主题打开设置 → 用量统计。
  2. 在活跃热力图中找到 token 用量不同的日期,悬停查看具体数值。
  3. 对比色块与“少 → 多”图例:较低档位使用深蓝色,较高档位反而更浅。

Expected behavior

浅色和深色主题均应保持:颜色越深,token 用量越多。每日、每周、累计视图和图例应使用一致方向。

Actual behavior

深色主题的色阶从 #184f95(低用量)变为 #86b6ef(高用量),最深的蓝色对应较少的 token,与页面“颜色越浓用量越多”的说明相反。

分析:heatScale / heatLevel 分档正常,问题在 usageUi.tsx 的 dark:--usage-heat-1…4 配色顺序反转。

Logs / screenshots

对应修复 PR:#1301。

回归测试使用递增 token 值检查两种主题的相对亮度随档位递减:修复前失败于 dark:more tokens must be darker,修复后通过。

本地验证:23 项用量统计测试通过;GUI TypeScript 检查通过;git diff --check 通过。

已搜索 heatmap / 热力图,发现原功能 issue #1299 与 PR #1300,以及本次修复 PR #1301,未发现重复的独立 bug issue。

Pre-submit checklist

  • I searched existing issues and pull requests and found no duplicates.
  • This is not a security vulnerability (report those privately via Security Advisories).

Activity

  1. xiaozhou26 commented on Nov 16, 2026

    @xiaozhou26
    Contributor

    收到

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions