Skip to content

docs: methodology Phase 0-9 patterns + L10n skill execution playbook - #1

Merged
wei18 merged 1 commit into
mainfrom
docs/methodology-and-l10n-skill
May 19, 2026
Merged

wei18 merged 1 commit into
mainfrom
docs/methodology-and-l10n-skill

Conversation

@wei18

@wei18 wei18 commented May 19, 2026

Copy link
Copy Markdown
Owner

Summary

Post v1-feature-complete documentation sync.

methodology.md

  • 日期 2026-05-15 → 2026-05-19
  • Sub-agent roster + Senior Developer + Architect
  • 5 new patterns from Phase 0–9 execution: Leader-parallel work / heavy-phase pre-split / PROPOSAL-first dispatch / post-execution doc sweep / batch permission prompts
  • 2 anti-patterns: eager external-resource init crashing tests / CLI trial-and-error

ai-translated-localization SKILL

  • description now covers both scope-decision AND execution modes (skill is invocable for actually doing a translation pass)
  • New Execution playbook: 5 steps (seed pair → AI fan-out → locale gotchas → glossary → completeness gate)
  • Locale-specific gotchas distilled from Phase 9.5: ja semantic-not-literal, th no politeness markers, ko 해요체, es Latin neutral, zh-Hans 詞彙替換 not character convert
  • Field notes block (source=en, glossary beats per-string, 5 locales sweet spot)

Test plan

  • methodology.md renders cleanly on GitHub
  • L10n skill description <500 chars and triggers correctly when discoverer asks "translate / fill locales"
  • No broken cross-refs to other skills or docs

methodology.md:
- Date refresh 2026-05-15 -> 2026-05-19 (post v1 feature-complete)
- Sub-agent roster: +Senior Developer (architecture judgement), +Architect (cross-check)
- New patterns: Leader-parallel work, heavy-phase pre-split, PROPOSAL-first dispatch, post-execution doc sweep, batch permission prompts
- New anti-patterns: eager external-resource init crashing tests, CLI trial-and-error

