Skip to content

fix(gamecenter): revert to native Game Center dashboard, drop dead Daily Rank stub - #1009

Merged
wei18 merged 4 commits into
mainfrom
fix/983-native-gamecenter
Aug 12, 2026
Merged

wei18 merged 4 commits into
mainfrom
fix/983-native-gamecenter

Conversation

@wei18

@wei18 wei18 commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Summary

Reverts the app-owned Daily Rank screen (#989) back to Apple's native Game
Center dashboard, in two commits.

Root cause. LiveGameCenterClient.friendsAuthorizationStatus() was
hardcoded to .notDetermined and requestFriendsAuthorization() hardcoded
to throw .friendsAccessDenied — never implemented against GameKit. The
ViewModel called the latter behind try?, swallowing the throw and
re-rendering the identical screen, so the "Allow Friends Access" button did
nothing for every user, always. Every test injected a fake client, so the
logic tested green while the only production conformer was inert.

c297d11 — production code, routes, tests. Home's Leaderboard card goes
back to presenting Apple's native Game Center dashboard as a side-effect
(presentLeaderboard: { GameCenterDashboard.present() } was dormant, not
deleted — dropping route: .dailyRank restores it, so this is a revert, not
a rewrite). Removes GameAppKit's DailyRank view/view-model/models/state-views,
Minesweeper's LiveRouteFactory+DailyRank, the dailyRank route case in
both apps, and the 28 committed DailyRankViewTests snapshot baselines.
HomeMode.trailingSymbolName returns to the pre-#989 shape (arrow.up.forward
for Leaderboard, chevron for everything else, as at 439ee8d).

9cbd78e — screenshot pipeline + docs (this follow-up).

  • scripts/build-ascspec-screenshots.py: delete the six 02b-rank Slot()
    rows, the two per-app COPY caption dicts, the IOS_GAP_TRIM/MAC_GAP_TRIM
    entries + orphaned rationale, and 02b-rank's membership in crop_all_sides.
  • Delete all 42 committed docs/app-store/screenshots-ascspec/**/02b-rank.png
    baselines.
  • Re-record the 8 Sudoku HomeViewTests + 6 Minesweeper
    MinesweeperHomeSnapshotTests baselines — the trailingSymbolName revert
    changes every Home render that includes the Leaderboard row.
  • Regenerate all 168 ASC screenshot slots; 42 01-home.png outputs changed
    (the Leaderboard row's glyph). mise-tasks/scan/store_frame_drift passes.
  • screenshot-strategy.md: remove the "Daily Rank slot — 02b-rank" section.
  • Both *-v2.6-review-information.md files: rewrite "WHAT MAKES THIS APP
    DIFFERENT" and "GAME CENTER" to describe the native-dashboard behavior
    instead of the removed app-owned screen. Both stay under the 4000-char ASC
    cap (Sudoku 3068 chars, Minesweeper 3528 chars).

Deliberately not in scope (separate follow-up — protocol-shape change
across 7+ conformers): fetchLeaderboardSlice, friendsAuthorizationStatus,
requestFriendsAuthorization, LeaderboardSliceService,
LeaderboardScope.friendsAllTime.

part of #983

Test plan

  • swift test --package-path Packages/GameAppKit — 58/58 passed
  • swift test --package-path Packages/GameShellKit — 32/32 passed
  • swift test --package-path Packages/SudokuKit --filter "HomeViewTests|HomeViewModelInteractionTests|RouteFactoryTests" — 30/30 passed
  • swift test --package-path Packages/MinesweeperKit --filter "MinesweeperHomeSnapshotTests|MinesweeperHomeViewModelTests|LiveRouteFactoryTests" --no-parallel — 30/30 passed
  • mise-tasks/scan/store_frame_drift — PASS, no drift
  • Opened regenerated 01-home.png for Sudoku iPhone-6.9 en and
    Minesweeper Mac ja — Leaderboard row shows the outward-jump arrow,
    every other row keeps the chevron
  • Both review-information.md Notes blocks measured under the 4000-char cap

🤖 Generated with Claude Code

wei18 and others added 4 commits August 12, 2026 18:00
…of the native-GC revert)

