From a53b293528aecdfce75bbcd6dd9c53eb20395033 Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Fri, 23 Oct 2026 15:06:56 -0700 Subject: [PATCH] Use consistent plain-language snapshot reasons --- mac/Sources/Byre/Changes.swift | 2 +- mac/Sources/Byre/Chat.swift | 2 +- mac/Sources/Byre/Format.swift | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/mac/Sources/Byre/Changes.swift b/mac/Sources/Byre/Changes.swift index 34ced26..a5be566 100644 --- a/mac/Sources/Byre/Changes.swift +++ b/mac/Sources/Byre/Changes.swift @@ -371,7 +371,7 @@ private struct SnapWhere: View { HStack(spacing: 0) { Text("snapshot #\(n)") if let snap { - Text(" · \(snap.trigger.rawValue) · \(clockText(snap.createdAt))") + Text(" · \(snap.reason) · \(clockText(snap.createdAt))") } Text(" · ") step(n - 1, "← #\(n - 1)", snaps) diff --git a/mac/Sources/Byre/Chat.swift b/mac/Sources/Byre/Chat.swift index 02490e7..145dbb5 100644 --- a/mac/Sources/Byre/Chat.swift +++ b/mac/Sources/Byre/Chat.swift @@ -1929,7 +1929,7 @@ private struct SnapshotRow: View { } .font(Fonts.font(11)) .foregroundStyle(Palette.muted) - .help("\(snap.trigger.rawValue.replacingOccurrences(of: "_", with: " ")) · \(time)") + .help("\(snap.reason) · \(time)") } } diff --git a/mac/Sources/Byre/Format.swift b/mac/Sources/Byre/Format.swift index deedec1..b01c1ee 100644 --- a/mac/Sources/Byre/Format.swift +++ b/mac/Sources/Byre/Format.swift @@ -165,6 +165,21 @@ func isoText(_ date: Date) -> String { date.formatted(Date.ISO8601FormatStyle(includingFractionalSeconds: true)) } +extension Snapshot { + var reason: String { + switch trigger { + case .message: "agent message" + case .turnEnd: "turn ended" + case .toolCall: "tool call" + case .askHuman: "question asked" + case .timer: "periodic snapshot" + case .requested: "snapshot requested" + case .answer: "before delivering an answer" + case .fork: "before forking" + } + } +} + func clockText(_ d: Date) -> String { d.formatted(Date.VerbatimFormatStyle(format: "\(hour: .twoDigits(clock: .twentyFourHour, hourCycle: .zeroBased)):\(minute: .twoDigits):\(second: .twoDigits)", timeZone: .current, calendar: .current)) }