commit 414892113f35692ea7cf0f8d79233f6eba52ee76
parent 92774323a2c928807f1f3821c7bf9661b0bc711a
Author: Michael Camilleri <[email protected]>
Date: Sat, 17 Oct 2026 10:00:13 +0900
Use 'Instant Report' in UI
Diffstat
| M | Notes/Design.md | | | 10 | +++++----- |
| M | Reportage/Services/Prompts/PromptNotification.swift | | | 10 | +++++----- |
| M | Reportage/Views/Settings/SettingsView.swift | | | 4 | ++-- |
| M | Shared/Capture/ContextCapture.swift | | | 2 | +- |
| M | Shared/Capture/PassiveLog.swift | | | 2 | +- |
| M | Tests/Unit/PromptSchedulerTests.swift | | | 6 | +++--- |
6 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/Notes/Design.md b/Notes/Design.md
@@ -23,7 +23,7 @@ should work, and how the Reporter archive maps in. - Wake and bedtime reports, started manually. - Question types: yes/no, multiple choice, tokens (free-form, growing vocabulary), people, location, number and note. -- Notification actions: **Log for Later** (create a passive report now, fill it +- Notification actions: **Instant Report** (create a passive report now, fill it in later) and **Snooze**. Tapping the notification opens the full survey. - Automatic context: location and placemark, weather, Health data (sleep, activity rings, steps, heart rate and so on), and device state (ambient noise, @@ -503,14 +503,14 @@ reminder, so a long stretch without opening the app ends with a nudge instead of silently stopping. Only the iPhone schedules prompts. watchOS mirrors iPhone notifications, -including their action buttons, so prompts and **Log for Later** work from the +including their action buttons, so prompts and **Instant Report** work from the wrist with no extra work. ### Notification actions Category `prompt`: -- **Log for Later** runs in the background. It creates a `passive` report with +- **Instant Report** runs in the background. It creates a `passive` report with `date` set to now, `promptedAt` set to the fire time, and captures live context. - **Snooze** runs in the background and schedules a one-off repeat of the @@ -526,7 +526,7 @@ passive reports logged from a notification get no location. The app asks for "When In Use" first and explains the trade-off before asking to upgrade. Turning prompts on asks for notification permission (alert, sound and badge) -and, once it's granted, explains why Log for Later wants 'Always' location +and, once it's granted, explains why Instant Report wants 'Always' location before asking for it. Whether a capture started from a background action gets a fix with 'Always' needs checking on a device. @@ -589,7 +589,7 @@ when the survey opens, so the fix describes the moment of the report, and a place answer records the fix as where it was given. 'Always' is requested later, as an upgrade, when the user turns on prompts in -Phase 3: Log for Later records location without opening the app, and asking +Phase 3: Instant Report records location without opening the app, and asking before any feature needs it would leave the request unexplained (and invite App Review questions). `LocationAuthorization.requestAlways()` is ready for that.
diff --git a/Reportage/Services/Prompts/PromptNotification.swift b/Reportage/Services/Prompts/PromptNotification.swift
@@ -6,7 +6,7 @@ import UserNotifications
enum PromptNotification {
static let promptCategory = "prompt"
static let reminderCategory = "reminder"
- static let logAction = "log-for-later"
+ static let instantReportAction = "instant-report"
static let snoozeAction = "snooze"
/// Where a snoozed prompt keeps when the original prompt fired, as
@@ -25,12 +25,12 @@ enum PromptNotification {
identifier.split(separator: ".", maxSplits: 1).first.flatMap { Kind(rawValue: String($0)) }
}
- /// Log for Later and Snooze both run in the background: neither opens
+ /// Instant Report and Snooze both run in the background: neither opens
/// the app.
static var categories: Set<UNNotificationCategory> {
let log = UNNotificationAction(
- identifier: logAction,
- title: String(localized: "Log for Later", comment: "Notification action that logs an instant report"),
+ identifier: instantReportAction,
+ title: String(localized: "Instant Report", comment: "Notification action that logs an instant report"),
icon: UNNotificationActionIcon(systemImageName: "bolt.fill"))
let snooze = UNNotificationAction(
identifier: snoozeAction,
@@ -130,7 +130,7 @@ struct PromptResponder: Sendable {
) async throws -> SurveyRequest? {
guard response.category == PromptNotification.promptCategory else { return nil }
switch response.action {
- case PromptNotification.logAction:
+ case PromptNotification.instantReportAction:
try await PassiveLog(store: store, capture: capture)
.log(kind: .random, trigger: .notification, date: now, promptedAt: response.firedAt)
return nil
diff --git a/Reportage/Views/Settings/SettingsView.swift b/Reportage/Views/Settings/SettingsView.swift
@@ -93,7 +93,7 @@ struct SettingsView: View {
Button("Not Now", role: .cancel) {}
} message: {
Text(
- "Log for Later records a report without opening Reportage. To include where you are, Reportage needs location access set to Always. Without it, these reports are saved without a location."
+ "Instant Report records a report from a notification without opening Reportage. To include where you are, Reportage needs location access set to Always. Without it, these reports are saved without a location."
)
}
.onDisappear { locationSession?.invalidate() }
@@ -115,7 +115,7 @@ struct SettingsView: View {
/// Turning prompts on asks for notifications first (with the badge,
/// which counts instant reports), then offers the upgrade to 'Always'
- /// location that Log for Later needs.
+ /// location that the Instant Report action needs.
private var promptsEnabled: Binding<Bool> {
Binding(
get: { settings.isEnabled },
diff --git a/Shared/Capture/ContextCapture.swift b/Shared/Capture/ContextCapture.swift
@@ -240,7 +240,7 @@ extension Placemark {
enum LocationAuthorization {
/// Asks to upgrade to 'Always'. iOS asks for this only after 'While
/// Using' has been granted. Phase 3 calls it when the user turns on
- /// prompts, because Log for Later records location from a notification
+ /// prompts, because Instant Report records location from a notification
/// without opening the app; asking before then would leave the request
/// unexplained.
static func requestAlways() -> CLServiceSession {
diff --git a/Shared/Capture/PassiveLog.swift b/Shared/Capture/PassiveLog.swift
@@ -1,7 +1,7 @@
import Foundation
/// Logs the moment: a report with its context and no answers, from a quick
-/// log or Log for Later. It appears in the timeline straight away and can be
+/// log or a notification's Instant Report action. It appears in the timeline straight away and can be
/// filled in at any time, or left as it is.
struct PassiveLog: Sendable {
let store: ReportStore
diff --git a/Tests/Unit/PromptSchedulerTests.swift b/Tests/Unit/PromptSchedulerTests.swift
@@ -147,10 +147,10 @@ struct PromptResponderTests {
promptedAt: snoozed ? firedAt : nil)
}
- @Test("Log for Later saves an instant random report prompted when the prompt first fired")
- func logForLater() async throws {
+ @Test("Instant Report saves an instant random report prompted when the prompt first fired")
+ func instantReport() async throws {
let survey = try await responder.respond(
- to: Self.response(PromptNotification.logAction, snoozed: true),
+ to: Self.response(PromptNotification.instantReportAction, snoozed: true),
settings: PromptSettings(), now: Self.now)
#expect(survey == nil)