mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-05-01 16:30:15 +00:00
fix(mac): restore agent tab strip to show all detected providers
Tabs were filtering on `value > 0` (today's spend), which hid the row whenever only one provider had activity today. The CLI's providers map already contains only providers detected on the system, so showing the map as-is matches user intent: a tab for each installed tool, regardless of today's spend. Tab strip only hides when nothing is detected. This also makes the Plan pill reachable again: it gates on `selectedProvider == .claude`, which required clicking the Claude tab to select.
This commit is contained in:
parent
29e175c735
commit
9483d66e65
2 changed files with 11 additions and 15 deletions
|
|
@ -33,19 +33,16 @@ struct AgentTabStrip: View {
|
|||
}
|
||||
|
||||
private var visibleFilters: [ProviderFilter] {
|
||||
// Only surface providers that actually spent money in the all-provider view.
|
||||
// The CLI includes zero-cost providers in the payload for completeness, so
|
||||
// filtering on value > 0 keeps the tab row honest and avoids showing tabs
|
||||
// for tools the user hasn't run yet.
|
||||
let activeKeys = Set(
|
||||
allProvidersToday.current.providers
|
||||
.filter { $0.value > 0 }
|
||||
.keys
|
||||
.map { $0.lowercased() }
|
||||
// Show a tab for every provider detected on this machine. The CLI decides what
|
||||
// to include in the providers map based on session dirs / credential files it
|
||||
// finds, so zero-cost-today is still "installed" and the user expects to see
|
||||
// it. Only providers that aren't installed at all are absent from the map.
|
||||
let detectedKeys = Set(
|
||||
allProvidersToday.current.providers.keys.map { $0.lowercased() }
|
||||
)
|
||||
return ProviderFilter.allCases.filter { filter in
|
||||
if filter == .all { return true }
|
||||
return activeKeys.contains(filter.rawValue.lowercased())
|
||||
return detectedKeys.contains(filter.rawValue.lowercased())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,13 +64,12 @@ 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.
|
||||
/// Show the tab row whenever the CLI detected at least one AI coding tool installed
|
||||
/// on this machine. Hidden only when nothing is detected, which means there's
|
||||
/// nothing to filter by anyway.
|
||||
private var showAgentTabs: Bool {
|
||||
let payload = store.todayPayload ?? store.payload
|
||||
let active = payload.current.providers.values.filter { $0 > 0 }
|
||||
return active.count >= 2
|
||||
return !payload.current.providers.isEmpty
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue