Skip to content

Commit f26f4ad

Browse files
authored
fix(menubar): show every active agent as a tab, ordered by usage for the selected range (#549)
The agent tab strip never showed Grok, Hermes, or ZCode: ProviderFilter had no cases for them, so they could not become tabs. It also derived the visible tabs from today's providers rather than the range the user actually has selected, so an agent used in the selected window but not today never appeared. Add the three missing cases (filter keys, CLI arg, accent color) and rebuild visibleFilters to source from the selected period via cost(for:). Every agent with usage in the range now appears, ordered by spend descending, and agents with no usage in the range are omitted.
1 parent 163013f commit f26f4ad

2 files changed

Lines changed: 17 additions & 10 deletions

File tree

mac/Sources/CodeBurnMenubar/AppStore.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,6 +1078,9 @@ enum ProviderFilter: String, CaseIterable, Identifiable {
10781078
case crush = "Crush"
10791079
case antigravity = "Antigravity"
10801080
case goose = "Goose"
1081+
case grok = "Grok"
1082+
case hermes = "Hermes"
1083+
case zcode = "ZCode"
10811084

10821085
var id: String { rawValue }
10831086

@@ -1092,6 +1095,8 @@ enum ProviderFilter: String, CaseIterable, Identifiable {
10921095
case .openclaw: ["openclaw"]
10931096
case .antigravity: ["antigravity"]
10941097
case .goose: ["goose"]
1098+
case .grok: ["grok", "grok build"]
1099+
case .hermes: ["hermes", "hermes agent"]
10951100
default: [rawValue.lowercased()]
10961101
}
10971102
}
@@ -1121,6 +1126,9 @@ enum ProviderFilter: String, CaseIterable, Identifiable {
11211126
case .crush: "crush"
11221127
case .antigravity: "antigravity"
11231128
case .goose: "goose"
1129+
case .grok: "grok"
1130+
case .hermes: "hermes"
1131+
case .zcode: "zcode"
11241132
}
11251133
}
11261134
}

mac/Sources/CodeBurnMenubar/Views/AgentTabStrip.swift

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,23 +108,19 @@ struct AgentTabStrip: View {
108108
.frame(height: 38)
109109
}
110110

111-
private var todayAll: MenubarPayload {
112-
store.todayPayload ?? store.payload
113-
}
114-
115111
private var periodAll: MenubarPayload {
116112
store.periodAllPayload ?? store.payload
117113
}
118114

119115
private var visibleFilters: [ProviderFilter] {
120-
let detectedKeys = Set(
121-
todayAll.current.providers.keys.map { $0.lowercased() }
122-
)
116+
// Tabs reflect the SELECTED range: every provider with usage (cost > 0)
117+
// in the period, ordered by usage. Providers with no usage in the range
118+
// are omitted. `.all` always leads. cost(for:) reads periodAll, so this
119+
// updates as the user switches periods.
120+
let costs = Dictionary(uniqueKeysWithValues: ProviderFilter.allCases.map { ($0, cost(for: $0) ?? 0) })
123121
let detected = ProviderFilter.allCases.filter { filter in
124-
if filter == .all { return true }
125-
return filter.providerKeys.contains(where: detectedKeys.contains)
122+
filter == .all || (costs[filter] ?? 0) > 0
126123
}
127-
let costs = Dictionary(uniqueKeysWithValues: detected.map { ($0, cost(for: $0) ?? 0) })
128124
return detected.sorted { a, b in
129125
if a == .all { return true }
130126
if b == .all { return false }
@@ -506,6 +502,9 @@ extension ProviderFilter {
506502
case .crush: return Color(red: 0xE0/255.0, green: 0x6C/255.0, blue: 0x9F/255.0)
507503
case .antigravity: return Color(red: 0xFF/255.0, green: 0x7A/255.0, blue: 0x45/255.0)
508504
case .goose: return Color(red: 0xB7/255.0, green: 0x8D/255.0, blue: 0x52/255.0)
505+
case .grok: return Color(red: 0x8E/255.0, green: 0x8E/255.0, blue: 0x93/255.0)
506+
case .hermes: return Color(red: 0xC7/255.0, green: 0x52/255.0, blue: 0x3E/255.0)
507+
case .zcode: return Color(red: 0x52/255.0, green: 0x6E/255.0, blue: 0xD6/255.0)
509508
}
510509
}
511510
}

0 commit comments

Comments
 (0)