feat: East Africa + Southern Africa pills with regional sub-sections
Some checks failed
CI / Build · macos-14 · Debug (push) Has been cancelled
CI / Build · macos-15 · Debug (push) Has been cancelled
CI / Build · macos-14 · Release (push) Has been cancelled
CI / Build · macos-15 · Release (push) Has been cancelled

- East Africa pill: merges Uganda + east-africa tags; Uganda pinned first via sub-sections
- Southern Africa pill: covers SA, Namibia, Botswana, Zimbabwe, Zambia, Mozambique; SA/Namibia/Botswana prioritized
- StoryStore.setPill now resets lastSyncedAt to bypass 30s rate-limit on filter switch
- sectionSupplement background fetch populates sparse regional sections in All digest
- SignalFeedView digestContent: flat hero+scroll path for pills without subSections (was showing max 5)
- Theme: removed standalone Uganda pill, wired new sub-section layouts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Robin Kutesa
2026-06-22 02:33:33 +03:00
parent 6677033faa
commit 595f21fb6c
27 changed files with 635 additions and 293 deletions

View File

@@ -15,7 +15,7 @@ struct NotificationsView: View {
var body: some View {
ZStack {
Color.black.ignoresSafeArea()
Palette.background.ignoresSafeArea()
ScrollView {
VStack(alignment: .leading, spacing: 24) {
header
@@ -46,7 +46,7 @@ struct NotificationsView: View {
// MARK: - Header
private var header: some View {
Text("Notifications").font(.system(size: 22, weight: .heavy)).foregroundStyle(.white)
Text("Notifications").font(.system(size: 22, weight: .heavy)).foregroundStyle(Palette.primaryText)
.padding(.top, 4)
}
@@ -78,8 +78,8 @@ struct NotificationsView: View {
divider
HStack(spacing: 14) {
Image(systemName: "dial.medium").font(.system(size: 18))
.foregroundStyle(Color(hex: "999999")).frame(width: 26)
Text("Only above signal").font(.system(size: 15, weight: .bold)).foregroundStyle(.white)
.foregroundStyle(Palette.secondaryText).frame(width: 26)
Text("Only above signal").font(.system(size: 15, weight: .bold)).foregroundStyle(Palette.primaryText)
Spacer()
Stepper(value: $settings.breakingMinSignal, in: 0...100, step: 5) {}
.labelsHidden().fixedSize()
@@ -103,8 +103,8 @@ struct NotificationsView: View {
divider
HStack(spacing: 14) {
Image(systemName: "clock").font(.system(size: 18))
.foregroundStyle(Color(hex: "999999")).frame(width: 26)
Text("Time").font(.system(size: 15, weight: .bold)).foregroundStyle(.white)
.foregroundStyle(Palette.secondaryText).frame(width: 26)
Text("Time").font(.system(size: 15, weight: .bold)).foregroundStyle(Palette.primaryText)
Spacer()
DatePicker("", selection: timeBinding(hour: hour, minute: minute),
displayedComponents: .hourAndMinute)
@@ -142,13 +142,13 @@ struct NotificationsView: View {
divider
HStack(spacing: 14) {
Image(systemName: "mappin.and.ellipse").font(.system(size: 18))
.foregroundStyle(Color(hex: "999999")).frame(width: 26)
.foregroundStyle(Palette.secondaryText).frame(width: 26)
VStack(alignment: .leading, spacing: 3) {
Text("Location").font(.system(size: 12)).foregroundStyle(Color(hex: "888888"))
TextField("", text: $settings.locationName,
prompt: Text("Kampala").foregroundColor(Color(hex: "444444")))
prompt: Text("Kampala").foregroundColor(Palette.mutedText))
.font(.system(size: 16, weight: .regular))
.foregroundStyle(.white)
.foregroundStyle(Palette.primaryText)
.autocorrectionDisabled()
.onSubmit { resolveLocation() }
if let place = settings.resolvedPlace {
@@ -180,7 +180,7 @@ struct NotificationsView: View {
private var testButton: some View {
Button { Task { await manager.sendTestBriefing() } } label: {
Text("Send a test briefing")
.font(.system(size: 15, weight: .bold)).foregroundStyle(.white)
.font(.system(size: 15, weight: .bold)).foregroundStyle(Palette.primaryText)
.frame(maxWidth: .infinity).frame(height: 50)
.background(Palette.surface2).clipShape(RoundedRectangle(cornerRadius: 14))
}
@@ -193,7 +193,7 @@ struct NotificationsView: View {
private func section<C: View>(_ label: String, @ViewBuilder _ content: () -> C) -> some View {
VStack(alignment: .leading, spacing: 10) {
Text(label).font(.system(size: 11, weight: .bold, design: .monospaced))
.kerning(0.8).foregroundStyle(Color(hex: "555555"))
.kerning(0.8).foregroundStyle(Palette.tertiaryText)
VStack(spacing: 0) { content() }
.background(Palette.surface).clipShape(RoundedRectangle(cornerRadius: 14))
}
@@ -201,10 +201,10 @@ struct NotificationsView: View {
private func toggleRow(icon: String, title: String, subtitle: String, isOn: Binding<Bool>) -> some View {
HStack(spacing: 14) {
Image(systemName: icon).font(.system(size: 18)).foregroundStyle(Color(hex: "999999")).frame(width: 26)
Image(systemName: icon).font(.system(size: 18)).foregroundStyle(Palette.secondaryText).frame(width: 26)
Toggle(isOn: isOn) {
VStack(alignment: .leading, spacing: 3) {
Text(title).font(.system(size: 16, weight: .heavy)).foregroundStyle(.white)
Text(title).font(.system(size: 16, weight: .heavy)).foregroundStyle(Palette.primaryText)
Text(subtitle).font(.system(size: 12)).foregroundStyle(Color(hex: "888888"))
.fixedSize(horizontal: false, vertical: true)
}

View File

@@ -8,6 +8,7 @@ struct SettingsView: View {
@EnvironmentObject var settings: ServerSettings
@Environment(\.dismiss) private var dismiss
@Environment(\.modelContext) private var modelContext
@AppStorage("appearanceMode") private var appearanceMode: AppearanceMode = .dark
@Query private var cachedStories: [CachedStory]
@Query private var cachedArticles: [CachedArticle]
@State private var showClearConfirm = false
@@ -15,11 +16,15 @@ struct SettingsView: View {
var body: some View {
NavigationStack {
ZStack {
Color.black.ignoresSafeArea()
Palette.background.ignoresSafeArea()
ScrollView {
VStack(alignment: .leading, spacing: 26) {
header
group("APPEARANCE") {
appearancePicker
}
group("GENERAL") {
NavigationLink { NotificationsView() } label: {
row(icon: "bell.badge", title: "Notifications",
@@ -60,13 +65,47 @@ struct SettingsView: View {
}
}
private var appearancePicker: some View {
HStack(spacing: 14) {
Image(systemName: "circle.lefthalf.filled")
.font(.system(size: 18))
.foregroundStyle(Palette.secondaryText)
.frame(width: 26)
Text("Theme")
.font(.system(size: 16, weight: .heavy))
.foregroundStyle(Palette.primaryText)
Spacer()
HStack(spacing: 0) {
ForEach(AppearanceMode.allCases, id: \.self) { mode in
Button {
appearanceMode = mode
} label: {
Text(mode.label)
.font(.system(size: 12, weight: .bold))
.foregroundStyle(appearanceMode == mode ? .black : Palette.secondaryText)
.padding(.horizontal, 12)
.frame(height: 30)
.background(appearanceMode == mode ? Palette.orange : Color.clear)
.clipShape(Capsule())
}
.buttonStyle(.plain)
}
}
.background(Palette.surface2)
.clipShape(Capsule())
.overlay(Capsule().stroke(Palette.surface2, lineWidth: 0.5))
}
.padding(.horizontal, 14).padding(.vertical, 14)
.contentShape(Rectangle())
}
private var header: some View {
HStack {
Text("Settings").font(.system(size: 22, weight: .heavy)).foregroundStyle(.white)
Text("Settings").font(.system(size: 22, weight: .heavy)).foregroundStyle(Palette.primaryText)
Spacer()
Button { dismiss() } label: {
Image(systemName: "xmark").font(.system(size: 15, weight: .bold))
.foregroundStyle(Color(hex: "888888")).frame(width: 44, height: 44)
.foregroundStyle(Palette.secondaryText).frame(width: 44, height: 44)
}
}
.padding(.top, 8)
@@ -75,7 +114,7 @@ struct SettingsView: View {
private func group<C: View>(_ label: String, @ViewBuilder _ content: () -> C) -> some View {
VStack(alignment: .leading, spacing: 10) {
Text(label).font(.system(size: 11, weight: .bold, design: .monospaced))
.kerning(0.8).foregroundStyle(Color(hex: "555555"))
.kerning(0.8).foregroundStyle(Palette.tertiaryText)
VStack(spacing: 0) { content() }
.background(Palette.surface)
.clipShape(RoundedRectangle(cornerRadius: 14))
@@ -83,18 +122,19 @@ struct SettingsView: View {
}
private func row(icon: String, title: String, subtitle: String,
chevron: Bool = true, tint: Color = .white) -> some View {
HStack(spacing: 14) {
chevron: Bool = true, tint: Color? = nil) -> some View {
let resolvedTint = tint ?? Palette.primaryText
return HStack(spacing: 14) {
Image(systemName: icon).font(.system(size: 18))
.foregroundStyle(tint == .white ? Color(hex: "999999") : tint).frame(width: 26)
.foregroundStyle(tint == nil ? Palette.secondaryText : resolvedTint).frame(width: 26)
VStack(alignment: .leading, spacing: 2) {
Text(title).font(.system(size: 16, weight: .heavy)).foregroundStyle(tint).lineLimit(1)
Text(subtitle).font(.system(size: 12)).foregroundStyle(Color(hex: "888888")).lineLimit(1)
Text(title).font(.system(size: 16, weight: .heavy)).foregroundStyle(resolvedTint).lineLimit(1)
Text(subtitle).font(.system(size: 12)).foregroundStyle(Palette.secondaryText).lineLimit(1)
}
Spacer()
if chevron {
Image(systemName: "chevron.right").font(.system(size: 13, weight: .bold))
.foregroundStyle(Color(hex: "555555"))
.foregroundStyle(Palette.tertiaryText)
}
}
.padding(.horizontal, 14).padding(.vertical, 14).frame(minHeight: 44)