Repository navigation
fix(macos): stop offering remove-ads where no ads exist (#968) - #971
Merged
Merged
Conversation
macOS ships with no ads at all (Google has no macOS AdMob/UMP xcframework slice, D-v2-03), but Settings still sold a "Remove Ads" IAP and a phantom banner dismiss control could mount over empty space — a Guideline 2.1 / 3.1.1 exposure for the first Mac submission. Fixes the 4 blockers from a pre-submission survey (#968); see the PR body for verification detail per blocker. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
5 tasks done
wei18
added a commit
that referenced
this pull request
Jul 29, 2026
…ate (#973) * test(sudoku): re-record stale dark-band regression baseline (#972) `postFix_themedBackground_dailyHubDarkMode_bannerOpen_noBand` has been red on main since #943 changed the three difficulty cards' subtitle from a shimmer/skeleton placeholder to the resolved `Best —` empty state; nobody re-recorded the baseline. Verified deterministic (not the timing-sensitive flake a #971 reviewer suspected): the pixel diff bbox (64,304 → 721,662) matches #943's change exactly and is nowhere near the banner slot. Eyeballed the re-recorded PNG and the banner-boundary crop: no dark band or seam, confirming #851 has not regressed — this is a stale-baseline fix, not a determinism rework. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * test(composition): pin the macOS Settings monetization gate from #971 #971 fixed a Guideline 2.1 exposure — macOS offered "Remove Ads" where no ads exist — by nil-ing the LOCAL `settingsMonetizationController` inside each app's `Live.swift` `makeRouteFactory` on non-iOS platforms. Both code reviewers and the acceptance agent on that PR flagged that nothing pins the behaviour: the composition-level `bag.monetizationController` DI handle stays non-nil on macOS (only the value fed into `LiveRouteFactory`'s Settings route is gated), so the existing `liveAdProviderIsLiveOnIOSNoopOnMac` pattern doesn't reach it, and a future refactor could silently reintroduce the exposure. No tracking issue exists for this — it surfaced purely from review. Added `liveCompositionGatesSettingsMonetizationControllerByPlatform` to both `SudokuAppCompositionTests` and `MinesweeperAppCompositionTests` (mirror principle), reaching through the real `.live()` composition to `routeFactory.view(for: .settings)` and asserting on the rendered `SettingsView`'s `monetizationController` field via `String(reflecting:)` — this exercises the actual `#if os(iOS)` gate in `Live.swift`, not a copy of it, so deleting the gate flips the assertion. Verified by temporarily un-gating Sudoku's `Live.swift` (passing the controller unconditionally): the new test failed with `monetizationController: Optional(...)`; restored the gate and the test passes again. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * test(sudoku): drop the inert async from the gate test signature (#972) CR round 1: SudokuAppComposition.live() is synchronous, so the test never awaited anything — and the Minesweeper mirror test was already sync. Now symmetric. Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
wei18
added a commit
that referenced
this pull request
Jul 30, 2026
The macOS builds are now on TestFlight, and both apps' review notes were written for iOS only: they walk a reviewer through finding a banner, buying Remove Ads, and answering an ATT/UMP prompt — none of which exist on macOS (AdMob ships no macOS slice; #971 removed the purchase UI there). Telling a reviewer to exercise a flow the build does not have wastes their time and reads as inaccurate submission information. Adds a PLATFORM DIFFERENCES preamble, marks the three affected sections 'iOS only', and scopes the PrivacyInfo paragraph (the manifest is shared and describes the iOS worst case). MS also notes secondary-click flagging on Mac. One document per app still serves both platforms. Co-authored-by: Claude <[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 #968.
Survey of macOS App Store submission blockers ahead of both apps' first Mac
submission. Base = main @ 667d65b.
Blocker 1 (most serious) — Remove Ads IAP offered where no ads exist
What I did:
Packages/SudokuKit/Sources/SudokuAppComposition/Live.swiftandPackages/MinesweeperKit/Sources/MinesweeperAppComposition/Live.swift:makeRouteFactorynow passesnilformonetizationControllerintoLiveRouteFactoryon macOS (#if os(iOS)picksdeps.monetizationController/
#elsepicksnil).SettingsViewalready renders the whole "Purchases"section (Remove Ads CTA + Restore Purchases) only when that param is
non-nil, so this one value flip is the entire UI fix —
GameAppKit'sSettingsView.swiftandGameDeps/GameConfigtypes are untouched.Packages/AppMonetizationKit/Sources/MonetizationUI/BannerSlotView.swift:also fixed the Home/board banner slot dead-UI the issue asked me to check.
NoopAdProvider(macOS — Google ships no AdMob/UMP xcframework slice forthat SDK) always reports
.suppressed, but the gate (AdGate.shouldShowBanner)doesn't know about platforms and still said "show a banner" — so the slot
mounted its dismiss (✕) button and an "Advertisement" accessibility element
over an empty rect on every macOS Home/board screen. Now
bodyalsocollapses to
EmptyView()onstatus == .suppressed, andresolveGateAndLoad()bails out (settingstatus = .suppressed) beforecalling
onAdContext?()when the provider reports.suppressedup front.NSUserTrackingUsageDescriptionhalf ofthis blocker at the CODE level, not just the Info.plist:
AppTrackingTransparencyis genuinely available on macOS 11+ (
canImportis true), and the sharedHome/board banner slot wires
attPrimer.maybePresentOnAdContext()for BOTHapps (not Sudoku-only — that doc comment was stale). Before this fix, a real
macOS launch would show our priming sheet and could trigger the actual
system ATT dialog for an app with no ads/tracking behind it — worse than a
merely-unused Info.plist string. I traced every call site
(
ATTPresenter.currentStatus()/.requestIfNeeded()are only reachedthrough
BannerSlotView'sonAdContexthook) and confirmed this path isnow provably unreachable on macOS. Given that, I left
NSUserTrackingUsageDescriptionin the Info.plist as-is — see Blocker 2 forwhy I didn't attempt SDK-conditioning the plist itself.
Deviation from the dispatch instructions — please read: the instructions
suggested gating the render site directly in
GameAppKit/SettingsView.swiftwith
#if os(iOS). I implemented that first, then reverted it: this exactview is also used by
SudokuUITests/ASCScreenshotEmitTests.swift(
emit_iPhone_settings) to render Sudoku's iOS App Store marketingscreenshot (
docs/app-store/screenshots/sudoku/iphone-6.9/en/05-settings.png),built
purchased: truespecifically so that screenshot shows the unlockedPurchases section. That test — like every other
SettingsViewsnapshot testin this repo (
#if canImport(AppKit)-gated) — always compiles/runs on amacOS host. A compile-time
#if os(iOS)insideSettingsViewitself can'ttell "really building the macOS app" apart from "rendering iOS marketing
content on a macOS test host," so it would have silently stripped Purchases
from the iOS screenshot too. Gating the value at the two real production
composition roots (
Live.swift, not the shared view) fixes productionwithout touching any test/screenshot call site, each of which already
controls its own
monetizationControllerargument directly.Consequence — no snapshot re-recording needed. Because the fix lives in
Live.swift(notSettingsView.swift),SettingsViewTests.swift/SettingsViewWindowSnapshotTests.swift/SettingsViewAppStoreRowsTests.swift/
ASCScreenshotEmitTests.swiftall constructSettingsViewdirectly withtheir own explicit
monetizationController, entirely bypassing thecomposition-root gate. I ran the full
SettingsView-related filter bothbefore and after the fix — every
snapshot_iPhone_*/snapshot_iPad_*/snapshot_mac_*baseline (SettingsViewTests.swift) passed byte-identical,zero re-recording. This is the one place I diverged from the dispatch
brief's expectation that Mac baselines "must be re-recorded" — they don't
need to be, and forcing a re-record here would have been wrong (it would
just re-bake the current byte-identical render).
Restore Purchases reasoning: I chose to hide the entire Purchases
section on macOS, Restore Purchases included, not just the Remove Ads CTA.
Reasoning: even though this looks like a "Universal Purchase" app (both apps'
Project.swifttargets use ONEbundleIdacross[.iPhone, .iPad, .mac]destinations, so a Remove Ads entitlement bought on iOS may already be
recognized on Mac via the same App Store account/app record), macOS has
zero ad-gated content anywhere —
hasPurchasedRemoveAdsis never readoutside this one Settings section. A "Restore Purchases" button that can
never produce a visible effect (nothing on Mac ever checks the flag) is dead
UI regardless of whether the restore call itself would technically succeed,
and keeping it invites the same "why does this do nothing" review confusion
as the CTA. One
if let controller = monetizationControllergate coveringboth rows is also simpler than splitting the section's two rows apart for a
control that would still be functionally inert either way.
Also checked, not touched:
bootMonetization(MakeGameApp+Helpers.swift)was already
#if !os(iOS) return— no change needed there.Blocker 2 — iOS-only Info.plist keys in the Mac bundle
Verified, not fixed —
LSRequiresIPhoneOSis already a non-issue. Iinspected the shipped
Contents/Info.plistinside the June TestFlightarchives (
build/testflight/{sudoku,minesweeper}-macos.xcarchive) AND did afresh local
xcodebuild build -destination 'platform=macOS'from thisbranch: in both cases
LSRequiresIPhoneOSis absent from the builtmacOS bundle even though it's present in the source
Info.plist(added backin #393) — Xcode's own Info.plist processing for the macOS SDK already
strips it. Verified for both Sudoku and Minesweeper, both old archives and a
fresh build. No code change needed for the one genuinely risky key.
Investigated but left alone:
UILaunchScreen/UISupportedInterfaceOrientations~ipad/
NSUserTrackingUsageDescription. These DO ride along in the built macOSbundle (confirmed in the same builds) but are inert — macOS ignores UIKit
launch-screen/orientation keys, and the ATT description is now provably
unreachable at the code level (Blocker 1). I identified a genuine Apple
mechanism to SDK-condition individual Info.plist keys without splitting the
file —
INFOPLIST_PREPROCESS/INFOPLIST_PREPROCESSOR_DEFINITIONS[sdk=macosx*](confirmed real via Xcode's own
CoreBuildSystem.xcspec, it runs the plistthrough the C preprocessor with per-SDK
-Ddefines before Xcode's own$(VAR)substitution, so it composes safely with the existingGADApplicationIdentifier-style substitutions). I chose NOT to apply it:both
Info.plistfiles contain<!-- https://developer.apple.com/... -->XML comments, and a C preprocessor treats bare
//as "rest of line is acomment" regardless of the surrounding XML comment syntax — a real
plist-corruption risk for a change whose entire payoff is removing three
inert keys. Given
docs/…: "if it turns out to be genuinely impossiblewithout splitting the plist, say so and propose the split" — my read is it's
possible via
INFOPLIST_PREPROCESS, but the risk/benefit doesn't clear thebar for inert keys; a full plist split (two Info.plist files, two Xcode
targets) is the clean alternative but is a much bigger structural change than
three inert keys warrant. Recommend tracking as a low-priority follow-up, not
a submission blocker.
Blocker 3 — app icon name mismatch on macOS
Verified: not a bug, no change made. Inspected the built
Contents/Info.plistinside both June*-macos.xcarchivebuilds AND afresh local build:
CFBundleIconName/CFBundleIconFileboth resolve toAppIcon-macOSin the shipped bundle for both apps — Xcode's asset-catalogcompiler (
actool) rewritesCFBundleIconNameat build time to match theresolved
ASSETCATALOG_COMPILER_APPICON_NAME[sdk=macosx*]setting,regardless of the literal
AppIconvalue in the sourceInfo.plist.Assets.caris present. iOS side spot-checked too (CFBundleIconName=AppIcon, correct). No submission risk here.Blocker 4 — whatsNew build-matching collides across platforms
Fixed.
mise-tasks/tf/asc_whats_new.py:find_build()now accepts arequired
--platform {ios,macos}and addsfilter[preReleaseVersion.platform]=<IOS|MAC_OS>to the/buildslookup(same platform tokens
ASCRegisterKitalready uses forappStoreVersions.platform).mise-tasks/tf/upload:run_whats_new()takesa new
$6=platformarg, forwarded as--platform; both call sites(
--whats-new-onlybackfill loop and the post-upload auto-sync) now passtheir already-available
$target_plat/$r_plat. The stale multi-matchwarning in
find_build()stays as defense-in-depth for a caller that omits--platform.Verification
swift build+swift test(macOS host, this machine) —AppMonetizationKit(122/122),
GameAppKit(58/58),MinesweeperKit(371/371 full suite, exit 0).SudokuKit:SettingsView+CompositionTestsfilter green; full-suite runhits the pre-existing documented local segfault
(
sudokukit-full-suite-segfault-local.md) — reproduced with a DIFFERENTtest failing each run (ToastController once, BoardLeaveOrPauseState once),
classic parallel-execution flake, not a regression; isolated re-runs of
each flagged suite pass cleanly.
xcodebuild build -destination 'generic/platform=iOS Simulator'— SudokuBUILD SUCCEEDED.xcodebuild build -destination 'platform=macOS'— Sudoku + Minesweeperboth
BUILD SUCCEEDED; used these fresh builds for the Blocker 2/3 Info.plistinspection above.
xcodebuild teston a real iOS Simulator (iPhone 17, OS 26.5) forSudokuKit-Package -only-testing:SudokuUITests(284/284) — this is whatcaught the Blocker-1 screenshot-suite problem in the first place (macOS
swift testcan't distinguish "iPhone snapshot" from "mac snapshot" once areal
#if os(iOS)exists in the view, which is exactly why the gate had tomove out of
SettingsView.swift).mise run test:ui all(iOS E2E, real simulator) — Sudoku 19/19, Minesweeper15/15, including
test_iapPurchaseCancelFailPendingStayInPlace_N22,test_restoreWithNothingToRestoreShowsInfoNotSuccess, andtest_bannerSlotRepollsOnForeground(exercises theBannerSlotViewfix).mise run lint:swift_stricton all 4 changed Swift files — 0 issues.python3 -m py_compile+--helpsmoke onasc_whats_new.py;bash -non
mise-tasks/tf/upload. No live ASC call (would need real credentials +an in-flight TestFlight upload — out of scope, prepare-never-execute).
Not touched (per dispatch instructions)
mise-tasks/preflight/*andscripts/build-ascspec-screenshots.py—concurrent work in this session.