commit d65dee9a913e7c99acfe6049b66b63c9231c0aea
parent 0ddad8208818d31a641ecc432ead42a7267a837f
Author: Michael Camilleri <[email protected]>
Date: Sun, 18 Oct 2026 07:41:51 +0900
Reword prompt notifications
This commit rewords prompt notifications. It gives the notifications a
title and simplifies the body.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat
| M | Notes/Design.md | | | 239 | ++++++++++++++++++++++++++++++++++++------------------------------------------- |
| M | Reportage/Services/Prompts/PromptNotification.swift | | | 10 | ++++++++-- |
2 files changed, 117 insertions(+), 132 deletions(-)
diff --git a/Notes/Design.md b/Notes/Design.md
@@ -11,8 +11,8 @@ random times during the day, each prompting a short survey about the user's
current state. Each report also captures context automatically (location,
weather, motion, device state). The accumulated data is the product.
-This note records the decisions made so far, the data model, how each subsystem
-should work, and how the Reporter archive maps in.
+This note describes the design: the data model, how each subsystem works, and
+how the Reporter archive maps in.
## Scope
@@ -85,8 +85,8 @@ The look is called Almanac: ink on paper, like a printed journal.
as dates and report kinds use small spaced capitals. Screen titles are the
serif in a warm ink softer than the text's; 'Reportage.' over the timeline
is a wordmark: italic, with its full stop in a brighter auburn (rust) than
- the accent, since a mark that small has to stand out by colour alone. All sizes are Dynamic
- Type styles.
+ the accent, since a mark that small has to stand out by colour alone. All
+ sizes are Dynamic Type styles.
- **Tabs:** Timeline and Settings, with Visualisations joining them in
Phase 7. The timeline keeps its serif 'Reportage' title, beside the quick
log and new report buttons. A tapped prompt switches to the timeline to
@@ -96,30 +96,28 @@ The look is called Almanac: ink on paper, like a printed journal.
fit one column), its kind, its entry, any answers the entry doesn't cover,
and a line of context: the city with its region ('Suginami, Tokyo', put
together from the locality and region for imported placemarks) and the
- weather. Days are grouped in the
- device's time zone: grouping by each report's own zone would put reports out
- of order around midnight after a change of zone, which a sectioned fetch
- can't show. Grouping by a computed day loads every report the fetch
- covers, and regroups them all whenever one changes (0.6 s and 0.25 s over
- the imported archive), so the list covers the newest 300 reports to the
- start of a day, and reaches back 500 more each time it's scrolled to its
- end.
+ weather. Days are grouped in the device's time zone: grouping by each
+ report's own zone would put reports out of order around midnight after a
+ change of zone, which a sectioned fetch can't show. Grouping by a computed
+ day loads every report the fetch covers, and regroups them all whenever one
+ changes, so the list covers the newest 300 reports back to the start of a
+ day, and reaches back 500 more each time it's scrolled to its end.
- **Report detail:** tapping a report in the timeline pushes its detail view:
the day, the time in the report's own zone and its kind, a map of where it
- was made (with a circle for the fix's accuracy), every
- answer with the prompt it was asked under ('Skipped' for questions left
- unanswered), then every value recorded with it, in titled
- sections (Time, Place, Location, Weather, Device, Motion, Sound, Photos,
- Record) of label and value rows; the address in the place's own language
- is labelled 'Endonymic Address'. The map can be panned and zoomed, but not
- rotated; once moved, a button in its corner brings it back to the
- report's spot. It has no zoom buttons, as maps on iPhone don't. The entry isn't repeated here. Activities
- and people are shown as pills, one per token, since an answer can have
- several: the name in the serif on a faint wash of the accent, quieter than
- the survey's ink-filled tokens, which can be tapped where these can't. Measurements are shown in the user's
- locale's units. Edit (or Answer, for an instant report) opens the survey,
- and Delete Report deletes it after asking. Deleting removes the report and
- its responses but keeps its tokens; sync will need to carry deletions.
+ was made (with a circle for the fix's accuracy), every answer with the
+ prompt it was asked under ('Skipped' for questions left unanswered), then
+ every value recorded with it, in titled sections (Time, Place, Location,
+ Weather, Device, Motion, Sound, Photos, Record) of label and value rows; the
+ address in the place's own language is labelled 'Endonymic Address'. The
+ map can be panned and zoomed, but not rotated; once moved, a button in its
+ corner brings it back to the report's spot. It has no zoom buttons, as maps
+ on iPhone don't. The entry isn't repeated here. Activities and people are
+ shown as pills, one per token, since an answer can have several: the name
+ in the serif on a faint wash of the accent, quieter than the survey's
+ ink-filled tokens, which can be tapped where these can't. Measurements are
+ shown in the user's locale's units. Edit (or Answer, for an instant report)
+ opens the survey, and Delete Report deletes it after asking. Deleting
+ removes the report and its responses but keeps its tokens.
- **Survey:** a flat header (Cancel, the kind and time, '3 / 6' and a progress
bar with a segment per question) instead of the glass toolbar, a serif
prompt, ink-outlined answer buttons, chips for chosen tokens and an
@@ -178,12 +176,13 @@ app text (so they're translated when shown) and which can only be switched on
or off and moved between surveys, plus custom questions the user writes with
their own display rule. The built-in set should reuse Reporter's built-in
question IDs, so imported answers map onto it directly: 7 of the 8 questions
-in the real export are Reporter's own. Today the default questions get their
-rules from `DisplayRule.builtIn`, keyed by ID, and Reporter's seven built-in
-questions (`default-question-1` to `-7`) share the rules of the defaults that
-ask the same things, so imported answers read as entries too. This assumes
-an ID keeps its meaning: a Reporter user who reworded a built-in question
-would get the wrong phrasing until the built-in set is settled.
+in the real export are Reporter's own.
+
+Until then, the default questions get their rules from `DisplayRule.builtIn`,
+keyed by ID, and Reporter's seven built-in questions (`default-question-1` to
+`-7`) share the rules of the defaults that ask the same things, so imported
+answers read as entries too. This assumes an ID keeps its meaning: a Reporter
+question the user reworded gets the wrong phrasing.
### Report
@@ -425,10 +424,10 @@ with these instructions:
- **Protection.** People, quoted notes and every word with letters outside
ASCII are swapped for placeholders (`X1`, `X2`…) first and put back
- afterwards. The model romanises Japanese names whatever it's told (吉祥寺駅
- became 'Kyoji-ji Station', 'Yoshioji Station' and so on), and strips accents
- ('Lumière'). Placeholders must look like ordinary words: bracketed ones such
- as `[[1]]` were rewritten.
+ afterwards, because the model romanises Japanese names whatever it's told
+ (吉祥寺駅 becomes 'Kyoji-ji Station') and strips accents ('Lumière').
+ Placeholders look like ordinary words, since the model rewrites bracketed
+ ones such as `[[1]]`.
- **The check.** `NarrativeCheck` accepts the output only if every placeholder
appears exactly once, the number of sentences is unchanged, no content word
is added or dropped (connecting words such as 'the', 'and' and 'with' may
@@ -447,9 +446,9 @@ with these instructions:
wrote it (`NarrativePolisher.version`). Raising the version, when the
instructions or the check change, rewrites every entry the next time it's
shown.
-- One request runs at a time, responses are capped at 150 tokens (one input
- once made the model generate until its 8,192-token limit), and scrolling
- away cancels a waiting request.
+- One request runs at a time, responses are capped at 150 tokens so a
+ runaway response stops early rather than at the model's 8,192-token limit,
+ and scrolling away cancels a waiting request.
### When entries are written
@@ -461,36 +460,24 @@ rewritten the next time it's shown. A new report's entry is written as soon as
the survey closes, because it appears at the top of the list. Entries for an
imported archive are only ever written for the reports someone scrolls to.
-### What the spikes found
-
-Tested on the Mac's on-device model ('AFM 3 Core Advanced') with invented
-reports:
+### Why the model only proofreads
- **Writing entries from scratch** invents details (a kitchen table, a date, a
time of night), changes what notes mean, drops answers and assigns people to
- the wrong activities. Long cautious instructions made it either rewrite or
- return the draft unchanged.
-- **A short proofreading request** does the right job: articles ('at the
- library', 'at home'), casing and commas, consistently across runs. It's as
- good as the Shortcuts Proofread action, which apps can't call: Writing Tools
- (`UIWritingToolsCoordinator`) only works through its on-screen interface.
-- **With protection and the check,** 79 of 90 runs over 30 drafts passed, at
- about 0.27 s each. Nine of the eleven failures were one stiff phrase in the
- draft ('5.5 hours asleep', which the model always changed), so display rules
- should be written in natural English.
-- The model doesn't fix every place ('Gardening at Park' stayed), and results
- vary between runs, which is why the first passing result is stored.
- Planned per-token inline forms cover what it misses.
-
-Other options looked at:
-
-- **Private Cloud Compute** (`PrivateCloudComputeLanguageModel`, new in iOS 27)
- is off-device and rate-limited. It couldn't be tested from a command-line
- script (`ModelManagerError 1046`); testing it would need a signed build.
-- **Custom adapters** for the system model were removed in iOS 27. An app can
- instead plug its own model in through the now-public `LanguageModel`
- protocol: a small model trained for this one task is a possible upgrade if
- it clearly beats the current approach on a fixed test set.
+ the wrong activities. A short proofreading request does the right job:
+ articles ('at the library', 'at home'), casing and commas. Writing Tools
+ (`UIWritingToolsCoordinator`) would do the same, but only works through its
+ on-screen interface.
+- **Display rules are written in natural English.** The model reliably
+ rewrites stiff phrases ('5.5 hours asleep'), which fails the check.
+- **It doesn't fix every place** ('Gardening at Park' stays), which per-token
+ inline forms are planned to cover.
+- **A model of its own** is a possible upgrade: an app can plug one in
+ through the `LanguageModel` protocol (system model adapters are gone in
+ iOS 27). A small model trained for this one task would replace the system
+ model only if it clearly beats it on a fixed test set. Private Cloud
+ Compute (`PrivateCloudComputeLanguageModel`) is off-device and
+ rate-limited, so it isn't used.
## Prompt Scheduling
@@ -500,8 +487,8 @@ Settings (`PromptSettings`): prompts on or off, prompts per day `n` (default
4), a waking window (default 9:00 to 22:00, optionally different on weekends,
and able to run past midnight), a minimum gap between prompts (default 30
minutes) and the snooze length (default 15 minutes). Prompts are off until the
-user turns them on in Settings. The settings live in `UserDefaults` until
-Phase 4 moves them into the `Config` zone.
+user turns them on in Settings. The settings live in `UserDefaults`; with
+sync they move into the `Config` zone.
Times are **stratified random** (`PromptSchedule`). The waking window is split
into `n` equal slots with one time drawn uniformly in each. Unlike drawing `n`
@@ -532,9 +519,10 @@ for snoozes) and tops it up whenever the app gets execution time:
- saving a report
- a `BGAppRefreshTask`, requested about every six hours while prompts are on
-The last notification in the horizon is replaced by a "keep the prompts coming"
-reminder, so a long stretch without opening the app ends with a nudge instead
-of silently stopping.
+The last notification in the horizon is replaced by a reminder ('Reminders
+Ending: Open Reportage to keep reminders enabled.'), so a long stretch without
+opening the app ends with a nudge instead of silently stopping. Prompts
+themselves read 'Reporting Time: How are things going?'.
Only the iPhone schedules prompts. watchOS mirrors iPhone notifications,
including their action buttons, so prompts and **Instant Report** work from the
@@ -561,8 +549,7 @@ passive reports logged from a notification get no location. The app asks for
Turning prompts on asks for notification permission (alert, sound and badge)
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.
+before asking for it.
## Passive Reports and the Watch
@@ -571,26 +558,25 @@ appears in the timeline like any other report, labelled 'Instant', rather than
in a list of unfinished reports: some users will want to keep such reports as
they are, and shouldn't feel pressed to fill them in. Its detail view offers
**Answer**, which fills it in, answering the survey as of the report's
-original `date` with the context it was logged with. Only the answers and its completion are saved, so a context
-capture still under way isn't overwritten.
+original `date` with the context it was logged with. Only the answers and its
+completion are saved, so a context capture still under way isn't
+overwritten.
A passive report is saved as soon as it's logged, so it's in the timeline at
once, and its context is added when the capture finishes (`PassiveLog`). The
home screen's quick log button, a bolt beside the +, makes one without
-opening the survey. The badge counts passive reports; it shows only
-once notifications are allowed, which Phase 3 asks for, and could become a
-setting.
+opening the survey. The badge counts passive reports; it shows only once
+notifications are allowed, and could become a setting.
Any finished report can be edited the same way, with **Edit** in its detail
-view. The survey
-shows the questions the report answered, in its order and as they were asked,
-including archived ones, rather than today's survey: adding new questions to
-an old report would rewrite history. Answers using archived or merged tokens
-still show as chosen. An answer left as it was keeps its response exactly,
-with the prompt it was given under and where a place answer was given, and
-responses to questions that no longer exist are kept. A changed answer keeps
-its original prompt. The report keeps when it was completed; its entry is
-rewritten because its draft changes.
+view. The survey shows the questions the report answered, in its order and
+as they were asked, including archived ones, rather than today's survey:
+adding new questions to an old report would rewrite history. Answers using
+archived or merged tokens still show as chosen. An answer left as it was keeps
+its response exactly, with the prompt it was given under and where a place
+answer was given, and responses to questions that no longer exist are kept.
+A changed answer keeps its original prompt. The report keeps when it was
+completed; its entry is rewritten because its draft changes.
There's one App Intent, `LogPassiveReportIntent`, in `Shared/`. It drives every
quick-log surface:
@@ -601,13 +587,13 @@ quick-log surface:
- the Action button (iPhone and Apple Watch Ultra)
- Siri and Shortcuts
-**The Watch app is deferred.** On a device, a prompt mirrored to the Watch
-logged an instant report from the wrist, with the iPhone capturing its
-location in the background. A Watch app would still add logging without a
-prompt from the wrist, logging when the iPhone isn't nearby (prompts are
-scheduled on the phone, so none reach the Watch without it) and answering
-quick questions on the wrist. It's reconsidered if those are missed. The rest
-of this section describes it as planned.
+**The Watch app is deferred.** A prompt mirrored to the Watch already logs
+an instant report from the wrist, with the iPhone capturing its location in
+the background. A Watch app would add logging from the wrist without a
+prompt, logging when the iPhone isn't nearby (prompts are scheduled on the
+phone, so none reach the Watch without it) and answering quick questions on
+the wrist. It's reconsidered if those are missed. The rest of this section
+describes it as planned.
The Watch app is otherwise minimal: log, see recent passive reports, and
optionally answer the quick questions (yes/no and choice) on the wrist. Token,
@@ -631,25 +617,22 @@ for 'While Using' authorisation the first time a survey opens. Capture starts
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: 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.
+'Always' is requested later, as an upgrade, when the user turns on prompts
+(`LocationAuthorization.requestAlways()`): 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).
Addresses come from MapKit as `MKMapItem`s; the placemark keeps Reporter's
fields where they still exist, plus the language, the region code, the city
-with its region and the full and short addresses. In a Simulator test the
-whole capture took 0.2 s. Reverse
-geocoding uses MapKit's `MKReverseGeocodingRequest` (`CLGeocoder` is deprecated
-in iOS 26), using `preferredLocale`: once in the user's first language, and
-again in the place's local language when that differs (worked out from the
-first result's country: `ja` for Japan, `zh-Hant` for Taiwan), so the
-placemark can be shown by the same rule as place names. Reports made before
-this have their second address in the device's second preferred language. Reporter's archive
-mixes Japanese and English placemarks depending on the device language at the
-time. Apple throttles geocoding, so two requests per report is fine but
-re-geocoding the archive would have to run slowly in the background.
+with its region and the full and short addresses. Reverse geocoding uses
+MapKit's `MKReverseGeocodingRequest` (`CLGeocoder` is deprecated in iOS 26),
+using `preferredLocale`: once in the user's first language, and again in the
+place's local language when that differs (worked out from the first result's
+country: `ja` for Japan, `zh-Hant` for Taiwan), so the placemark can be shown
+by the same rule as place names. Reporter's archive mixes Japanese and English
+placemarks depending on the device language at the time. Apple throttles
+geocoding, so two requests per report is fine but re-geocoding the archive
+would have to run slowly in the background.
### Weather
@@ -662,10 +645,9 @@ This needs the WeatherKit entitlement, and the App ID needs WeatherKit
enabled. The report detail view shows the Apple Weather mark and a link to its
data sources beneath the Weather section of reports with WeatherKit weather.
-WeatherKit's
-historical hourly data goes back to August 2021, so the April 2023 to present
-gap in the Reporter archive can be backfilled (about 5,000 requests, well
-within the free quota). Backfilled values are tagged `source: weatherKit` and
+WeatherKit's historical hourly data goes back to August 2021, so the gap in
+the Reporter archive from April 2023 can be backfilled (about 5,000 requests,
+well within the free quota). Backfilled values are tagged `source: weatherKit` and
`backfilled: true`.
### Health
@@ -729,7 +711,8 @@ Sensitive fields (responses, context, legacy, token text and places) go in
Conflicts are resolved last-writer-wins per record using `modifiedAt`. Editing
the same report on two devices at once is rare enough not to need anything
-finer.
+finer. Deletions sync too: deleting a report deletes its record, and Delete
+All Data clears both zones, or the next fetch would bring everything back.
**The Watch only fetches the `Config` zone**
(`CKSyncEngine.FetchChangesOptions` scope). It writes passive reports into
@@ -813,12 +796,7 @@ Source: Reporter's JSON export, which has two top-level arrays, `questions` and
- Runs on the iPhone only, off the main actor, inserting in batches. It's
started from **Import from Reporter** in Settings' Data section, which picks
the export with `fileImporter` and shows the counts when it's done; the full
- summary goes to the log, as counts and IDs only. **Delete All Data**, in
- the same section, asks first, then deletes every report, question and
- token and seeds the default questions again, so the archive can be
- re-imported from scratch. Prompt settings are kept. Once sync exists, it
- has to clear the CloudKit zones too, or the next fetch brings everything
- back.
+ summary goes to the log, as counts and IDs only.
- **Idempotent and repeatable.** Reports, questions and tokens keep their
Reporter IDs, so importing a newer export adds only what's new. The user can
keep using Reporter while Reportage is under development and re-import at
@@ -852,6 +830,10 @@ whole. The schema is documented in `Notes/ExportFormat.md` and covered by
round-trip tests. Including the `legacy` snapshots is optional (off by
default); when included, each is the original JSON text as a string.
+**Delete All Data**, also in the Data section, asks first, then deletes every
+report, question and token and seeds the default questions again, leaving
+the app as a fresh install has it. Prompt settings are kept.
+
## Phases
1. **Foundation.** Project scaffold, Core Data model, Reporter importer with
@@ -866,19 +848,16 @@ default); when included, each is the original JSON text as a string.
the Control Center control, Lock Screen widget, Action button, Siri and
Shortcuts. The Watch app is deferred.
6. **Derived context.** Health, photos, and backfilling them and historical
- weather. Live weather was brought forward and is captured with each
- report.
+ weather. Live weather is part of capture (see [Weather](#weather)).
7. **Visualisations.**
## Open Questions
- **Missed prompts.** Should prompts that were delivered but never answered be
recorded? Doing so costs little and makes the sampling honest for later
- analysis. Reporter didn't record them. Deferred past Phase 3: the plan is
- deterministic, so the prompts sent on a day can be worked out again from the
- settings in force that day, if those are kept.
-- **"Always" location.** Settled: requested as an upgrade when prompts are
- turned on (see [Location](#location)).
+ analysis. Reporter didn't record them. The plan is deterministic, so the
+ prompts sent on a day can be worked out again from the settings in force
+ that day, if those are kept.
- **Backfills.** Weather from August 2021 onwards and Health from 2014 onwards.
Both are optional and can be done at any time. Location answers skipped
since Reporter lost venue lookup (2026-09-01) could be filled in from each
@@ -902,8 +881,8 @@ default); when included, each is the original JSON text as a string.
a question. The on-device model could suggest a rule for the user to check.
- **Inline forms.** How the user sets a token's mid-sentence form ('the park'),
and whether the model should suggest one when a token is created, accepted
- only if it changes nothing but case and a leading article. In a spike it got
- common places right but also suggested 'the home' and 'the uniqlo'.
+ only if it changes nothing but case and a leading article. The model gets
+ common places right but also suggests 'the home' and 'the uniqlo'.
- **Entries in other languages.** Drafts and the polish are English only.
- **Vocabulary editing UI.** Renaming and merging are settled in the model
(see [Token](#token)); how they're presented in the app isn't.
diff --git a/Reportage/Services/Prompts/PromptNotification.swift b/Reportage/Services/Prompts/PromptNotification.swift
@@ -64,8 +64,11 @@ enum PromptNotification {
private static func promptContent(promptedAt: Date?) -> UNMutableNotificationContent {
let content = UNMutableNotificationContent()
+ content.title = String(
+ localized: "Reporting Time",
+ comment: "The title of a random prompt notification")
content.body = String(
- localized: "Time for a report. What are you doing?",
+ localized: "How are things going?",
comment: "The body of a random prompt notification")
content.sound = .default
content.categoryIdentifier = promptCategory
@@ -77,8 +80,11 @@ enum PromptNotification {
private static func reminderContent() -> UNMutableNotificationContent {
let content = UNMutableNotificationContent()
+ content.title = String(
+ localized: "Reminders Ending",
+ comment: "The title of the notification that ends the scheduled prompts")
content.body = String(
- localized: "Open Reportage to keep the prompts coming.",
+ localized: "Open Reportage to keep reminders enabled.",
comment: "The body of the notification that ends the scheduled prompts")
content.categoryIdentifier = reminderCategory
return content