From 83ffb1aa8c592bea9c8cf98078b6fd171dd7fec4 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 12 Jun 2026 07:56:43 +0000 Subject: [PATCH] Fix stale v1.2.1 displays and single-source the app version The splash screen, About screen, Settings, and Crashlytics still showed v1.2.1 after the bump to 1.2.2 because the version was hardcoded in each. - Add constants/app-version.ts exporting APP_VERSION read from app.json via expo-constants, and use it in SplashScreen, About, Settings, and the Crashlytics attributes so in-app displays can never go stale again - Add a "What's New in 1.2.2?" section to the About screen (expanded by default) summarizing the CHANGELOG entry - Update the README version badge and bug report template placeholder to 1.2.2 - Document a Version Update Checklist in CLAUDE.md covering every location a version bump must touch https://claude.ai/code/session_01TBgovoNmgRSB8DcnCFrfTd --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- CLAUDE.md | 15 +++++++++++++++ README.md | 2 +- app/(tabs)/settings.tsx | 3 ++- app/about.tsx | 14 ++++++++++++-- components/SplashScreen.tsx | 3 ++- constants/app-version.ts | 6 ++++++ services/crashlytics-service.ts | 3 ++- 8 files changed, 41 insertions(+), 7 deletions(-) create mode 100644 constants/app-version.ts diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 3041f2a5..6fca011e 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -69,7 +69,7 @@ body: attributes: label: App Version description: Which version of BitSleuth Wallet are you using? - placeholder: e.g., 1.2.1 + placeholder: e.g., 1.2.2 validations: required: true diff --git a/CLAUDE.md b/CLAUDE.md index 9e580c4d..f4be03b9 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -208,6 +208,21 @@ node scripts/test-biometric.js | Constants | UPPER_SNAKE_CASE | `MAX_FEE_RATE` | | Types/Interfaces | PascalCase | `WalletState` | +### Version Update Checklist (MUST FOLLOW) + +When asked to bump/update the app version, update **ALL** of the following: + +1. `app.json` (`expo.version`) — **drives all in-app version displays** (splash screen, About screen, Settings, Crashlytics) via `constants/app-version.ts` +2. `package.json` (`version`) +3. `android/app/build.gradle` (`versionName`, and bump `versionCode`) +4. `ios/BitSleuthWallet/Info.plist` (`CFBundleShortVersionString`) +5. `CHANGELOG.md` — add the new release entry +6. `README.md` — version badge near the top +7. `app/about.tsx` — add a "What's New in X.Y.Z?" `DropdownSection` at the top with `defaultExpanded={true}` (remove `defaultExpanded` from the previous version's section) +8. `.github/ISSUE_TEMPLATE/bug_report.yml` — App Version placeholder example + +**NEVER hardcode the version number in components or services.** Always import `APP_VERSION` from `@/constants/app-version`, which reads it from `app.json` via `expo-constants`. + ### Documentation Organization **All markdown files MUST go in the `docs/` folder**, with these exceptions: diff --git a/README.md b/README.md index 9ae370bb..a12f0d8b 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ **A professional-grade, non-custodial Bitcoin wallet for iOS and Android** -[![Version](https://img.shields.io/badge/version-1.2.1-blue.svg)](https://github.com/BitSleuthAI/Wallet) +[![Version](https://img.shields.io/badge/version-1.2.2-blue.svg)](https://github.com/BitSleuthAI/Wallet) [![Platform](https://img.shields.io/badge/platform-iOS%20%7C%20Android-lightgrey.svg)](https://github.com/BitSleuthAI/Wallet) [![License](https://img.shields.io/badge/license-AGPL--3.0-blue.svg)](LICENSE) [![React Native](https://img.shields.io/badge/React%20Native-0.81-61dafb.svg)](https://reactnative.dev/) diff --git a/app/(tabs)/settings.tsx b/app/(tabs)/settings.tsx index bc871e5c..23c4011f 100644 --- a/app/(tabs)/settings.tsx +++ b/app/(tabs)/settings.tsx @@ -6,6 +6,7 @@ import { useAutoLock } from '@/hooks/auto-lock-store'; import { useTabAnimation } from '@/hooks/use-tab-animation'; import { useWallet } from '@/hooks/wallet-store'; import { HapticService } from '@/services/haptic-service'; +import { APP_VERSION } from '@/constants/app-version'; import type { FiatCurrency } from '@/types/wallet'; import { getWalletTypeDisplayName } from '@/types/wallet'; @@ -377,7 +378,7 @@ function SettingsScreenContent() { router.push('/about')} /> diff --git a/app/about.tsx b/app/about.tsx index fc7535be..6f854b61 100644 --- a/app/about.tsx +++ b/app/about.tsx @@ -15,6 +15,7 @@ import { useWallet } from '@/hooks/wallet-store'; import { GradientBackground } from '@/components/GradientBackground'; import { AndroidSafeContainer } from '@/components/AndroidSafeContainer'; import crashlyticsService from '@/services/crashlytics-service'; +import { APP_VERSION } from '@/constants/app-version'; interface DropdownSectionProps { title: string; @@ -103,11 +104,20 @@ export default function AboutScreen() { About BitSleuth Wallet - Version 1.2.1 + Version {APP_VERSION} - + + + + + + + + + + diff --git a/components/SplashScreen.tsx b/components/SplashScreen.tsx index cfa22739..72da207f 100644 --- a/components/SplashScreen.tsx +++ b/components/SplashScreen.tsx @@ -9,6 +9,7 @@ import { View, } from 'react-native'; import Svg, { Circle, Path } from 'react-native-svg'; +import { APP_VERSION } from '@/constants/app-version'; interface SplashScreenProps { onAnimationComplete?: () => void; @@ -122,7 +123,7 @@ export default function SplashScreen({ onAnimationComplete }: SplashScreenProps) {/* Version and description */} - v1.2.1 + {`v${APP_VERSION}`} Bitcoin Wallet diff --git a/constants/app-version.ts b/constants/app-version.ts new file mode 100644 index 00000000..01b39dc8 --- /dev/null +++ b/constants/app-version.ts @@ -0,0 +1,6 @@ +import Constants from 'expo-constants'; + +// Single source of truth for the displayed app version, read from app.json. +// Bump expo.version in app.json and every consumer (splash screen, About, +// Settings, Crashlytics) updates automatically. +export const APP_VERSION: string = Constants.expoConfig?.version ?? '0.0.0'; diff --git a/services/crashlytics-service.ts b/services/crashlytics-service.ts index ecd78ec6..946e5464 100644 --- a/services/crashlytics-service.ts +++ b/services/crashlytics-service.ts @@ -1,4 +1,5 @@ import { Platform } from 'react-native'; +import { APP_VERSION } from '@/constants/app-version'; // Firebase Crashlytics with fallback for web/missing native module let crashlytics: any = null; @@ -253,7 +254,7 @@ if (isInitialized && crashlytics && !isExpoGo) { crashlytics.setUserId('anonymous'); crashlytics.setAttributes({ platform: Platform.OS, - appVersion: '1.2.1', + appVersion: APP_VERSION, buildType: __DEV__ ? 'debug' : 'release', environment: 'development-build', });