ai-translated-localization SKILL:
- description now declares both scope-decision AND execution modes
- New "Execution playbook" with 5 steps: source seed / AI fan-out / locale gotchas / glossary / completeness gate
- Locale gotchas captured: ja memo-not-pencil, th no politeness markers, ko 해요체, es Latin neutral, zh-Hans 詞彙替換 over character convert
- Field notes: source=en primary=zh-Hant, glossary beats per-string, 5 locales is sweet spot
@wei18
wei18 merged commit 4c21d2d into main May 19, 2026
@wei18
wei18 deleted the docs/methodology-and-l10n-skill branch May 19, 2026 16:37
wei18 added a commit that referenced this pull request May 21, 2026
…llout (#78)

Brand audit §未決 #1 resolved with option (a) — extend design-system with
real difficulty color tokens so the AppIcon 07 sage/clay/amber trio is a
vocabulary the App actually speaks, not just icon decoration.

design-system.md
- New §Difficulty (v2+) subsection: 3 tokens × light+dark variants
  - difficulty.easy:   #5C7A4F / #9BB87E
  - difficulty.medium: #C97D5F / #D89A82
  - difficulty.hard:   #E6A857 / #EFC07F
- Calmness contract preserved: signaling-only footprint (cards + Picker),
  NOT general accent use
- Cross-ref to icon 07 + PR #63

Theme/Theme.swift + DefaultTheme.swift
- DifficultyTokens struct (3 ThemeColor entries)
- Added to Theme protocol

DailyHubView
- DailyPuzzleCard leads with 10pt tint circle + difficulty label colored
  by theme.difficulty.* (was text.primary)

PracticeHubView
- Segmented Picker .tint + Draw button .tint follow selected difficulty
  (was static accent.primary)

Verification
- swift build clean
- swift test --filter "DailyHub|Practice": 18/18 pass
- 6 snapshot baselines re-recorded (3 DailyHub + 3 Practice)

§未決 (impl-notes)
- Per-segment Picker tinting needs custom control (SwiftUI segmented has
  one .tint only) — backlog
- Dark-mode token hexes are designer-picked siblings; no dark AppIcon
  source-of-truth yet
- Card tint scope: leading dot + label only (per Liquid Glass usage)

Co-authored-by: Claude Opus 4.7 <[email protected]>
wei18 added a commit that referenced this pull request May 23, 2026
Tuist StoreKit (Project.swift): adds RunActionOptions.storeKitConfigurationPath
pointing at App/Resources/Sudoku.storekit. tuist generate now writes
StoreKitConfigurationFileReference into Sudoku.xcscheme — no manual Xcode
Scheme editor step per clone (task #58). Resolves v2.4-2.5-prep §未決 #1.

ASC App Privacy handoff (docs/v2/v2.5-readiness.md): research subagent
confirmed App Store Connect REST API has NO endpoint for the App Privacy
questionnaire. Fastlane workarounds require Apple-ID session cookies
(security downgrade vs .p8 JWT). Added manual handoff section with:
- ASC navigation path + URL pattern
- Field-by-field checklist matching PrivacyInfo.xcprivacy
- Re-trigger conditions
- Both en + zh-Hant ASC labels

References:
- meetings/2026-05-23_tuist-storekit-scheme.impl-notes.md
- meetings/2026-05-23_asc-app-privacy-api-research.impl-notes.md

Co-authored-by: Claude Opus 4.7 <[email protected]>
wei18 added a commit that referenced this pull request May 26, 2026
… 3 jobs (#159)

* ci(github-actions): consolidate 3 workflows into single lint.yml with 3 jobs

Per user request 2026-05-26:
- Merge pr-metadata.yml + docs-link-check.yml + lint.yml → single
  lint.yml with 3 sibling jobs (pr-metadata / docs-link-check /
  swift-lint). Simpler required-status-check setup when branch
  protection lands (one workflow name, three job names).

Key changes vs prior 3-file setup:
- pr-metadata job: ubuntu-latest (was already; no change)
- docs-link-check job: ubuntu-latest; gh api fetches changed
  markdown files (per user: drop fetch-depth: 0)
- swift-lint job: macos-latest (toolchain requirement);
  gh api replaces `git diff --diff-filter` (per user: drop
  fetch-depth: 0); strict swiftlint + hard-fail swiftformat
  preserved

All 3 jobs now use `gh api repos/.../pulls/<num>/files` to enumerate
changed files instead of `git diff` against the base ref. Benefits:
- Faster checkout (no full history)
- Smaller runner workspace
- Single canonical source of changed-file list (the PR API)
- No risk of merge-base resolution edge cases

Workflow-level path filter removed so the consolidated workflow always
runs; per-job logic decides what to do based on changed-files list
(empty → skip with explanatory log line).

Closes user 2026-05-26 requests:
- #2 pr-metadata: linux + drop fetch-depth + use gh api ✓
- #3 consolidate to single lint.yml with 3 jobs ✓
- #1 docs-link-check failure (apple.com 403?): NOT addressed in this PR
  — will need .lycheeignore follow-up after first run shows actual
  failing URLs

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

* ci+chore: remove swiftformat entirely + swift-lint job → ubuntu (user 2026-05-26)

Per user decision 2026-05-26:
- swiftlint coverage sufficient; swiftformat is redundant + double-tool
  maintenance cost not justified
- swift-lint job runner: macos-latest → ubuntu-latest (swiftlint has linux
  x86_64 binary via mise; no Swift toolchain needed for lint-only)

### Removed
- `.swiftformat` (config file, deleted)
- `.mise.toml` swiftformat pin
- `lefthook.yml` swiftformat hook
- `.github/workflows/lint.yml` SwiftFormat lint step
- `docs/foundations.md §7.5.1` option-b doc (strikethrough + obsolete note;
  historical impl-notes preserved at meetings/2026-05-26_swiftformat-option-b.impl-notes.md)
- `docs/foundations.md §Backlog` "swiftformat 加入 lefthook" entry
  (strikethrough + CANCELLED tag)

### Updated foundations §4 Phase 1 GH Actions description
- Reflects consolidated lint.yml (3 jobs in one workflow)
- Reflects swift-lint on ubuntu + swiftformat removal
- Cross-refs issues #156 #157 #158 for Phase 2/3 follow-ups

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

---------

Co-authored-by: Claude Opus 4.7 <[email protected]>
wei18 added a commit that referenced this pull request May 30, 2026
…se state

XCC iOS+macOS Test failed on PR #213's first push because
`HomeViewBannerTests.gateDenies_slotRendersNothing` and
`BoardViewBannerTests.running_butGateDenies_bannerSlotCollapsesToEmpty`
both relied on `makeAdGate(allow: false)`, which previously denied via a
fresh grace-period `firstLaunchAt`. With `AdGate.gracePeriodDays = 0`
(this PR's whole point), that denial path collapses and the helper now
allows the banner — tests fail.

Switch the deny path to `hasPurchasedRemoveAds = true` (rule #1 in
`shouldShowBanner`). Purchase-driven denial is purely state-driven, so
these helpers stay correct whether grace returns to 7 (per #212 revert)
or stays at 0. Test intent ("slot collapses when gate denies") preserved
— we just deny via a different rule.
wei18 added a commit that referenced this pull request May 30, 2026
…ibility (release-blocker #212) (#213)

* chore(ads): set AdGate.gracePeriodDays = 0 for TestFlight/dogfood visibility

Temporarily zero out the 7-day onboarding grace so banner placement can be
verified on TestFlight / Mac dogfood builds without waiting a week per
device install. Refactored the literal `7 * 86_400` into a named static
constant `AdGate.gracePeriodDays` so the revert is a single-line change.

The four AdGateLogicTests that assert the 7-day boundary
(`day0SuppressesDuringGrace`, `day6StillInGrace`, `day7BoundaryReleasesGrace`,
`justBeforeDay7BoundaryStillInGrace`) are `.disabled(...)`-traited with a
pointer to issue #212. Their bodies stay intact — re-enable by removing
the `.disabled(...)` trait, no other change needed.

**This MUST be reverted before the v2.5 App Store submission.**

Tracking: issue #212 (release-blocker label). `docs/v2/design.md` rule #6
documents the 7-day grace as a product commitment; this PR ships a
deviation from spec gated on a clear restore path.

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

* test(banner): switch Home/BoardView banner-tests' deny path to purchase state

XCC iOS+macOS Test failed on PR #213's first push because
`HomeViewBannerTests.gateDenies_slotRendersNothing` and
`BoardViewBannerTests.running_butGateDenies_bannerSlotCollapsesToEmpty`
both relied on `makeAdGate(allow: false)`, which previously denied via a
fresh grace-period `firstLaunchAt`. With `AdGate.gracePeriodDays = 0`
(this PR's whole point), that denial path collapses and the helper now
allows the banner — tests fail.

Switch the deny path to `hasPurchasedRemoveAds = true` (rule #1 in
`shouldShowBanner`). Purchase-driven denial is purely state-driven, so
these helpers stay correct whether grace returns to 7 (per #212 revert)
or stays at 0. Test intent ("slot collapses when gate denies") preserved
— we just deny via a different rule.

* ci(lint): scope swiftlint identifier_name disable in BoardViewBannerTests

---------

Co-authored-by: Claude Opus 4.7 <[email protected]>
wei18 added a commit that referenced this pull request Jun 3, 2026
…ings (ms phase 3) (#259)

Closes Phase 3 of MS monetization wire (per
meetings/2026-06-02_minesweeper-monetization-wire-proposal.md). MS
app now has full monetization composition modulo banner UI (deferred
to U15 follow-up). Mirrors Sudoku's wire shape per
feedback/minesweeper-mirrors-sudoku.

Code:
- MinesweeperAppComposition bag extended with persistence / iapClient /
  adProvider / adGate / monetizationStateStore / monetizationController /
  toastController
- Live.swift `.live()` wires:
    * LivePersistence(ckConfig: .minesweeper)
    * LiveStoreKit2IAPClient(knownProductIds: [minesweeperRemoveAdsProductId])
    * NoopAdProvider  (LiveAdMobBridge deferred to U15)
    * AdGate + MonetizationStateController(productId: ..., ...)
    * ToastController
- `.preview()` mirrors with MonetizationTesting fakes (matches Sudoku
  precedent of linking MonetizationTesting into production target)
- LiveRouteFactory threads monetizationController to the Settings route
- SettingsView mounts Section("Purchases") with shared MonetizationUI
  rows (RemoveAdsRow / RestorePurchasesRow / AdsRemovedRow)
- minesweeperRemoveAdsProductId published at module level for parity
  with removeAdsProductId in MonetizationUI

MonetizationStateController parameterization (CR-recommended option a):
- Added `productId: String = removeAdsProductId` default param
- 4 internal direct-ref to constant swapped to self.productId
- All 4 Sudoku test sites + Sudoku Live.swift + Preview.swift compile
  byte-identically (no arg = picks up defaulted Sudoku constant)
- Docstring updated to reflect MS Phase 3 landing

Tests:
- MinesweeperKit: 30/30 pass (+ extended AppCompositionTests + new
  MinesweeperSettingsViewTests)
- SudokuKit: 209/209 pass — Sudoku byte-identicality verified by CR

CR ACCEPT (round 1). Cosmetic C3 (docstring tense) applied inline.
Open follow-ups deferred to backlog:
- Toast overlay on MinesweeperRoot (CR Important #1 — defer per CR
  recommendation; MS has no live monetization surface until U15)
- FakePersistence target for MS Preview (CR Important #2)
- Hardened MS productId test (CR Important #3)

Refs:
- meetings/2026-06-02_minesweeper-monetization-wire-proposal.md §Phase 3
- meetings/2026-06-03_ms-monetization-phase3.impl-notes.md
- prereqs: #257 (.minesweeper config), #258 (multi-app iap config)
- closes mirror-monetization-loop (modulo banner U15)

Co-authored-by: Claude Opus 4.7 <[email protected]>
wei18 added a commit that referenced this pull request Jun 3, 2026
Skill CR (2026-06-03) found:
- description: starts 'Default pattern…' not 'Use when…' (CSO rule)
- Cross-ref to architect review file (missing — landed separately 8f8af17)
- Multi-app CI_PRODUCT dispatch absent
- Smoke-test scope ambiguity (source plist passes against literal $())
- No 'as!' anti-pattern warning
- No Project.swift wiring example
- No non-Tuist carve-out
- No Iron Law disclosure
- Migration playbook simplified without disclosure
- Anti-pattern 2 vs Migration step 3 internal conflict (fatalError)
- Outer .gitignore Tuist/*.xcconfig rule not explicit
- Rationalization counters thin

Full rewrite:
1. description leads with 'Use when…' + adds GADApplicationIdentifier /
   GADBannerUnitID / .p8 search keywords (~ 500 chars, under ceiling)
2. New 'Known testing gap' section discloses Iron Law violation
3. New 'Smoke test scope' section with ❌/✅ example showing source-plist
   trap + runtime-guard fix
4. New 'Multi-app dispatch' section with concrete CI_PRODUCT case-switch
   bash snippet
5. New 'Non-Tuist projects' carve-out
6. New 'Project.swift wiring' concrete snippet
7. New 'Verification checklist' (parallels apple-public-repo-security)
8. New 'Rationalizations table' with 6 explicit counters (memo + comment +
   private repo + small-app + 1-time + fatalError-grace)
9. Anti-pattern `as!` force-cast added (#5)
10. Anti-pattern Tuist clobbering unmanaged xcconfigs added (#8)
11. Anti-pattern #2 'fatalError forbidden long-term, allowed as transitional
    during xcconfig migration cycle' — resolves internal conflict with
    Migration step 3
12. Migration playbook disclosed as PR1's compressed reality, not
    Architect's 7-stage plan; cross-references architect review file
13. Cross-refs labelled REQUIRED / SIBLING

CR's Critical #1 (broken architect-review cross-reference) addressed
via 8f8af17 landing the file separately.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
wei18 added a commit that referenced this pull request Jun 3, 2026
Round 2 inline fixes from PR #265 CR (verdict: ACCEPT with cosmetics):

1. `.gitignore` `secrets/*` → `secrets/**` — covers subdirectory contents
   (e.g. a future `secrets/p8/` or `secrets/keys/`); current `*` form
   only matches top-level files.

2. `secrets/README.md` created — the .gitignore allowlist
   `!secrets/README.md` was forward-looking to a missing file; the
   README now exists with one-time setup + daily-use instructions
   pointing at memory `asc-api-credentials`.

3. Collapsed duplicate comment paragraphs in both Live.swift files
   (subagent had paste-stacked two adjacent explanations of the same
   substitution chain). Now a single tight paragraph mentioning
   smoke-test (`InfoPlistAdMobKeysTests`) + runtime guard role.

CR Important #1 (pre-existing prod-ID leaks in docs/ and meetings/) +
Important #2 (`AppInfo.plist` drift risk) deferred to follow-up backlog
issues — file separately.

Build: clean on both packages.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
wei18 added a commit that referenced this pull request Jun 3, 2026
…#265)

* feat(secrets): xcconfig + Info.plist substitution for AdMob ids (PR1)

Migrates Sudoku + Minesweeper AdMob configuration from
hardcoded-with-fatalError-gate to build-time xcconfig substitution.

Mechanism (mirrors existing Tuist/Signing.xcconfig precedent):
- Tuist/AdMob.xcconfig (gitignored) — local real values
- Tuist/AdMob.xcconfig.example (committed) — Google sandbox + docstring
  explaining both XCC env var source + local fill flow
- Tuist/Config-{Debug,Release}.xcconfig wrappers — #include? both
  Signing + AdMob (optional include keeps fresh clone buildable)
- Project.swift per-target xcconfig wiring (Sudoku + Minesweeper)
- Both Info.plist files use $(ADMOB_APP_ID) + $(ADMOB_BANNER_UNIT_ID)
  substitution (latter is a custom key we invented for app-side reads)
- Live.swift both apps: removed #if DEBUG / #else fatalError gate;
  reads GADBannerUnitID via Bundle.main.object(forInfoDictionaryKey:)
  through a guard that catches missing/empty/unresolved tokens
- ci_post_clone.sh: appended AdMob.xcconfig generation step that
  selects per-workflow env vars from $CI_PRODUCT / $CI_XCODE_SCHEME
  (fail-loud if missing)

Safety net (3 layers):
1. Smoke tests (InfoPlistAdMobKeysTests.swift) verify both keys exist
   in each app's source Info.plist — catches accidental key deletion
2. Runtime guard in both Live.swift — preconditionFailure on missing,
   empty, or literal $() token. Catches unresolved substitution at
   app launch before AdMob SDK rejects.
3. Subsequent PRs will add a build-phase substitution-resolution check
   to catch earlier than runtime

Tooling secrets (ASCRegister CLI, scope: scaffolding only):
- secrets/.env.example (committed) — KEY=VALUE structure + docstring
- secrets/ gitignore deny-by-default: * + !*.example + !README.md
- secrets/ASCAPI_AuthKey_*.p8 — user moves cert here post-merge
- ASCRegister CLI unchanged; user pattern: source secrets/.env
  before invoking, then pass via existing flags

Sudoku byte-identicality:
- DEBUG: literal banner-unit value unchanged (sandbox both before + after)
- Release: behavior changed from fatalError crash → preconditionFailure
  crash + smoke test pre-archive. Equivalent fail-loud safety.

AdMob SDK isolation audit: still exactly 1 import GoogleMobileAds
(LiveAdMobBridge.swift).

Tests:
- SudokuKit: 211/211 (existing 209 + 2 new smoke)
- MinesweeperKit: 33/33 (existing 31 + 2 new smoke)

Out of scope (subsequent PRs):
- Build-phase substitution-resolution check (Open Q1)
- gitleaks rule for prod AdMob IDs
- ADR / foundations.md update
- Removing precondition guard after one full prod release cycle

User-side post-merge (one-time):
1. cp Tuist/AdMob.xcconfig.example Tuist/AdMob.xcconfig + fill real
   values from project memory admob-production-ids +
   minesweeper-admob-ids
2. mv ~/GitHub/ASCAPI_AuthKey_*.p8 secrets/
3. ASC → Xcode Cloud → Workflow → Environment Variables: add
   SUDOKU_ADMOB_APP_ID / _BANNER_UNIT_ID +
   MINESWEEPER_ADMOB_APP_ID / _BANNER_UNIT_ID (mark Secret)

Refs:
- meetings/2026-06-03_admob-secret-injection-architect-review.md
- meetings/2026-06-03_admob-secret-injection-pr1.impl-notes.md
- .claude/skills/build-time-secret-injection/ (new project skill)

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

* fix(secrets): apply PR1 CR cosmetic findings

Round 2 inline fixes from PR #265 CR (verdict: ACCEPT with cosmetics):

1. `.gitignore` `secrets/*` → `secrets/**` — covers subdirectory contents
   (e.g. a future `secrets/p8/` or `secrets/keys/`); current `*` form
   only matches top-level files.

2. `secrets/README.md` created — the .gitignore allowlist
   `!secrets/README.md` was forward-looking to a missing file; the
   README now exists with one-time setup + daily-use instructions
   pointing at memory `asc-api-credentials`.

3. Collapsed duplicate comment paragraphs in both Live.swift files
   (subagent had paste-stacked two adjacent explanations of the same
   substitution chain). Now a single tight paragraph mentioning
   smoke-test (`InfoPlistAdMobKeysTests`) + runtime guard role.

CR Important #1 (pre-existing prod-ID leaks in docs/ and meetings/) +
Important #2 (`AppInfo.plist` drift risk) deferred to follow-up backlog
issues — file separately.

Build: clean on both packages.

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

---------

Co-authored-by: Claude Opus 4.7 <[email protected]>
wei18 added a commit that referenced this pull request Jun 3, 2026
#268)

Replace literal production AdMob App IDs / Banner Unit IDs in docs/ and
meetings/ with references to memory files (admob-production-ids /
minesweeper-admob-ids) per build-time-secret-injection anti-pattern #1.
History retains pre-scrub leaks (force-push not permitted); HEAD scrub
stops reinforcement.

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

* fix(minesweeper): scale board + add reveal/flag mode toggle (refs #278)

Tier-0 UX blockers from the Designer critique (#278), all in
MinesweeperBoardView. Three coupled fixes, one dispatch:

#1 Board scaling. The cell button was hardcoded frame(30,30) inside a
naked VStack/HStack with no GeometryReader, so Expert (16x30 ~ 960pt)
overflowed every iPhone and most Mac windows. The grid is now wrapped in
a GeometryReader that derives a single square cell side fitting the
NON-square board by its longer axis:
  cellSide = floor(min(availW/cols, availH/rows))
where availW/availH subtract the inter-cell spacing first. The cell
frame and the number/flag/mine glyph (font ~ cellSide * 0.55, replacing
the literal 16) both scale from it.

#2 Tap-target floor. minCellSide = 32pt. When the fitted side would drop
below the floor (e.g. Expert on iPhone fits ~10pt), cellSide is clamped
to 32 and the board scrolls (ScrollView([.horizontal,.vertical]))
instead of shrinking into an un-tappable grid. When it fits, the
ScrollView is inert.

#3 Discoverable reveal/flag toggle. Added an on-screen segmented Picker
(Reveal / Flag) above the board, modeled on Sudoku's pencil-mode toggle.
In Flag mode a tap flags; in Reveal mode a tap reveals. Long-press (iOS)
and right-click contextMenu (Mac) stay as flag accelerators in either
mode — Mac users no longer depend on an invisible right-click. Mode is
view-local @State (no engine semantics). Added .contentShape(Rectangle)
so the whole cell square is hit-testable.

Deferred: Tier-1 theme tokens, Tier-2 Mac side-rail (#6), win/lose
overlay (#7), VoiceOver (#10), .task loop cleanup (#9) — separate
dispatches.

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

* fix(minesweeper): address #278 Tier-0 CR — flag double-toggle + fit centering

CR REQUEST-CHANGES:
- iOS .flag-mode long-press double-toggle: in .flag mode the button tap +
  long-press both fired onToggleFlag, netting a no-op. Long-press now only
  flags in .reveal mode (redundant in .flag mode where tap already flags).
- Fitted board was pinned top-leading; now center the floored grid in the
  offered rect (mirrors Sudoku BoardView), only scrolling when clamped to floor.

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 16, 2026
…inite spinner online+signed-out (#536) (#537)

* fix(daily-hub): stabilise VM ownership via @State to fix infinite spinner (#536)

`DailyHubView` and `MinesweeperDailyHubView` stored the injected VM via
`@Bindable` (plain property assignment). When SwiftUI's `.navigationDestination`
closure re-invoked `LiveRouteFactory.view(for:)` during an AdMob banner WebView
load, the factory minted a fresh `.idle` DailyHubViewModel. The view's `@Bindable`
var was reassigned to this new instance; because SwiftUI kept the same view
identity, `.task { bootstrap() }` did NOT re-fire — leaving the new VM stuck at
`.idle` forever (infinite spinner). The original bootstrapped VM was orphaned.

Fix: change `@Bindable` → `@State` with `_viewModel = State(wrappedValue:)` in
both views. `@State` first-value-wins semantics mean SwiftUI retains the FIRST
bootstrapped instance for the navigation entry's lifetime; subsequent factory
invocations that mint fresh idle VMs are ignored by SwiftUI's property-wrapper
diffing. No change to VM logic, factory, or navigation wiring.

Adds `DailyHubViewOwnershipTests` pinning the model invariants the fix relies on
(bootstrapped VM keeps .loaded; factory re-mints start .idle; both are distinct
objects). Both packages green: SudokuKit 251/251, MinesweeperKit 179/179.

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

* style(tests): rename vm → viewModel to satisfy identifier_name lint gate

SwiftLint --strict: identifier_name requires ≥ 3 chars; `vm` tripped the
warning in DailyHubViewOwnershipTests. Rename to `viewModel` to match the
convention used throughout the suite. No logic change.

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

* docs(test-plans): Phase 3 v6 — #536 found+fixed, +4 MS/dark/a11y passes

Daily Hub cases #1/#2 flipped pend→pass after the #536 fix (transient
DailyHubViewModel orphaned by destination re-render → infinite spinner
when online + iCloud signed out). Also marks this session's independent
sim verifications: MS Loss Boom overlay, MS dark-mode cell tri-state,
MS per-cell VoiceOver labels. Now 20 pass / 0 fail / 23 pend.

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

---------

Co-authored-by: Claude <[email protected]>
wei18 added a commit that referenced this pull request Jun 17, 2026
…es filed) (#542)

Records this session's drivable-case sweep on the current sim:
- pass: #5 rapid double-tap Leave, #28 zh-Hant strings (+ earlier #1/#2/#10/
  #18/#25/#39 from #536 work)
- fail: #22 Dynamic-Type header clip (#540), #34 timer accrues background
  time (#539)
- pend w/ findings: #8 (near-win harness can't model home-return),
  #23 (digit-pad frames ≥44pt but glyphs render blank, #540),
  #29 (no tofu, but Purchases section unlocalized, #541)

New issues: #539 (solve timer counts background time — leaderboard fairness),
#540 (Dynamic Type AX3+ header/digit-pad breakage), #541 (Purchases/IAP
section unlocalized; L10n gate misses catalog-less literals).

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