feat(mobile): about section with version, network, contracts and links - #591
Open
Adeolu01 wants to merge 1 commit into
Open
feat(mobile): about section with version, network, contracts and links#591Adeolu01 wants to merge 1 commit into
Adeolu01 wants to merge 1 commit into
Conversation
Fills in the About row in settings with the housekeeping details users occasionally need: the installed version, the network the app is signing against, the contract addresses it talks to, and the links to reach for when something looks wrong. The version comes from the native build (falling back to the Expo config in Expo Go) so the screen cannot report a version the app is not running, and the network and contract facts are derived from lib/network.ts rather than duplicated. Links open in an in-app browser tab and only https is followed.
|
@Adeolu01 is attempting to deploy a commit to the miracle656's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Adeolu01 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Summary
The About row in settings stops being a placeholder: it now shows which build is installed, which network the app is signing against, which contracts it talks to, and the links to reach for when something looks wrong.
closes #492
What changed
lib/about.ts— the facts, derived rather than storedgetAppVersion()readsConstants.nativeApplicationVersionfirst and only falls back to theapp.jsonvalue, because the native build number is the truth for an installed app and the config value is the closest thing available in Expo Go and on web. A build with neither reportsunknownrather than an empty string, so a broken read looks broken instead of looking like version "".getNetworkFacts()andgetContractEntries()take their network fromlib/network.ts— the same module the rest of the app builds and signs transactions with — so the screen cannot drift from what the app is actually pointed at. An unconfigured value is reported as "Not configured" rather than rendered as a blank row.explorerAddressUrl()links an address to stellar.expert, choosingcontract/forC…andaccount/forG…and mapping mainnet to the explorer'spublicsegment. Anything that is not one of those two shapes returns null and the UI shows the address without a link, rather than offering one that 404s.openExternalUrl()opens links in an in-app browser tab viaexpo-web-browser, falling back to the platform's own handling where that is unavailable (web). Onlyhttpsis followed. These URLs are the app's own constants today, but a link surface that accepts any scheme is one contract-supplied string away from opening something it should not, so the check lives at the boundary instead of at each call site.components/AboutSection.tsxRead-only by design — it is the transparency and support surface, not a place where anything can be changed. Version, network, and contracts are grouped into cards using the existing
components/uikit and theme tokens, so it sits alongside the rest of settings without new styling. Contract addresses are middle-truncated with both ends visible, tap to copy through the existingAddressChip, and carry an Explorer link where one applies. The wallet address is read from the keychain after mount, and the effect is guarded so a resolve after unmount does not set state.Links are rendered as rows that state where they go, are announced with the
linkaccessibility role, and surface a message in place if nothing on the device can open them.app/(tabs)/settings.tsxThe
aboutrow renders the new section; every other row keeps its existing placeholder until its own issue lands. No routing change — the section uses the same in-page detail view the settings shell already has.lib/network.tsAdds
factoryContractId, resolved fromEXPO_PUBLIC_FACTORY_CONTRACT_ID_TESTNET/_MAINNETwith a sharedEXPO_PUBLIC_FACTORY_CONTRACT_IDfallback on testnet — the same precedence asfrontend/wallet/lib/network.ts, which mobile's copy had left out.Testing
npm test— 15 new unit tests inlib/__tests__/about.test.ts: the version precedence and its two fallbacks; the network facts including the unconfigured-RPC case; contract entries with and without addresses; explorer URLs for contracts, accounts, mainnet, and the five rejection cases (null, empty, malformed, wrong length, right length but neither prefix); that every shipped link is https; andopenExternalUrlacross the in-app browser, the scheme rejections, the platform fallback, and total failure. 127 tests pass on this branch.npm run typecheckpasses.The rendering itself is not covered by an automated test — the app has no component-test setup yet — so the logic behind every value on the screen is unit-tested and the section is a thin presentation layer over it.
Notes for review
expo-web-browseras the only new dependency, pinned to the same~57.0.xline as the other Expo modules in the app.