Skip to content

fix(dashboard): aggregate paired-device usage in the desktop Dashboard and menubar badge - #866

Draft
marcreynolds wants to merge 1 commit into
getagentseal:mainfrom
marcreynolds:feat/desktop-combined-scope
Draft

fix(dashboard): aggregate paired-device usage in the desktop Dashboard and menubar badge#866
marcreynolds wants to merge 1 commit into
getagentseal:mainfrom
marcreynolds:feat/desktop-combined-scope

Conversation

@marcreynolds

Copy link
Copy Markdown

Summary

Fixes #795. The desktop app's Dashboard showed only the local device's
cost
, while the menu bar statistics and the web GUI reported usage
aggregated across paired devices. This makes the desktop Dashboard consistent
with those surfaces by adding a Local / Combined scope control, mirroring
the macOS menu bar's existing Scope setting.

Root cause: the desktop spawned codeburn status --format menubar-json
without --scope combined, so the CLI never ran its paired-device
aggregation and the renderer only ever had local data.

What changed

Desktop app

  • New Scope: Local / Combined setting in Settings › General (persists to
    localStorage, default Local), mirroring the menu bar.
  • Combined passes --scope combined to the CLI, forces the provider filter to
    all, and clears the Claude-config scope (the CLI rejects --scope combined
    alongside a provider/project filter).
  • The Overview hero shows the paired-device aggregate (cost / calls /
    sessions) with a "Combined · N devices" caption and a per-device
    breakdown when Combined is selected.

Menu bar

  • The badge figure now reflects Combined scope instead of always showing the
    local total: it fetches the combined payload for the badge's period and
    renders the cross-device aggregate, falling back to local when no combined
    payload is available (cold cache, or an unreachable peer).

Scope / limitations

  • Only the hero KPIs aggregate; the detailed panels (daily chart, model table,
    etc.) remain local, because the combined payload carries totals only — this
    matches the menu bar's behavior.
  • Aggregation is peer-to-peer over the LAN: a paired device contributes only
    while it is reachable. An unreachable peer degrades gracefully to the
    reachable subset.

Testing

  • Desktop: npm run typecheck and npm run build:electron clean; npm test → 445 passing (+9 new covering the scope argv, the Settings control,
    and the combined hero).
  • Menu bar: swift build clean; new AppStore scope tests added (run
    under the Xcode toolchain: swift test).
  • End-to-end: verified against the live CLI on a real two-device setup —
    Combined reported the aggregate ($163.54 month) vs local-only ($95.94),
    matching the menu bar and web GUI.

… badge

Fixes getagentseal#795: the desktop Dashboard showed only local-device cost while the
menubar and web GUI aggregated across paired devices.

Desktop app:
- Add a Local/Combined Scope setting (Settings > General), mirroring the
  macOS menubar. Combined passes `--scope combined` to the CLI, forces the
  provider filter to all, and persists to localStorage.
- Overview hero shows the paired-device aggregate (cost/calls/sessions) with
  a "Combined · N devices" caption and per-device breakdown when Combined is
  selected; detailed panels remain local (the combined payload carries totals
  only).

Menubar:
- The badge figure now reflects Combined scope instead of always showing the
  local total: refreshMenubarBadge fetches the combined payload for the badge
  period and the badge renders the cross-device aggregate, falling back to
  local when no combined payload is available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Desktop app dashboard shows only local device costs while paired devices are aggregated elsewhere

1 participant