feat(mac): hide agent tabs when fewer than two providers have spend

The tab strip was visible for everyone regardless of which tools they
actually run, which produced a row of All + one provider for Claude-only
users and a row of All + zeros for users on exotic stacks. Hide the
whole row until a second provider has real spend, matching the behavior
the GNOME extension ships with.

Also expand ProviderFilter to include every provider the CLI supports
(OpenCode and Pi were missing) so their tabs appear when those tools
produce sessions. The CLI already emits pi and opencode in the payload's
providers map; the Mac app just wasn't offering a tab for them.

visibleFilters now filters on value > 0 instead of key presence, because
the CLI includes zero-cost entries for discovered-but-unused providers
and we don't want those rendering as blank tabs.
This commit is contained in:
AgentSeal 2026-04-18 05:07:36 -07:00
parent b232b3cfbe
commit 85d7bea7ea
3 changed files with 29 additions and 4 deletions

View file

@ -11,9 +11,10 @@ struct MenuBarContent: View {
Divider()
AgentTabStrip()
Divider()
if showAgentTabs {
AgentTabStrip()
Divider()
}
ZStack {
ScrollView(.vertical, showsIndicators: false) {
@ -63,6 +64,15 @@ struct MenuBarContent: View {
return store.payload.current.cost <= 0 && store.payload.current.calls == 0
}
/// Only show the tab row when two or more providers have non-zero spend. One
/// provider means the tabs are redundant (the All tab already shows it); zero
/// providers means the popover has nothing to filter.
private var showAgentTabs: Bool {
let payload = store.todayPayload ?? store.payload
let active = payload.current.providers.values.filter { $0 > 0 }
return active.count >= 2
}
}
private struct EmptyProviderState: View {