Repository navigation
feat(web): link the mobile app's store listings in the page footer - #665
Merged
Merged
Conversation
Staff on the web had no in-app way to find the mobile app. Every operator and admin page (OperatorShell) and every sign-in page ((auth) layout) now ends with a footer: "Get the mobile app: App Store · Google Play". Store links are tenant configuration, not literals: - Google Play is derived from the existing psdEoc:androidApplicationId (https://play.google.com/store/apps/details?id=<id>). - App Store needs the numeric Apple ID, which cannot be derived from the bundle id, so a new optional tenant key psdEoc:appleAppStoreId is read in infra/src/stack/config.ts (pattern ^[1-9][0-9]{5,11}$), passed to App Runner as PSD_EOC_APPLE_APP_STORE_ID only when set, and read by appleAppStoreId() in packages/server/lib/config/deployment.ts, which fails closed on a malformed value like its siblings. - mobileStoreListings() (lib/config/store-listings.ts) builds both URLs; each is null when unconfigured, and the footer renders nothing when both are null, so a district without store builds links to nothing. StoreLinksFooter awaits connection() so the env is read at request time and never baked into a page prerendered at build. The footer is rendered without a Suspense boundary, consistent with OperatorShell's note about keeping the shell in the initial HTML. Links open in a new tab with rel="noopener noreferrer". Example config (cdk.local.example.json, synthesize-example.ts), the docs contract index and prose in docs/CONFIGURATION.md, and the stack config test cover the new key. New tests: store-listings.test.ts (unconfigured, configured, independent, malformed) and store-links-footer.test.tsx (both, one, none).
Review: PR #665, store links in the page footerIMPORTANT: none. The diff is clean on correctness, security, student data, and test/CI weakening. What I checked by reading (I did not run tests, lint, or the build):
NIT
Nothing else to report. |
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
Every operator/admin page and every sign-in page now ends with a footer: Get the mobile app: App Store · Google Play.
How
psdEoc:androidApplicationId.psdEoc:appleAppStoreId. It is passed to App Runner asPSD_EOC_APPLE_APP_STORE_IDonly when set, and read byappleAppStoreId(), which fails closed on a malformed value.mobileStoreListings()builds both URLs. Each one is null when unconfigured, and the footer renders nothing when both are null.StoreLinksFooterawaitsconnection()so the config is read at request time. Without that, a page prerendered at build would keep the build's empty values.Evidence
bun run checkpassed: 6/6 shards, 520 pass, 0 fail; mobile native 88/88.store-listings.test.ts: unconfigured, configured, one store only, malformed id.store-links-footer.test.tsx: both stores, one store, none./loginrendered the footer withhttps://apps.apple.com/app/id6801607849andhttps://play.google.com/store/apps/details?id=net.psd401.eoc. Both listings return 200.Deploy note
The App Store link appears in production only after a
cdk deploy.psdEoc:appleAppStoreId: "6801607849"has been added to the git-ignoredinfra/cdk.local.json. The Play link appears on the next deploy with no config change.