Skip to content

feat(menubar): mark badge when a paired device is unreachable in combined scope - #867

Draft
marcreynolds wants to merge 2 commits into
getagentseal:mainfrom
marcreynolds:feat/menubar-degraded-device-indicator
Draft

feat(menubar): mark badge when a paired device is unreachable in combined scope#867
marcreynolds wants to merge 2 commits into
getagentseal:mainfrom
marcreynolds:feat/menubar-degraded-device-indicator

Conversation

@marcreynolds

Copy link
Copy Markdown

Summary

Follow-up to #866. Under Combined scope the menu bar badge falls back to the
local figure whenever a paired device doesn't report (asleep / off the
network) — which reads as a glitch ("it dropped back to local for a second").
This adds a small, dimmed reachable/total marker to the badge, plus a
matching tooltip, so a degraded total is legibly "a peer is unreachable"
rather than a number that mysteriously shrank.

Example badge: 🔥 $95.94 /mo · 1/2 — tooltip: "CodeBurn month · 1 of 2
devices reporting"
. The marker clears the instant every paired device reports
again.

What changed

  • AppStore.menubarBadgeDeviceShortfall(reachable, total) only when
    Combined scope is active and fewer paired devices reported than are
    paired; nil otherwise (all reported, single device, or Local scope).
  • The badge appends the dimmed marker and sets the device-count tooltip when a
    shortfall is present.
  • Tests for the shortfall condition (unreachable peer → marker; all reachable
    / Local scope → no marker).

Stacked on #866

Note

This branch is stacked on top of #866 (the combined-scope fix), since the
indicator depends on the combined badge payload introduced there. Until #866
merges, this PR's diff also includes #866's commit; once #866 lands on
main, the diff reduces to just the indicator commit. Merge #866 first.

Testing

  • swift build clean; new AppStore shortfall tests added (run under the
    Xcode toolchain: swift test).

… 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.
…ined scope

Under combined scope the badge falls back to the local figure whenever a
paired device doesn't report (asleep / off-network), which read as a glitch.
Append a dimmed "reachable/total" marker (e.g. "$95.94 /mo · 1/2") and a
matching tooltip so the reduced total is legibly "peer unreachable" instead.
The marker clears the instant every paired device reports again.

Adds AppStore.menubarBadgeDeviceShortfall plus tests.
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.

1 participant