Skip to content

feat(ios): every notification choice under Home, and the not-following notice - #158

Merged
frahlg merged 2 commits into
mainfrom
ios-notify-choices
Nov 5, 2026
Merged

frahlg merged 2 commits into
mainfrom
ios-notify-choices

Conversation

@frahlg

@frahlg frahlg commented Nov 5, 2026

Copy link
Copy Markdown
Member

Problem

Fredrik, 5 Nov 2026: "vi bör ha alla val för notiser i ios app också". The web app and the box's settings let an owner choose which notifications the box sends. The iPhone app had no such choice, and it never turned the box's notifications on. So a push such as "Car plugged in" reached an iPhone only if someone had turned it on elsewhere.

Change

  • Home › Notifications (NotifySettingsView, NotifyRules):
    • Permission: the iPhone's own permission comes first. The view asks if FTW was never asked, or shows the way to Settings if it was refused.
    • The box's switch: "Notifications from your box". It is the box's master switch, one for the home. The footer says every owner gets the same, and that notices about access come even with the switch off.
    • The kinds: one switch per kind the box's document carries, in three groups: the car, the box and its devices, and access. The labels are the web app's, in English and Swedish. Turning a kind on also turns the box's switch on, as on the web.
    • Writes: each write sends every entry for a kind the phone knows, whole and flipped only on enabled. That keeps the thresholds the box seeded. A kind the phone does not know, and any template rule, stays as the box holds it.
    • Other cases: a viewer reads that the owner chooses. An older box says it does not have this yet. A failed write puts the switches back and says nothing changed.
  • The push catalogue gains control.not_following, with the phone's words:
    • English: "A device is not following FTW" / "{name} does not do what FTW asks. Open FTW to see why."
    • Swedish: "En enhet följer inte FTW" / "{name} gör inte som FTW ber. Öppna FTW för att se varför."
  • The demo box serves the rules document, seeded the way Core seeds it.

Pairs

This is the third of three:

The catalogue is byte-identical in all three. The screen works on any box that serves /api/notifications/rules. The new kind appears once the box runs srcfl/ftw#1972.

Evidence

  • swift test: 354 + 646 green on this machine.
    • NotifyRulesTests: what a write sends, that every choice has a group, a label and Swedish, and a demo home whose switches read and write the box's rules without touching thresholds or the template rule.
    • PushTextTests: still holds the catalogue to the phone's words.
  • Driven on iPhone 17 (iOS 26.5) in the demo, in Swedish dark mode and in English light mode at the largest text size.
The box's switch off On Further down

Largest text size, light:

🤖 Generated with Claude Code

…g notice

Fredrik, 5 Nov 2026: the iPhone app should have every notification
choice the web app and the box have. Home › Notifications reads the box's
rules document (GET /api/notifications/rules) and writes it as the web
app does: every entry for a kind the phone knows goes out whole, flipped
only on enabled, and a kind it does not know stays as the box holds it.
The box's own switch sits on top; turning a kind on turns it on too. The
kinds stand in three groups (the car, the box and its devices, access),
in Swedish and English. Above them, the iPhone's own permission: asked
here if never asked, or the way to Settings if refused. A viewer reads
that the owner chooses; an older box says it has no such thing yet.

The push catalogue gains control.not_following, with the phone's words:
"En enhet följer inte FTW" / "{name} gör inte som FTW ber. Öppna FTW för
att se varför." The demo box serves the rules document.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T14:24:18.359844Z a8b2d9e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

# Conflicts:
#	appleApp/FTWKit/Sources/FTWKit/State/AppModel.swift

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a8b2d9ea3f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// Read when the view opens and when the session comes back.
.task(id: home.site.session.phase == .streaming) { await rules.load() }
// Back from the iPhone's Settings, the answer may have changed.
.task(id: scenePhase) { allowed = await Notifications.allowed() }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Register for push after permission is enabled in Settings

If notification permission was denied before this launch, following “Open Settings” and granting permission only refreshes allowed when the user returns; it never registers with APNs. Notifications.start() skips registration for denied permission, and SiteModel.installPushSink() does not reinstall an existing sink when the connection resumes. Consequently, the warning disappears but this phone still receives no notifications until the app is relaunched. When the scene becomes active with permission granted, also register for remote notifications.

Useful? React with 👍 / 👎.

@frahlg
frahlg merged commit f9f42f0 into main Nov 5, 2026
@frahlg frahlg mentioned this pull request Nov 5, 2026
frahlg added a commit that referenced this pull request Nov 5, 2026
The status line says when a device does not follow FTW (#157), and Home
has every notification choice (#158). The notes drop 0.6.3 to stay
within TestFlight's 4000 characters.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant