commit bc197e6e676956b5f60e053485caa4e7a495f80a
parent 10e80df6a2f34ccd4267252bcbc4c14795fbee7e
Author: Michael Camilleri <[email protected]>
Date: Tue, 2 Jun 2026 17:45:49 +0900
Add version information to diagnostic logs
Diffstat:
1 file changed, 11 insertions(+), 0 deletions(-)
diff --git a/Crossmate/Views/DiagnosticsView.swift b/Crossmate/Views/DiagnosticsView.swift
@@ -43,6 +43,7 @@ struct DiagnosticsView: View {
var body: some View {
List {
Section("Status") {
+ row("Version", versionText)
row("Account Status", accountStatusText)
row("Engine Running", boolText(syncMonitor.snapshot?.engineRunning))
row("Pending Changes", syncMonitor.snapshot.map { String($0.pendingChangesCount) } ?? "Unknown")
@@ -195,8 +196,18 @@ struct DiagnosticsView: View {
return value ? "Yes" : "No"
}
+ /// Marketing version and build number from the bundle. The build number is
+ /// the commit count (set by the release script), so it pins a pasted log to
+ /// an exact commit — the key lever for debugging what a tester is running.
+ private var versionText: String {
+ let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "Unknown"
+ let build = Bundle.main.infoDictionary?["CFBundleVersion"] as? String ?? "Unknown"
+ return "\(version) (\(build))"
+ }
+
private var diagnosticDump: String {
var lines: [String] = []
+ lines.append("Version: \(versionText)")
lines.append("Account Status: \(accountStatusText)")
lines.append("Engine Running: \(boolText(syncMonitor.snapshot?.engineRunning))")
lines.append("Pending Changes: \(syncMonitor.snapshot.map { String($0.pendingChangesCount) } ?? "Unknown")")