Repository navigation
fix(gamecenter): signed-out GC entry points now alert instead of no-op - #715
Merged
Merged
Conversation
The Home leaderboard card's #513 signed-out alert never appeared, and the Settings Game Center row had no guard at all — both silently did nothing when Game Center was signed out (confirmed via simulator repro on both apps, closes #685). Root cause: the GC-signed-out `.alert` modifier was attached in `universalRootModifiers`, a plain helper called exactly once from `makeGameApp` outside any SwiftUI View's own `body`. That attachment point was never revisited by Observation's render invalidation, so flipping `GameRootViewModel.showGameCenterSignedOutAlert` never re-triggered presentation even though the flag itself was set correctly. Fix: - Move the alert modifier into `GameRoot.body` itself, alongside the `fullScreenCover` binding that already worked via the same pattern. - Add `GameRootViewModel.presentGameCenterOrAlert(present:)` as the one shared auth-gate; both `GameHomeViewModel.select(.leaderboard)` and the new `SettingsView.presentGameCenter` injection point route through it, so the fallback can't drift between entry points again. - Wire `presentGameCenter` through both apps' `LiveRouteFactory` / `Live.swift` so the Settings row shares the Home card's guard instead of calling `GameCenterDashboard.present()` unconditionally. Verified on-device behavior in the iOS Simulator (signed-out) on both Sudoku and Minesweeper: both entry points now show "Sign in to Game Center", repeatedly, on repeated taps. Co-Authored-By: Claude Fable 5 <[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 #685 — the last open item from the 2026-07-05 UX audit's GC cluster (14 files, +207/−42).
Root cause
The GC-signed-out
.alertmodifier was attached inuniversalRootModifiers— a plain helper called exactly once frommakeGameApp, outside any SwiftUI View'sbody. That attachment point is never revisited by Observation's render invalidation, so flippingshowGameCenterSignedOutAlertnever presented anything even though the #513 flag logic was correct all along. (Reviewer independently verified the mechanism with a fresh agent given only the SwiftUI/Observation description, no diff.)Fix
GameRoot.body, alongside thefullScreenCoverbinding that already worked via the same pattern.GameRootViewModel.presentGameCenterOrAlert(present:): authenticated → present dashboard; unauthenticated and.unknown→ alert (same semantics the Home card always intended). Home card and both apps' Settings GC row now route through it, so the fallback can't drift between entry points again.presentGameCenterthreaded through both apps'Live.swift/LiveRouteFactorysymmetrically. GameShellKit stays zero-dependency.Verification
Review
Dual-model review (sonnet + haiku), both approve. Haiku's hardcoded-string MINOR was adjudicated a false positive (LocalizedStringKey + app-catalog convention). Sonnet's two non-blocking residuals — the nil-default
presentGameCenterfallback seam and a weak wiring test — are tracked as #714.🤖 Generated with Claude Code