Skip to content

Commit 03065a3

Browse files
Fix white text on dark-themed views (Trends & Insights, Chat)
Bump all body text, headers, and stat values to full white for readability on dark backgrounds. Replace .toolbarColorScheme (iOS 16+) with manual toolbar principal title for compatibility. Restore UINavigationBarAppearance approach in ChatView. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6661ec9 commit 03065a3

2 files changed

Lines changed: 17 additions & 13 deletions

File tree

Loop/Views/LoopInsights/LoopInsights_ChatView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ struct LoopInsights_ChatView: View {
6464
let appearance = UINavigationBarAppearance()
6565
appearance.configureWithOpaqueBackground()
6666
appearance.backgroundColor = UIColor(red: 0.06, green: 0.07, blue: 0.15, alpha: 1)
67-
appearance.titleTextAttributes = [.foregroundColor: UIColor.white.withAlphaComponent(0.9)]
67+
appearance.titleTextAttributes = [.foregroundColor: UIColor.white]
6868
UINavigationBar.appearance().standardAppearance = appearance
6969
UINavigationBar.appearance().scrollEdgeAppearance = appearance
7070
}
@@ -78,7 +78,7 @@ struct LoopInsights_ChatView: View {
7878
ToolbarItem(placement: .principal) {
7979
Text(NSLocalizedString("Ask LoopInsights", comment: "LoopInsights chat title"))
8080
.font(.headline)
81-
.foregroundColor(.white.opacity(0.9))
81+
.foregroundColor(.white)
8282
}
8383
ToolbarItem(placement: .navigationBarLeading) {
8484
Button(action: { dismiss() }) {

Loop/Views/LoopInsights/LoopInsights_TrendsInsightsView.swift

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,16 @@ struct LoopInsights_TrendsInsightsView: View {
3737
tabContent
3838
}
3939
}
40-
.navigationTitle(NSLocalizedString("Trends & Insights", comment: "LoopInsights trends title"))
4140
.navigationBarTitleDisplayMode(.inline)
41+
.onAppear {
42+
viewModel.loadIfNeeded(coordinator: coordinator)
43+
}
4244
.toolbar {
45+
ToolbarItem(placement: .principal) {
46+
Text(NSLocalizedString("Trends & Insights", comment: "LoopInsights trends title"))
47+
.font(.headline)
48+
.foregroundColor(.white)
49+
}
4350
ToolbarItem(placement: .navigationBarLeading) {
4451
Button(action: { dismiss() }) {
4552
Image(systemName: "xmark.circle.fill")
@@ -56,9 +63,6 @@ struct LoopInsights_TrendsInsightsView: View {
5663
}
5764
}
5865
}
59-
.onAppear {
60-
viewModel.loadIfNeeded(coordinator: coordinator)
61-
}
6266
.sheet(isPresented: $showingChat) {
6367
NavigationView {
6468
LoopInsights_ChatView(
@@ -238,12 +242,12 @@ struct LoopInsights_TrendsInsightsView: View {
238242
.foregroundColor(.purple.opacity(0.8))
239243
Text(NSLocalizedString("Summary", comment: "LoopInsights trends summary header"))
240244
.font(.subheadline.weight(.semibold))
241-
.foregroundColor(.white.opacity(0.9))
245+
.foregroundColor(.white)
242246
}
243247

244248
Text(summary)
245249
.font(.subheadline)
246-
.foregroundColor(.white.opacity(0.78))
250+
.foregroundColor(.white)
247251
.textSelection(.enabled)
248252
.fixedSize(horizontal: false, vertical: true)
249253
}
@@ -262,7 +266,7 @@ struct LoopInsights_TrendsInsightsView: View {
262266
.foregroundColor(.yellow.opacity(0.8))
263267
Text(NSLocalizedString("Highlights", comment: "LoopInsights trends highlights header"))
264268
.font(.subheadline.weight(.semibold))
265-
.foregroundColor(.white.opacity(0.9))
269+
.foregroundColor(.white)
266270
}
267271

268272
ForEach(highlights.indices, id: \.self) { index in
@@ -271,7 +275,7 @@ struct LoopInsights_TrendsInsightsView: View {
271275
.foregroundColor(.purple.opacity(0.8))
272276
Text(highlights[index])
273277
.font(.subheadline)
274-
.foregroundColor(.white.opacity(0.78))
278+
.foregroundColor(.white)
275279
.fixedSize(horizontal: false, vertical: true)
276280
}
277281
}
@@ -354,18 +358,18 @@ struct LoopInsights_TrendsInsightsView: View {
354358
.foregroundColor(.purple.opacity(0.8))
355359
Text(title)
356360
.font(.subheadline.weight(.semibold))
357-
.foregroundColor(.white.opacity(0.9))
361+
.foregroundColor(.white)
358362
}
359363

360364
ForEach(rows.indices, id: \.self) { index in
361365
HStack {
362366
Text(rows[index].0)
363367
.font(.caption)
364-
.foregroundColor(.white.opacity(0.55))
368+
.foregroundColor(.white.opacity(0.7))
365369
Spacer()
366370
Text(rows[index].1)
367371
.font(.caption.weight(.medium))
368-
.foregroundColor(.white.opacity(0.85))
372+
.foregroundColor(.white)
369373
}
370374
if index < rows.count - 1 {
371375
Divider()

0 commit comments

Comments
 (0)