Skip to content

feat(att): defer ATT to a post-Home pre-prompt at first ad-context, Sudoku-only (#371, #195) - #417

Merged
wei18 merged 2 commits into
mainfrom
feat/371-195-att-preprompt
Jun 8, 2026
Merged

wei18 merged 2 commits into
mainfrom
feat/371-195-att-preprompt

Conversation

@wei18

@wei18 wei18 commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Closes #371. Closes #195. Implements the deferred half of the ATT work per approved decisions.

  • Timing (F1): ATT no longer fires at cold launch (was violating design.md §How.4). A Path-B pre-prompt sheet presents from the banner-slot gate-open moment — i.e. after Home is seen AND when a personalized ad is about to load (lazy/contextual). 'Continue' → system ATT dialog; 'Not now' → dismiss, never requests.
  • Scope (F2): Sudoku-only. Minesweeper never prompts — locked by MinesweeperNoATTGuardTests (scans all MS sources for ATT refs). import AppTrackingTransparency in exactly 1 file.
  • Boot (F4): UMP + AdMob stay at cold launch; the ATT boot step is now a no-op (BootDoesNotRequestATTTests pins that boot doesn't move ATT determination).
  • New ATTPrimerCoordinator (closure-injected, keeps SudokuUI free of AdsAdMob) + ATTPrimerSheet + ATTPresenter.currentStatus() (read-only). 4 att.primer.* keys × 7 locales, Path-B framing, 0 placeholders.
  • Idempotent (per-session hasOffered latch, gated on .notDetermined — never re-prompts decided users; survives feat(admob): re-load banner after dismiss (mid-session / next-day gate reopen) #341 foreground re-polls). Per-session latch kept (not persisted) per CR.

Tests: SudokuKit 219, AppMonetizationKit 111, MinesweeperKit 111 green (Leader-verified: ATTPrimer 6/6 + boot-guard). CR: APPROVE (no blockers; macOS dead-sheet guarded, isolation clean).

wei18 and others added 2 commits June 9, 2026 01:00
#371 #195)

Builds the deferred half of #371/#195: a Sudoku ATT priming screen + corrected
prompt timing, per APPROVED product decisions F1/F2/F4.

F1 (timing): ATT no longer fires at cold launch. The system dialog is now driven
by ATTPrimerCoordinator (SudokuUI), triggered from BannerSlotView's load path —
i.e. after Home is on screen AND only when AdGate opens (a personalized ad is
about to load = the first moment ATT matters). design.md §How.4 satisfied.

F4 (boot): MonetizationBootBridges.live keeps the UMP/ATT/AdMob shape (ordering
tests intact) but the ATT step is now a NO-OP. UMP (GDPR consent) stays at cold
launch; only ATT defers.

F2 (scope): ATT stays Sudoku-only. Minesweeper never prompts — it has no ATT
code path. A source-guard test (MinesweeperNoATTGuardTests) locks the invariant.

Pre-prompt screen (#195): ATTPrimerSheet renders the approved Path-B copy
(relevance not a profile; decline still works; or remove ads). "Continue" leads
into the system ATT dialog; "Not now" dismisses without requesting. 4 new keys
(att.primer.title/body/continue/notNow) in App/Sudoku/Resources/Localizable.xcstrings,
all 7 locales (en/zh-Hant/zh-Hans/ja/ko/es/th). AppCompositionTests L10n fixture
regenerated as a byte-copy; scan:l10n gate passes.

Isolation (foundations.md §9.1): SudokuUI never imports AdsAdMob — the two ATT
touch points are injected as closures, wired to ATTPresenter only in Sudoku's
AppComposition.live(). New public ATTPresenter.currentStatus() (read-only, never
prompts) backs the "should we offer?" check.

Tests:
- SudokuKit: ATTPrimerCoordinatorTests — ATT requested only after the trigger
  (never at construction/boot); never on "Not now"; idempotent across re-fires;
  no-op when already determined. 219 tests GREEN.
- AppMonetizationKit: ATTPresenter.currentStatus read-only; BootDoesNotRequestATTTests
  proves boot initializes AdMob but does not move ATT determination. 111 GREEN.
- MinesweeperKit: MinesweeperNoATTGuardTests proves MS sources reference no ATT.
  111 GREEN.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@wei18
wei18 merged commit 3c04801 into main Jun 8, 2026
4 checks passed
@wei18
wei18 deleted the feat/371-195-att-preprompt branch June 8, 2026 18:46
wei18 added a commit that referenced this pull request Jun 8, 2026
…-toggle (#287) (#419)

* feat(reminders): wire daily-reminder entry into Settings for both apps (#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]>

* fix(reminders): regen L10n fixture + in-app OFF affordance + cancel telemetry (#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]>

---------

Co-authored-by: Claude Opus 4.8 <[email protected]>
wei18 added a commit that referenced this pull request Jun 15, 2026
…le branches (#498)

Rescues content that was authored on stale remote branches but never landed on
main, before deleting those branches (branch triage, 2026-06-15):
- docs/v2/att-permission-ux-proposal.md (305 lines) — ATT permission UX design
  doc from docs/att-permission-ux-proposal-195 (the #412/#417 feature shipped but
  this design record never merged)
- meetings/2026-05-26_licenseplist-integration.md
- meetings/2026-05-26_module-split-proposal.md
- meetings/2026-05-26_foundations-backlog-3items.impl-notes.md
  (three meeting/decision records from wip/licenseplist-preflight-v1)

Verbatim restores (git show <branch>:<path>); no content edits. Discarded from
those branches per decision: generate-acknowledgements.sh (superseded by the
gen:acknowledgements mise task) and the stale .mise.toml delta (final form
already on main); xiaohongshu.md draft dropped per user.

Co-authored-by: Claude Fable 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant