refactor(usage): fold claude-desktop into claude in the dashboard

The Desktop gateway's proxy traffic is still recorded under its own
app_type for route-takeover billing audit (the request detail panel
shows the real value), but the dashboard now folds it into `claude`
for display. A standalone "Claude Desktop" bucket only ever showed a
partial number: Desktop chat usage never passes through the proxy and
has no scannable local source, while its Code-tab sessions are just the
embedded Claude Code runtime writing into the shared ~/.claude/projects
tree — so a separate bucket misled users into reading it as Desktop's
full usage.

Backend: new `folded_app_type_sql` helper wraps the app_type column in
every dashboard read path (10 filter sites + the by-app projection) so
`= 'claude'` also matches claude-desktop and GROUP BY merges the two,
without changing bound-param counts. Dedup matching and provider-limit
checks keep exact comparison; get_request_logs folds only the WHERE
filter and keeps the raw app_type in its row projection.

Frontend: drop claude-desktop from the dashboard AppType/KNOWN_APP_TYPES
filter list, the UsageHero theme, and the now-dead appFilter locale key
in all four languages (the managed-app apps.claude-desktop label stays).

Adds test_claude_desktop_folds_into_claude_for_display.
This commit is contained in:
Jason
2026-06-11 08:58:06 +08:00
parent 2d64d8c619
commit c7efa77ad9
7 changed files with 125 additions and 36 deletions
-5
View File
@@ -49,11 +49,6 @@ const TITLE_THEMES: Record<AppType | "all", TitleTheme> = {
accent: "text-amber-600 dark:text-amber-400",
iconBg: "bg-amber-500/10",
},
"claude-desktop": {
// 与 Claude Code 同属 Anthropic 品牌,用更深的 orange 区分
accent: "text-orange-600 dark:text-orange-400",
iconBg: "bg-orange-500/10",
},
codex: {
// OpenAI/Codex 走黑白单色调;中性灰在深浅模式都能透出方块底色,
// 不像纯黑 bg-black/10 在深色背景下会糊掉。