Checkpoint commit — production code, routes and tests only. The screenshot
pipeline and review-note updates land in the follow-up commit on this branch.

Home's Leaderboard card goes back to presenting Apple's native Game Center
dashboard as a side-effect, reverting the UI direction of #989.

Root cause this removes: `LiveGameCenterClient.friendsAuthorizationStatus()`
was hardcoded to `.notDetermined` and `requestFriendsAuthorization()` hardcoded
to `throw .friendsAccessDenied` — never implemented against GameKit. The
ViewModel called the latter behind `try?`, swallowing the throw and re-rendering
the identical screen, so the "Allow Friends Access" button did nothing for every
user, always. Every test injected a fake client, so the logic tested green while
the only production conformer was inert.

The old path was dormant, not deleted: `presentLeaderboard:
{ GameCenterDashboard.present() }` was still wired in both apps and unreachable
only because every mode carried a `route`. Dropping `route: .dailyRank` restores
it, so this is a revert rather than a rewrite.

Removed: GameAppKit's DailyRank view/view-model/models/state-views, Minesweeper's
`LiveRouteFactory+DailyRank`, the `dailyRank` route case in both apps, and the
28 committed DailyRankViewTests snapshot baselines. `HomeMode.trailingSymbolName`
returns to the pre-#989 shape (`arrow.up.forward` for Leaderboard, chevron for
the rest, as at 439ee8d).

Home view-model tests were rewritten rather than deleted: the
authenticated/unauthenticated/unknown/restricted matrix is preserved, with the
expected outcome flipped from "pushes .dailyRank" back to "fires the
presentLeaderboard side-effect".

The subtitle stays "Global / friends" — it predates #983 and accurately
describes Apple's dashboard, which carries a global/friends toggle.

Deliberately NOT in scope: `fetchLeaderboardSlice`,
`friendsAuthorizationStatus`, `requestFriendsAuthorization`,
`LeaderboardSliceService` and `LeaderboardScope.friendsAllTime` remain. Removing
them is a protocol-shape change across 7+ conformers and lands separately.

part of #983

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…e copy (part 2 of the native-GC revert)

Follow-up to c297d11 (part 1, production code): the app-owned Daily Rank
screen it removed also fed a store-screenshot slot and two ASC review-note
sections that no longer describe anything the app does.

Screenshot pipeline (scripts/build-ascspec-screenshots.py):
- Delete the six 02b-rank Slot() rows (iphone-6.9/ipad-13/mac × sudoku/
  minesweeper), the two per-app COPY caption dicts, the IOS_GAP_TRIM/
  MAC_GAP_TRIM entries and their now-orphaned rationale comments, and
  02b-rank's membership in the crop_all_sides set.
- Delete all 42 committed docs/app-store/screenshots-ascspec/**/02b-rank.png
  baselines.
- Re-record the 8 Sudoku HomeViewTests + 6 Minesweeper
  MinesweeperHomeSnapshotTests baselines: c297d11's
  HomeMode.trailingSymbolName revert (arrow.up.forward for Leaderboard,
  chevron for everything else) changes every Home render, so all 14
  baselines that include the Leaderboard row were stale against `swift
  test` until re-recorded here.
- Regenerate all 168 ASC screenshot slots from the refreshed baselines;
  42 of the 168 `01-home.png` outputs changed pixels (the Leaderboard row's
  trailing glyph). `mise-tasks/scan/store_frame_drift` passes clean.

Docs:
- screenshot-strategy.md: remove the "Daily Rank slot — 02b-rank" section.
- Both v2.6 review-information.md files: rewrite "WHAT MAKES THIS APP
  DIFFERENT" and "GAME CENTER" to describe what the app actually does now
  — the Home Leaderboard card opens Apple's native Game Center dashboard
  (GKAccessPoint / GKGameCenterViewController) — instead of the removed
  app-owned Daily Rank screen (World/Friends toggle, "Your Rank" row,
  "Allow Friends Access" state). Both stay well under the 4000-char ASC
  cap (Sudoku 3068, Minesweeper 3528).

