Repository navigation
refactor(mirror): unify SettingsView wrapper + Root.plist into one shared source - #838
Merged
Merged
Conversation
…dle Root.plist into one shared source SettingsView + SettingsViewModel had structurally diverged (Sudoku was VM-driven with a bootstrap task; Minesweeper took primitive version:/ clearCache: params and duplicated the clear-cache logic as a free function on LiveRouteFactory). Both now live once in GameAppKit as GameAppKit.SettingsView / SettingsViewModel — the "shared composition, deps allowed" layer, since the wrapper needs Persistence/MonetizationUI/GameCenterClient that SettingsKit (near-zero-dep) must not import. SudokuUI/MinesweeperUI keep thin generic typealiases so existing call sites stay source-compatible. The Sudoku-only Generator row is now a genuinely per-game config value (SettingsViewModel.generatorVersionLabel: String?, replacing the SudokuEngine- typed GeneratorVersion field) rendered via the new shared SettingsUI.SettingsAboutExtraRow building block. Minesweeper gains the VM's bootstrap()/clearCache() seam it had drifted away from (a behavior no-op today since its latestInProgress() still returns nil, matching prior documented parity-only behavior). Root.plist (the Settings.bundle entry point LicensePlist never writes) is single-sourced at App/Shared/Settings.bundle/Root.plist; a new gen:settings_root mise task re-syncs byte-identical copies into both apps' own Settings.bundle before every tuist generate (wired into mise-tasks/tuist/generate + ci_post_clone.sh) so a stale/hand-edited per-app copy can't survive the next generate. Two alternative mechanisms were tried and reverted after a local xcodebuild reproduced real failures: a second Tuist resource entry pointing straight at the shared path collides with Xcode's "Multiple commands produce" once license-plist's per-app output exists alongside it; a tracked symlink resolves fine in the checkout but ships broken (Xcode's Copy Bundle Resources preserves symlinks verbatim instead of dereferencing them). Sudoku's snapshot baselines stay byte-identical (verified — the shared VM's generatorVersionLabel default is nil, so Sudoku's test fixtures now pass GeneratorVersion.v1.rawValue explicitly, matching production's LiveRouteFactory wiring). Minesweeper's LiveRouteFactory.clearCache free function + its ClearCacheFeedbackTests are removed (redundant with the shared VM's own coverage in SudokuKit's SettingsViewTests, now exercising the identical class). Closes #832 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.
What
Closes #832 — the two per-app SettingsView wrappers had structurally diverged (Sudoku VM-driven with bootstrap + generator About row vs MS primitive params, the exact #448 drift class). Now ONE shared
GameAppKit.SettingsView<Banner>+SettingsViewModel; per-app files reduced to 2-line typealias shims. Settings.bundle Root.plist is single-sourced fromApp/Shared/via agen:settings_rootbyte-copy task wired into tuist generate + CI post-clone.Shape
generatorVersionLabel: String?(Sudoku passesGeneratorVersion.v1.rawValue, MS omits → row absent, matching prior behavior); the row itself is a new dep-freeSettingsUI.SettingsAboutExtraRow.clearCachefree function deleted; its 2 tests replaced 1:1 by SudokuKit tests exercising the identical shared class (326→324 accounted).Review
Dual CR. Mechanical: 10/10 PASS. Adversarial: REQUEST_CHANGES on one docs defect — three comments (.gitignore + 2× Project.swift) still called the copies 'symlinks', an intra-PR contradiction that would mislead the next editor into a silently-discarded edit; fixed Leader-inline (all three now say byte-copy + edit-the-shared-source warning), tuist generate re-verified after amend. All code claims independently reproduced: mirror fidelity line-by-line (zero Sudoku behavior change, Sudoku baselines byte-identical, zero PNG churn), layer placement, typealias compatibility, test accounting, CI ordering. Reviewer also confirmed the PersistenceKit 'revert' visible in a stale-base diff is an artifact (branch cut one commit behind; disjoint files, squash-merge safe).
Verification
SudokuKit Settings 43/43 + Composition 31/31 · SettingsKit 49/49 · GameAppKit 43/43 · MinesweeperKit 324/324 --no-parallel · scan:l10n green · swiftlint --strict clean · tuist generate + real xcodebuild build succeed with Root.plist landing correctly beside LicensePlist output.
🤖 Generated with Claude Code