From 81abffd145fb46618834da661a5c2ab905b6f0cb Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 27 Dec 2025 14:03:45 +0100 Subject: [PATCH] fix(macos): boost light mode usage bar contrast --- CHANGELOG.md | 1 + apps/macos/Sources/Clawdis/ContextUsageBar.swift | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3de67e77..5ff3858b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,6 +76,7 @@ - Menu hover highlights now span the full width (including submenu arrows). - Menu session rows now refresh while open without width changes (no more stuck “Loading sessions…”). - Menu width no longer grows on hover when moving the mouse across rows. +- Context usage bars now have higher contrast in light mode. - macOS node timeouts now share a single async timeout helper for consistent behavior. - WebChat window defaults tightened (narrower width, edge-to-edge layout) and the SwiftUI tag removed from the title. diff --git a/apps/macos/Sources/Clawdis/ContextUsageBar.swift b/apps/macos/Sources/Clawdis/ContextUsageBar.swift index 29e45a302..1558eeb2b 100644 --- a/apps/macos/Sources/Clawdis/ContextUsageBar.swift +++ b/apps/macos/Sources/Clawdis/ContextUsageBar.swift @@ -12,6 +12,16 @@ struct ContextUsageBar: View { if match == .darkAqua { return base } return base.blended(withFraction: 0.24, of: .black) ?? base } + private static let trackFill: NSColor = .init(name: nil) { appearance in + let match = appearance.bestMatch(from: [.aqua, .darkAqua]) + if match == .darkAqua { return NSColor.white.withAlphaComponent(0.14) } + return NSColor.black.withAlphaComponent(0.16) + } + private static let trackStroke: NSColor = .init(name: nil) { appearance in + let match = appearance.bestMatch(from: [.aqua, .darkAqua]) + if match == .darkAqua { return NSColor.white.withAlphaComponent(0.22) } + return NSColor.black.withAlphaComponent(0.28) + } private var clampedFractionUsed: Double { guard self.contextTokens > 0 else { return 0 } @@ -58,8 +68,8 @@ struct ContextUsageBar: View { @ViewBuilder private func barBody(width: CGFloat, fraction: Double) -> some View { let radius = self.height / 2 - let trackFill = Color.white.opacity(0.12) - let trackStroke = Color.white.opacity(0.18) + let trackFill = Color(nsColor: Self.trackFill) + let trackStroke = Color(nsColor: Self.trackStroke) let fillWidth = max(1, floor(width * CGFloat(fraction))) ZStack(alignment: .leading) {