Deliberately NOT in scope (per c297d11): fetchLeaderboardSlice,
friendsAuthorizationStatus, requestFriendsAuthorization,
LeaderboardSliceService, LeaderboardScope.friendsAllTime.

part of #983

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Review finding on this branch. `GameAppKitTests` depended on the
`GameCenterTesting` product solely for `DailyRankViewModelTests` and
`GatedLeaderboardGameCenter`, both deleted by the Daily Rank removal. Zero
files in the target reference `FakeGameCenterClient` or `GameCenterTesting`
any more.

The comment was the sharper problem: it still read "FakeGameCenterClient — the
same fake seam SudokuUITests / MinesweeperUITests use", which describes those
other targets accurately but is false for this one, so it read as a justified
dependency. It had already misled one reader into reporting the dependency as
still needed.

`GameCenterClient` (the protocol) stays — GameRootViewModelTests,
GameRootViewModelLeaveTests, TerminalPersistJoinTests and
UITestSignedOutGameCenterClientTests all declare inline test doubles against
it. The replacement comment says which files need it and why the Testing
product went away, so the next reader does not have to re-derive it.

Verified: swift test --package-path Packages/GameAppKit -> 58/58 passed.

part of #983

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…record

Review finding on this branch. The `## Daily Rank slot — 02b-rank` section was
removed cleanly, but the following section — the record of the #997 portrait
panel-fill pass — still named `02b-rank` twice as a live `crop_all_sides`
member, which it no longer is (membership is now `{"04-completion"}`).

Rewriting those two lines to omit the slot would have falsified the record:
`02b-rank` genuinely was in that set when the pass ran, and the measurements
quoted are the measurements that were taken. So they are annotated rather than
edited — the history stays true and the reader learns the slot is gone, which
is how the generator's own `IOS_GAP_TRIM` comment handles the same situation.

part of #983

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@wei18
wei18 merged commit 18b1efb into main Aug 12, 2026
6 checks passed
@wei18
wei18 deleted the fix/983-native-gamecenter branch August 12, 2026 10:40
wei18 added a commit that referenced this pull request Aug 13, 2026
 (#1011)

* chore(gamecenter): remove the dead leaderboard-slice chain left by #1009

#1009 removed the app-owned Daily Rank screen but deferred removing the
protocol members it orphaned. `fetchLeaderboardSlice`,
`friendsAuthorizationStatus`, and `requestFriendsAuthorization` had zero
production callers, and the always-throwing `requestFriendsAuthorization`
live stub was exactly the failure shape behind the shipped dead-button bug.

Removes the whole chain: 6 whole-file deletions (Leaderboard/Slice.swift,
GKLeaderboardLoader.swift, FakeLeaderboardLoader.swift, and their three test
files) plus partial edits across the protocol, LiveGameCenterClient,
FakeGameCenterClient, UITestFakeSeams, both Sudoku NearWin modifiers, three
GameAppKit inline test fakes, and ProtocolShapeTests. Annotates the four docs
mentions as removed without rewriting their historical narrative.

`LeaderboardKind`, `LeaderboardIDs`, `PlayerSummary`, `GameCenterSink`, and
`SudokuLeaderboardRouting` (the submitScore path) are untouched.
MinesweeperKit needed no symmetric change (it shares `FakeGameCenterClient`
and had zero direct references to the removed chain).

part of #983
closes #1010

Co-Authored-By: Claude <[email protected]>

* docs(designs): align 06-completion purpose/states with the removed slice chain

Review finding (MINOR) on #1011: the Triggers line was annotated as removed
but the adjacent Purpose line and slice-driven States entries in the same
section still read as live. Annotate them in the same strikethrough style.

Part of #1010.

Co-Authored-By: Claude <[email protected]>

* docs(designs): close the #468 open-question wording in 06-completion AS-BUILT NOTE

Acceptance-pass observation on #1011: the 2026-07-05 AS-BUILT NOTE still
implied the slice logic exists but is hidden. Annotate it as resolved by the
full chain removal.

Part of #1010.

Co-Authored-By: Claude <[email protected]>

---------

Co-authored-by: Claude <[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

Development

Successfully merging this pull request may close these issues.

1 participant