commit dbc94ee1ebc9ac84b94fab5fe2728d15cbfa3ea5
parent aaaca2d8aad86d0278ea854dc44e0220b951cc74
Author: Michael Camilleri <[email protected]>
Date: Tue, 20 Oct 2026 13:18:13 +0900
Add an About screen
Diffstat
| M | Reportage.xcodeproj/project.pbxproj | | | 4 | ++++ |
| A | Reportage/Views/Settings/AboutView.swift | | | 121 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| M | Reportage/Views/Settings/SettingsView.swift | | | 6 | ++++++ |
3 files changed, 131 insertions(+), 0 deletions(-)
diff --git a/Reportage.xcodeproj/project.pbxproj b/Reportage.xcodeproj/project.pbxproj
@@ -57,6 +57,7 @@
964408E4D25713F627048C77 /* ModelCodingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C606A9B0EF8D84950B9681B /* ModelCodingTests.swift */; };
97BC8348B7F48AF0473691FC /* ReportStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28AD66BC8ED4AEABF6640108 /* ReportStore.swift */; };
9EF3CB3707CD6B5AFFD3B767 /* ReporterArchive.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC1C5F0F722477CDA949F018 /* ReporterArchive.swift */; };
+ 9F26886E122721BB3F2AFE7F /* AboutView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1AD7CB7E9FF6D01BF4CE8617 /* AboutView.swift */; };
9FD499B8FACD1BA034804590 /* QuestionListTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E6B536B922A8468136815CD /* QuestionListTests.swift */; };
9FEE3B78B770C6A3CF9C6610 /* QuestionsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F9A0A87A54F3E96E079F52D /* QuestionsView.swift */; };
A1FBFB9809DD3FF52BD7E5A7 /* DataSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA2E66BAB2463FD51EFE9F52 /* DataSection.swift */; };
@@ -133,6 +134,7 @@
0734316A58943D5F2E26F718 /* ReportSummaryTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReportSummaryTests.swift; sourceTree = "<group>"; };
0B35602A218BE4EE399835FD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
0E6B536B922A8468136815CD /* QuestionListTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuestionListTests.swift; sourceTree = "<group>"; };
+ 1AD7CB7E9FF6D01BF4CE8617 /* AboutView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutView.swift; sourceTree = "<group>"; };
1B5C26C38B8B25086810CAB1 /* HealthReader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HealthReader.swift; sourceTree = "<group>"; };
1B6C4141A26EED99B1F03FBE /* PlacePickerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlacePickerTests.swift; sourceTree = "<group>"; };
1BBAB5AD6266B8F6E3507AE3 /* ReportSummary.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReportSummary.swift; sourceTree = "<group>"; };
@@ -461,6 +463,7 @@
B74082E720FBA1EF05FE11E4 /* Settings */ = {
isa = PBXGroup;
children = (
+ 1AD7CB7E9FF6D01BF4CE8617 /* AboutView.swift */,
CA2E66BAB2463FD51EFE9F52 /* DataSection.swift */,
87545A7909A370C668314DFF /* DiagnosticsSection.swift */,
F832E0B277D5BF5BC3B6E5D1 /* NotificationsView.swift */,
@@ -683,6 +686,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ 9F26886E122721BB3F2AFE7F /* AboutView.swift in Sources */,
81B485BD03549DE6E7AA94A7 /* AppBadge.swift in Sources */,
B454D3067CD611AE55E30A1D /* AppDelegate.swift in Sources */,
E8C13757BF3E2C8384F104A1 /* AppleWeather.swift in Sources */,
diff --git a/Reportage/Views/Settings/AboutView.swift b/Reportage/Views/Settings/AboutView.swift
@@ -0,0 +1,121 @@
+import SwiftUI
+
+/// The app's name, version and credits, with links to its website and
+/// source.
+struct AboutView: View {
+ private var appVersion: String {
+ Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "Unknown"
+ }
+
+ private var buildNumber: String {
+ Bundle.main.infoDictionary?["CFBundleVersion"] as? String ?? "Unknown"
+ }
+
+ var body: some View {
+ List {
+ Section {
+ AboutHeader(appVersion: appVersion, buildNumber: buildNumber)
+ .frame(maxWidth: .infinity)
+ .padding(.vertical, 12)
+ .listRowBackground(Theme.paper)
+ .listRowSeparator(.hidden)
+ }
+ Section {
+ Link(destination: URL(string: "https://apps.inqk.net/reportage")!) {
+ Label("Website", systemImage: "globe")
+ }
+ .settingsRow()
+ Link(destination: URL(string: "https://code.inqk.net/reportage")!) {
+ Label("Source Code", systemImage: "chevron.left.forwardslash.chevron.right")
+ }
+ .settingsRow()
+ }
+ Section {
+ Text("Thank you to my wife, daughter and sons for their love and inspiration.")
+ .font(.subheadline)
+ .foregroundStyle(Theme.muted)
+ .multilineTextAlignment(.center)
+ .frame(maxWidth: .infinity)
+ .padding(.top, 12)
+ .listRowInsets(EdgeInsets(top: 8, leading: Theme.margin, bottom: 8, trailing: Theme.margin))
+ .listRowBackground(Theme.paper)
+ .listRowSeparator(.hidden)
+ }
+ }
+ .listStyle(.plain)
+ .scrollContentBackground(.hidden)
+ .background(Theme.paper)
+ .foregroundStyle(Theme.ink)
+ .navigationTitle("About")
+ .navigationBarTitleDisplayMode(.inline)
+ .toolbar(.visible, for: .navigationBar)
+ }
+}
+
+/// The icon, name, version and credits at the top of the screen.
+struct AboutHeader: View {
+ let appVersion: String
+ let buildNumber: String
+
+ var body: some View {
+ VStack(spacing: 8) {
+ PlaceholderIcon()
+ .padding(.bottom, 4)
+ Text("Reportage\(Text(".").foregroundStyle(Theme.mark))", comment: "The app's name on the About screen, with a coloured full stop")
+ .font(Theme.serif(.title, weight: .medium))
+ .foregroundStyle(Theme.titleInk)
+ .accessibilityLabel(Text("Reportage"))
+ Text("Version \(appVersion) (\(buildNumber))")
+ .font(.subheadline)
+ .foregroundStyle(Theme.muted)
+ .padding(.bottom, 20)
+ Credit("Programming", name: "Claude Code")
+ .padding(.bottom, 8)
+ Credit("Direction", name: "Michael Camilleri")
+ }
+ }
+}
+
+/// A role and who filled it, the role in small spaced capitals.
+private struct Credit: View {
+ let role: LocalizedStringKey
+ let name: String
+
+ init(_ role: LocalizedStringKey, name: String) {
+ self.role = role
+ self.name = name
+ }
+
+ var body: some View {
+ VStack(spacing: 4) {
+ Text(role)
+ .eyebrow()
+ Text(verbatim: name)
+ .font(.subheadline)
+ }
+ .accessibilityElement(children: .combine)
+ }
+}
+
+/// Stands in for the app icon until there is one: the wordmark's initial
+/// and full stop on accent.
+private struct PlaceholderIcon: View {
+ var body: some View {
+ RoundedRectangle(cornerRadius: 22)
+ .fill(Theme.accent)
+ .frame(width: 100, height: 100)
+ .overlay {
+ Text(verbatim: "R.")
+ .font(.system(size: 56, weight: .medium, design: .serif))
+ .foregroundStyle(Theme.onAccent)
+ }
+ .accessibilityHidden(true)
+ }
+}
+
+#Preview {
+ NavigationStack {
+ AboutView()
+ }
+ .tint(Theme.accent)
+}
diff --git a/Reportage/Views/Settings/SettingsView.swift b/Reportage/Views/Settings/SettingsView.swift
@@ -32,6 +32,12 @@ struct SettingsView: View {
}
DataSection()
DiagnosticsSection()
+ Section {
+ NavigationLink("About") { AboutView() }
+ .settingsRow()
+ } header: {
+ SettingsHeading("Reportage")
+ }
#if DEBUG
WelcomeReplay { isShowingWelcome = true }
#endif