Skip to content

feat(mobile): about section with version, network, contracts and links - #591

Open
Adeolu01 wants to merge 1 commit into
Miracle656:mainfrom
Adeolu01:feat/mobile-settings-about
Open

feat(mobile): about section with version, network, contracts and links#591
Adeolu01 wants to merge 1 commit into
Miracle656:mainfrom
Adeolu01:feat/mobile-settings-about

Conversation

@Adeolu01

Copy link
Copy Markdown

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 stored

getAppVersion() reads Constants.nativeApplicationVersion first and only falls back to the app.json value, 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 reports unknown rather than an empty string, so a broken read looks broken instead of looking like version "".

getNetworkFacts() and getContractEntries() take their network from lib/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, choosing contract/ for C… and account/ for G… and mapping mainnet to the explorer's public segment. 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 via expo-web-browser, falling back to the platform's own handling where that is unavailable (web). Only https is 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.tsx

Read-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/ui kit 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 existing AddressChip, 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 link accessibility role, and surface a message in place if nothing on the device can open them.

app/(tabs)/settings.tsx

The about row 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.ts

Adds factoryContractId, resolved from EXPO_PUBLIC_FACTORY_CONTRACT_ID_TESTNET / _MAINNET with a shared EXPO_PUBLIC_FACTORY_CONTRACT_ID fallback on testnet — the same precedence as frontend/wallet/lib/network.ts, which mobile's copy had left out.

Testing

npm test — 15 new unit tests in lib/__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; and openExternalUrl across the in-app browser, the scheme rejections, the platform fallback, and total failure. 127 tests pass on this branch.

npm run typecheck passes.

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

  • Adds expo-web-browser as the only new dependency, pinned to the same ~57.0.x line as the other Expo modules in the app.
  • The resource URLs are the ones the website footer and README already publish (docs site, repo, issues, security policy, license), so there is one set of links to update rather than two.

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
Adeolu01 requested a review from Miracle656 as a code owner July 29, 2026 21:16
@vercel

vercel Bot commented Jul 29, 2026

Copy link
Copy Markdown

@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.

@drips-wave

drips-wave Bot commented Jul 29, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

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.

64. About / version / links

1 participant