diff --git a/KisaniCal/Views/SettingsView.swift b/KisaniCal/Views/SettingsView.swift index 738b16d..3c8f3b7 100644 --- a/KisaniCal/Views/SettingsView.swift +++ b/KisaniCal/Views/SettingsView.swift @@ -1,5 +1,14 @@ import SwiftUI +extension Bundle { + /// Public marketing version, e.g. "2.0". + var marketingVersion: String { infoDictionary?["CFBundleShortVersionString"] as? String ?? "—" } + /// Build number, e.g. "9". + var buildNumber: String { infoDictionary?["CFBundleVersion"] as? String ?? "" } + /// Combined display, e.g. "2.0 (9)" — single source of truth for any UI showing the version. + var versionDisplay: String { buildNumber.isEmpty ? marketingVersion : "\(marketingVersion) (\(buildNumber))" } +} + struct SettingsView: View { @Environment(\.colorScheme) var cs @EnvironmentObject var workoutVM: WorkoutViewModel @@ -158,8 +167,8 @@ struct SettingsView: View { // ── SUPPORT ── SttSection(label: "Support", secondary: true) { SttNavRow(icon: "star", bg: AppColors.yellowSoft, fg: AppColors.yellow, label: "Help & Feedback") { showHelp = true } - SttNavRow(icon: "message", bg: AppColors.blueSoft, fg: AppColors.blue, label: "Follow Us", value: "𝕏 👾 📸") { showFollow = true } - SttNavRow(icon: "info.circle", bg: AppColors.surface3(cs), label: "About", value: "v1.0.0", isLast: true) { showAbout = true } + SttNavRow(icon: "message", bg: AppColors.blueSoft, fg: AppColors.blue, label: "Follow Us") { showFollow = true } + SttNavRow(icon: "info.circle", bg: AppColors.surface3(cs), label: "About", value: "v\(Bundle.main.marketingVersion)", isLast: true) { showAbout = true } } Spacer().frame(height: 40) @@ -1351,7 +1360,7 @@ private struct AboutSheet: View { .font(.system(size: 48, weight: .light)).foregroundColor(AppColors.accent) VStack(spacing: 4) { Text("Wenza").font(AppFonts.sans(20, weight: .bold)).foregroundColor(AppColors.text(cs)) - Text("Version 1.0.0").font(AppFonts.mono(11)).foregroundColor(AppColors.text3(cs)) + Text("Version \(Bundle.main.versionDisplay)").font(AppFonts.mono(11)).foregroundColor(AppColors.text3(cs)) } Text("A calm, focused productivity app for tasks, calendar, and fitness.") .font(AppFonts.sans(13)).foregroundColor(AppColors.text2(cs)) diff --git a/KisaniCalWidgets/MyTasksWidget.swift b/KisaniCalWidgets/MyTasksWidget.swift index 7a889de..4ccf7b7 100644 --- a/KisaniCalWidgets/MyTasksWidget.swift +++ b/KisaniCalWidgets/MyTasksWidget.swift @@ -111,7 +111,7 @@ struct MyTasksView: View { if entry.tasks.isEmpty { Spacer() - Text("All clear for today 🎉") + Text("All clear for today") .font(.system(.caption, design: .monospaced)) .foregroundColor(Color(white: 0.5)) .frame(maxWidth: .infinity, alignment: .center)