Repository navigation
Read the App Store page from a build setting and fix rename leaks - #113
Merged
Merged
Conversation
Strings.appStoreUrl was hardcoded to MyTurnTag Creator's App Store page, so the forced-update screen's Update App button sent users of every app built from the template there. It now comes from APP_STORE_ID, the app's Apple ID, in the new AppStore.xcconfig (included by the new Project.xcconfig, now the project-level base configuration; overridable in the gitignored AppStore.local.xcconfig), built into Info.plist as AppStoreID: https://apps.apple.com/app/id<APP_STORE_ID>. Empty, as committed, or not all digits hides the button; the screen still asks users to install the new version. An ID avoids the xcconfig "//" comment trap a whole URL would hit. Rename safety (SUBSTRATE-CONTRACT rules 1, 5 and 6): - JSONAPIDocumentTest used "itemTag" as an unknown type; the agent renames item_tag and itemTag to the same word, so it became a known type in generated apps. It now checks account (not in EntityType), shopkeeperSignIn (camelCase; sign_in is not renamed, so it stays different from shopkeeper_sign_in) and Shop (capitalized). - NSLocalNetworkUsageDescription had an article before the product name; it now reads "Connects to the app's API server running on your local network during development." LocalizationTest fails on "a"/"an" right before a renamed word in the English strings. - Comments drop the article before domain words and say "the agent" instead of the agent's name, which the rename turns into <slug>-agent. Closes #109 Closes #110 Closes #111 Closes #112 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UZJxUoubntzu7Ec7DPVfAr
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.
Problem
Strings.appStoreUrlwas hardcoded to MyTurnTag Creator's App Store page, so the forced-update screen (NeedAppUpdatesView) sent users of every app built from the template there.JSONAPIDocumentTest.otherTypeNamesHaveNoEntityTypeused"itemTag"as a type name with no entity type. The agent renamesitem_taganditemTagto the same word, so in a generated app it is a known type and the test fails.NSLocalNetworkUsageDescription(en) had an article before the product name, which reads wrong after a rename.Fix
#109: App Store page from a build setting
AppStore.xcconfigwithAPP_STORE_ID =(empty), overridable in the gitignoredAppStore.local.xcconfig, and a newProject.xcconfigthat includes it, set as the project-level base configuration of Debug and Release, as in NativeAppTemplate-iOS (where it also includesRevenueCat.xcconfig/Sentry.xcconfig). The target's Debug base staysAPI.xcconfig. Built intoInfo.plistasAppStoreID.Strings.appStoreIdreads it;Strings.appStoreUrlis nowURL?:https://apps.apple.com/app/id<APP_STORE_ID>, nil when the ID is empty or not all digits (Strings.appStorePage(appStoreId:)).//comment trap (a URL would needhttps:/$()/…), and it is easy to validate.MainViewpasses{ NeedAppUpdatesView() }instead ofNeedAppUpdatesView.init, since the view now has aninit(appStoreUrl:)with a default.#110: no domain words as unknown types
otherTypeNamesHaveNoEntityTypenow checksaccount(not in EntityType),shopkeeperSignIn(camelCase) andShop(capitalized), keeping the "only those exact names" intent.accountis fine here: the agent does not rename it, and Free'sEntityTypehas no account.EntityTypehas only domain types, so a camelCase / capitalized near miss has to use a domain word. These two stay different from the real names after any rename:shopkeeper_sign_in→<x>_sign_invs<x>SignIn(sign_inis not renamed), and the rename keeps case, soShop→Clinicvsshop→clinic.itemTagwas the only one that collapsed (item_taganditemTagboth become the same single word).unknownThing,accountsInvitation,Account, since itsEntityTypehas non-domain types.#111: Local Network prompt
"Connects to the app's API server running on your local network during development." in
Info.plistandInfoPlist.xcstrings(en). The Japanese is unchanged. NewLocalizationTest.noArticleBeforeARenamedWordfails on "a"/"an" right before shop(s), shopkeeper(s), item tag(s) or the product name in the English strings (Localizable keys and en values, InfoPlist en values, the built Info.plist's usage descriptions). The pattern itself is renamed with the rest, so it keeps working in generated apps.#112: comments (and other occurrences found by grep)
\b[Aa]n? (item ?tag|shop|shopkeeper|NativeAppTemplate)(case-insensitive, also across line breaks):ItemTagRepositoryTest.swift:90LocalizationTest.swift:77LocalizationTest.swift:66APIEndpointTest.swift:27ShopRepositoryTest.swift:74RootPathServicesTest.swift:32DataStateListContentTest.swift:12CHANGELOG.md[Unreleased]Left as is: CONTRIBUTING.md's quoted bad example ("Swipe an item tag …"), and the mentions of / links to nativeapptemplate-agent in AGENTS.md / CONTRIBUTING.md (docs about the agent, not code or test comments).
Tests
NeedAppUpdatesViewTest: no page for""," ",id…, a whole URL,12a4;https://apps.apple.com/app/id1234567890for1234567890; the button is there with a page and gone without one (viaAccessibilityElements), while the instruction text stays.InfoPlistTest.declaresTheAppStoreIDandtheAppStoreIDIsEmptyOrAnAppleID.noArticleBeforeARenamedWordfailed; with the button always shownnoAppStorePageHidesTheUpdateAppButtonfailed; without the digits checknoAppleIdHasNoAppStorePagefailed (4 cases);APP_STORE_ID = abcinAppStore.local.xcconfigfailedtheAppStoreIDIsEmptyOrAnAppleID. Here,APP_STORE_ID = 1234567890inAppStore.local.xcconfigreached the built Info.plist (AppStoreID) in both Debug and Release, so the new project-level base configuration is wired.Verification
make lint: 0 SwiftLint violations, 0 files need SwiftFormatAppVersionwithforced_updatein the API. The view is rendered byNeedAppUpdatesViewTestinstead.🤖 Generated with Claude Code
https://claude.ai/code/session_01UZJxUoubntzu7Ec7DPVfAr