From a969bbb1d8831b4bc14a04cac84564bde8bc8a12 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Wed, 25 Mar 2026 11:36:45 -0700 Subject: [PATCH] Use a warning color (orange) for numbers that indicate that cleanup is needed. --- Mac/CloudKitStats/CloudKitStatsLayout.swift | 1 + .../Scan/CloudKitStatsScanViewController.swift | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/Mac/CloudKitStats/CloudKitStatsLayout.swift b/Mac/CloudKitStats/CloudKitStatsLayout.swift index 683d16398..add6e39ad 100644 --- a/Mac/CloudKitStats/CloudKitStatsLayout.swift +++ b/Mac/CloudKitStats/CloudKitStatsLayout.swift @@ -22,6 +22,7 @@ enum CloudKitStatsLayout { static let fetchingAlpha: CGFloat = 0.4 static let animationDuration: CGFloat = 0.25 static let starColor = Assets.Colors.star + static let warningColor = NSColor.systemOrange @MainActor static func makeDivider() -> NSView { let divider = NSBox() diff --git a/Mac/CloudKitStats/Scan/CloudKitStatsScanViewController.swift b/Mac/CloudKitStats/Scan/CloudKitStatsScanViewController.swift index 568119519..c22692da2 100644 --- a/Mac/CloudKitStats/Scan/CloudKitStatsScanViewController.swift +++ b/Mac/CloudKitStats/Scan/CloudKitStatsScanViewController.swift @@ -147,6 +147,16 @@ private extension CloudKitStatsScanViewController { let statusSectionDone = !isFetching || stats.articleCount > 0 contentView.statusSectionView.animator().alphaValue = statusSectionDone ? 1.0 : CloudKitStatsLayout.fetchingAlpha contentView.articleSectionView.animator().alphaValue = isFetching ? CloudKitStatsLayout.fetchingAlpha : 1.0 + + let syncUnreadContent = UserDefaults.standard.bool(forKey: Account.iCloudSyncArticleContentForUnreadArticlesKey) + updateWarningColor(contentView.staleCountLabel, count: stats.staleStatusCount) + updateWarningColor(contentView.unreadContentCountLabel, count: syncUnreadContent ? 0 : stats.unreadArticleCount) + updateWarningColor(contentView.readContentCountLabel, count: stats.readArticleCount) + updateWarningColor(contentView.orphanedContentCountLabel, count: stats.orphanedArticleCount) + } + + func updateWarningColor(_ label: NSTextField, count: Int) { + label.textColor = count > 0 ? CloudKitStatsLayout.warningColor : .labelColor } func showErrorAlertIfNeeded() {