Skip to content

Commit 7487286

Browse files
akhil-gautamclaude
andcommitted
fix(bloatmac): light-mode contrast on in-window menubar widget popover
The popover used `.ultraThinMaterial` with `.foregroundStyle(.white)` — fine in dark mode but in light mode the white "BloatMac"/"Storage"/ "445 GB used"/"50 GB free" labels rendered nearly invisible against the light material (the screenshot showed ~1.5:1 contrast, well below WCAG AA's 4.5:1 minimum for body text). Replace the material background with `Tokens.bgPanel` (already theme-aware) and route every Text foregroundStyle through Tokens.text / .text2 / .text3 so contrast stays correct in both themes. Same shadow treatment, dropped to opacity 0.30 since it no longer needs to rescue a translucent panel against a bright window. Border switches to `Tokens.border` so it tracks the rest of the UI's hairline treatment instead of a hardcoded white-12%. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c1c0420 commit 7487286

1 file changed

Lines changed: 17 additions & 9 deletions

File tree

bloatmac/bloatmac/Overlays/Overlays.swift

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,17 +82,26 @@ struct MenuBarWidgetPopover: View {
8282
HStack(spacing: 8) {
8383
BrandMark()
8484
Text("BloatMac").font(.system(size: 12, weight: .bold))
85+
.foregroundStyle(Tokens.text)
8586
Spacer()
8687
Button("Open app ›") { state.widgetOpen = false }
87-
.buttonStyle(.plain).font(.system(size: 11)).opacity(0.7)
88+
.buttonStyle(.plain).font(.system(size: 11))
89+
.foregroundStyle(Tokens.text2)
8890
}
8991
HStack(spacing: 12) {
90-
Ring(value: pct, size: 56, stroke: 6, color: pct > 0.85 ? Tokens.danger : pct > 0.7 ? Tokens.warn : Tokens.good,
92+
Ring(value: pct, size: 56, stroke: 6,
93+
color: pct > 0.85 ? Tokens.danger : pct > 0.7 ? Tokens.warn : Tokens.good,
9194
label: "\(Int((pct * 100).rounded()))%")
9295
VStack(alignment: .leading, spacing: 2) {
93-
Text("Storage").font(.system(size: 11, weight: .semibold)).opacity(0.7)
94-
Text("\(Int(live.usedGB.rounded())) GB used").font(.system(size: 14, weight: .bold))
95-
Text("\(Int(live.freeGB.rounded())) GB free").font(.system(size: 11)).opacity(0.7)
96+
Text("Storage")
97+
.font(.system(size: 11, weight: .semibold))
98+
.foregroundStyle(Tokens.text3)
99+
Text("\(Int(live.usedGB.rounded())) GB used")
100+
.font(.system(size: 14, weight: .bold))
101+
.foregroundStyle(Tokens.text)
102+
Text("\(Int(live.freeGB.rounded())) GB free")
103+
.font(.system(size: 11))
104+
.foregroundStyle(Tokens.text3)
96105
}
97106
Spacer()
98107
}.padding(.top, 12)
@@ -104,13 +113,12 @@ struct MenuBarWidgetPopover: View {
104113
}
105114
.padding(14)
106115
.frame(width: 280)
107-
.background(.ultraThinMaterial)
108-
.overlay(RoundedRectangle(cornerRadius: 12).stroke(.white.opacity(0.12)))
116+
.background(Tokens.bgPanel)
117+
.overlay(RoundedRectangle(cornerRadius: 12).stroke(Tokens.border))
109118
.clipShape(RoundedRectangle(cornerRadius: 12))
110-
.shadow(color: .black.opacity(0.5), radius: 32, y: 12)
119+
.shadow(color: .black.opacity(0.30), radius: 28, y: 10)
111120
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topTrailing)
112121
.padding(.top, 64).padding(.trailing, 60)
113-
.foregroundStyle(.white)
114122
}
115123
}
116124

0 commit comments

Comments
 (0)