Repository navigation
feat(settings): daily-reminder entry in both apps' Settings, with off-toggle (#287) - #419
Merged
Merged
Conversation
#287) The reminder permission-priming UI + RemindersKit scheduling already existed, but the only entry point was the post-Daily-completion primer. A player who never solved a Daily — or declined that primer — had no way to enable reminders. This adds a user-initiated Reminders entry to the Settings screen of BOTH apps. Shared (GameShellUI): - ReminderSettingsModel — @observable driver for the Settings entry: refreshes auth status on appear, presents the shared ReminderPrimerSheet to prime + request authorization, schedules/cancels the daily reminder, owns the fire-time and reschedules on change (gated on authorization). Store-agnostic via injected get/set fire-time closures; telemetry-decoupled via an Event emit seam. Never imports UserNotifications. - ReminderSettingsSection — the shared Section: enable button (→ primer) when not-authorized, "On" + hour/minute DatePicker when authorized, denied-recovery row (→ ReminderDeniedExplainer) when denied. Copy fully injected; tint as Color (no theme dep) so Minesweeper mounts the identical section. Sudoku: SettingsView adopts the shared section/model (retires the #321 time-only ReminderTimeSettingsModel/row — it was Settings-only). Live.swift bridges the fire-time to the existing ReminderSettingsStore (still shared with the post-Daily coordinator) and the model Event to Telemetry. Minesweeper (mirrors Sudoku): adds RemindersKit dep, SettingsView mounts the same shared section, Live wires LiveReminderScheduler/LiveNotificationAuthorizer + UserDefaults fire-time (com.wei18.minesweeper.reminder.*) + MS copy. Reused as-is: RemindersKit (seams, Live conformers, scheduling, fakes), ReminderPermissionModel, ReminderPrimerSheet, ReminderDeniedExplainer, ReminderSettingsStore (Sudoku), the post-Daily ReminderPrimerCoordinator. Does NOT touch AppComposition.swift boot sequence or any ATT path; priming is user-initiated from Settings only. Localization: +21 keys each in the Sudoku + Minesweeper String Catalogs, full 7-locale coverage (en/es/ja/ko/th/zh-Hans/zh-Hant), 0 <TRANSLATE>. Tests: GameShellKit 26 / SudokuKit 210 / MinesweeperKit 111 GREEN. New ReminderSettingsModel scheduler-seam coverage (authorization gating, schedule/cancel, picker persist+reschedule) via RemindersTesting fakes. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…elemetry (#287 CR) Addresses the #287 Code Review on a rebase of feat/287-reminders-in-settings onto latest main (picks up #417 ATT). BLOCKER — stale L10n fixture (scan:l10n drift gate): - The #287 reminder keys landed in App/Sudoku/Resources/Localizable.xcstrings but the AppCompositionTests byte-copy fixture (Packages/SudokuKit/Tests/AppCompositionTests/Resources/Localizable.xcstrings.json) was not regenerated, so the cmp-vs-shipping gate would fail. - Ran `mise run gen:l10n_fixture`; the fixture now byte-matches shipping. `mise run scan:l10n` passes (0 placeholders, 7 locales, fixture in sync). UX gap — in-app OFF affordance: - ReminderSettingsModel.disable() existed + was tested but was unreachable from the UI: once On, a user could not turn reminders off in-app. - ReminderSettingsSection now renders a destructive "Turn off reminders" row in the authorized/provisional (On) branch, wired to model.disable() (cancels the scheduled notification, emits .cancelled). Whole-row hit target + accessibility id `reminders.settings.disable`, consistent with the existing enable/denied rows and the injected copy + tintColor. - New copy field `disableTitle` on ReminderSettingsCopy; both apps pass "Turn off reminders" with full 7-locale coverage (en/es/ja/ko/th/zh-Hans/zh-Hant) in both String Catalogs; fixture regenerated. Telemetry — cancellation funnel: - Added TelemetryEvent.reminderCancelled(kind:) (mirrors reminderScheduled) + its OSLogSink case, so the on→off funnel is observable. - Both apps' AppComposition/Live.swift map ReminderSettingsModel.Event.cancelled → .reminderCancelled (was nil). Also (CR): - Defensive `guard !isPrimerPresented` in enable() to stop a double-tap re-entering before the primer sheet commits. Lint: - swiftlint:disable file_length on Sudoku Live.swift (composition root crossed 400 lines once #287 + #417 both wired here) and a scoped cyclomatic_complexity disable on the pre-existing OSLoggerAdapter.log helper (unchanged by this PR but lint-gated because the file is touched). Matches the ASCClient / MetadataConfig file_length precedent. Tests (swift test GREEN): - GameShellKit 28 (new: OFF-affordance disable→cancel+emit; enable() double-tap guard) - SudokuKit 216 (incl. AppCompositionTests L10n fixture-sync gate + telemetry wiring) - MinesweeperKit 112 - TelemetryKit 29 Co-Authored-By: Claude Opus 4.8 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #287. Surfaces a user-initiated daily-reminder entry in BOTH apps' Settings using the existing RemindersKit (scheduling + auth were already built; the gap was no Settings enable path + nothing in MS). Shared GameShellUI ReminderSettingsModel + ReminderSettingsSection (enable→primer→authorize→schedule; fire-time persist+reschedule gated on auth; denied recovery; off-toggle wired to disable(); store-agnostic via injected closures; no UserNotifications leak into the shared target). Both apps mirror it. +reminderCancelled TelemetryEvent. 21+ keys × 7 locales.
CR (REQUEST CHANGES on v1) addressed: L10n fixture regenerated (scan:l10n passes — was the blocker); OFF affordance added + tested (offAffordanceCancelsAndEmitsWhenOn); reminderCancelled telemetry wired (was nil); enable() double-tap guard. Leader-verified: scan:l10n pass, OFF test green. Tests: GameShellKit 28, SudokuKit 216, MinesweeperKit 112, TelemetryKit 29 green. (Two scoped swiftlint:disable with codebase precedent: file_length on the grown Live.swift composition root, cyclomatic_complexity on OSLogSink — flagged as tech-debt.)