commit 069c769dfd327b196cb19d66da45f5687d26fb96
parent fc449922b736704ce095514aa1da38c808308952
Author: Jean Schurger <jean@schurger.org>
Date: Sat, 14 Nov 2026 15:48:42 -0500
Last-trial diagnostics: cleared at every trial, workout state and app build shown
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K7deYJa9LG8PgUSQ5UR5LY
Diffstat:
3 files changed, 31 insertions(+), 0 deletions(-)
diff --git a/OpenRemoraWatch/DiveSession.swift b/OpenRemoraWatch/DiveSession.swift
@@ -137,8 +137,10 @@ final class DiveSession {
private func startDiveSession() {
guard SubmersionSource.isAvailable else { return }
if workout.state == .running {
+ diagnostics.workout = String(localized: "running")
diagnostics.runtime = String(localized: "not requested (workout running)")
} else {
+ diagnostics.workout = workout.lastError ?? String(localized: "not started")
runtime.start()
}
Task { [diagnostics] in
@@ -297,6 +299,7 @@ final class Diagnostics {
private(set) var deepestPress: Double?
var runtime: String { didSet { defaults.set(runtime, forKey: "diag.runtime") } }
var donation: String { didSet { defaults.set(donation, forKey: "diag.donation") } }
+ var workout: String { didSet { defaults.set(workout, forKey: "diag.workout") } }
private(set) var startedAt: Date?
/// The watch reported its screen as locked during the session.
var lockSeen: Bool { didSet { defaults.set(lockSeen, forKey: "diag.lock") } }
@@ -307,6 +310,7 @@ final class Diagnostics {
deepestPress = defaults.object(forKey: "diag.deepest") as? Double
runtime = defaults.string(forKey: "diag.runtime") ?? String(localized: "never requested")
donation = defaults.string(forKey: "diag.donation") ?? String(localized: "never donated")
+ workout = defaults.string(forKey: "diag.workout") ?? "–"
startedAt = defaults.object(forKey: "diag.start") as? Date
}
@@ -314,6 +318,10 @@ final class Diagnostics {
presses = 0
deepestPress = nil
lockSeen = false
+ // Nothing left from an earlier trial (or an earlier build): every line is about this one.
+ runtime = "–"
+ donation = "–"
+ workout = "–"
startedAt = Date()
defaults.set(0, forKey: "diag.presses")
defaults.removeObject(forKey: "diag.deepest")
diff --git a/OpenRemoraWatch/Localizable.xcstrings b/OpenRemoraWatch/Localizable.xcstrings
@@ -1251,6 +1251,16 @@
}
}
},
+ "Workout: %@": {
+ "localizations": {
+ "fr": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Séance d'entraînement : %@"
+ }
+ }
+ }
+ },
"Yes": {
"localizations": {
"fr": {
@@ -1421,6 +1431,16 @@
}
}
},
+ "not started": {
+ "localizations": {
+ "fr": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "non démarrée"
+ }
+ }
+ }
+ },
"ppO2": {
"localizations": {
"fr": {
diff --git a/OpenRemoraWatch/RootView.swift b/OpenRemoraWatch/RootView.swift
@@ -219,11 +219,14 @@ struct DiagnosticsRows: View {
Text("deepest at \(Format.depth(depth)) m").foregroundStyle(.secondary)
}
Text("Next action: \(d.donation)").foregroundStyle(.secondary)
+ Text("Workout: \(d.workout)").foregroundStyle(.secondary)
Text("Dive session: \(d.runtime)").foregroundStyle(.secondary)
Text(d.lockSeen ? "Screen lock: seen" : "Screen lock: not seen").foregroundStyle(.secondary)
if let start = d.startedAt {
Text(start.formatted(date: .abbreviated, time: .shortened)).foregroundStyle(.secondary)
}
+ Text(verbatim: "Open Rémora \(Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "?") (\(Bundle.main.infoDictionary?["CFBundleVersion"] as? String ?? "?"))")
+ .foregroundStyle(.secondary)
}
.font(.caption2)
}