Fix model badge ForEach ID collision and budget warning provider filter

- SessionDetailsList model badges used id: \.name which silently drops
  duplicate model entries. Switched to enumerated offset-based ID.
- Hero budget warning compared against provider-filtered payload instead
  of todayPayload (all providers). Now matches the menubar flame tint.
This commit is contained in:
iamtoruk 2026-05-18 14:51:03 -07:00
parent c2683ca960
commit 146d074c04
2 changed files with 3 additions and 2 deletions

View file

@ -1086,7 +1086,7 @@ private struct SessionDetailsList: View {
.padding(.leading, 4)
}
HStack(spacing: 4) {
ForEach(sess.models.prefix(3), id: \.name) { model in
ForEach(Array(sess.models.prefix(3).enumerated()), id: \.offset) { _, model in
Text(model.name)
.font(.system(size: 8.5, weight: .medium))
.foregroundStyle(.secondary)

View file

@ -55,7 +55,8 @@ struct HeroSection: View {
if store.selectedPeriod == .today,
store.dailyBudget > 0,
store.payload.current.cost >= store.dailyBudget {
let todayCost = store.todayPayload?.current.cost,
todayCost >= store.dailyBudget {
HStack(spacing: 4) {
Image(systemName: "exclamationmark.triangle.fill")
.font(.system(size: 10))