Skip to content

fix(#50): add transaction history tracking#491

Merged
Smartdevs17 merged 8 commits into
Smartdevs17:mainfrom
senmalong:fix/50-transaction-history
Jun 25, 2026
Merged

fix(#50): add transaction history tracking#491
Smartdevs17 merged 8 commits into
Smartdevs17:mainfrom
senmalong:fix/50-transaction-history

Conversation

@senmalong

Copy link
Copy Markdown
Contributor

Summary

Closes #50

Implements full transaction history tracking — store, types, screen with detail view, and block explorer links.

Files

src/types/transaction.ts (new)

  • Transaction interface: id, subscriptionId, subscriptionName, amount, currency, status, type, date (ISO), txHash, chainId, explorerUrl, failureReason, notes
  • TransactionStatus enum: pending | confirmed | failed | cancelled
  • TransactionType enum: fiat | crypto | refund

src/store/transactionStore.ts (new)

  • Zustand store persisted to AsyncStorage (subtrackr-transaction-history)
  • addTransaction — prepends and caps at 500 records
  • updateTransactionStatus — update status + optional failure reason
  • getBySubscription / getByStatus — filtered selectors
  • clearHistory

src/screens/TransactionHistoryScreen.tsx (new)

  • FlatList of all transactions, newest first
  • Filter chips: All / Confirmed / Pending / Failed
  • Each row: subscription name, date, type, amount, colour-coded status badge; crypto rows show shortened tx hash
  • Tap a row → bottom-sheet detail panel with full fields
  • Block explorer link: Linking.openURL(explorerUrl/tx/txHash)

src/store/index.ts — exports useTransactionStore

src/navigation/types.ts — adds TransactionHistory route

src/navigation/AppNavigator.tsx — registers TransactionHistoryScreen

Acceptance Criteria

  • Transactions stored (Zustand + AsyncStorage, capped at 500)
  • History screen displays transactions with filter chips
  • Details show amount, date, status, tx hash, chain ID, failure reason
  • Links to block explorer work via Linking.openURL

senmalong added 6 commits June 1, 2026 07:41
autoFocus opens the keyboard immediately on mount, which can block
UI elements before the screen finishes rendering. Replace it with a
ref-based focus triggered after a 300 ms delay, giving the navigation
transition time to complete on both iOS and Android.

- Add nameInputRef (useRef<TextInput>) to the name field
- Remove autoFocus prop from the name TextInput
- Focus the input programmatically after 300 ms in a useEffect
- Import useRef from React
…lity tracking

- Switch KeyboardAvoidingView behavior to 'padding' on iOS and
  undefined on Android (Android handles scroll natively)
- Track keyboard show/hide events with Keyboard listeners to set
  isKeyboardVisible state
- Apply extra bottom padding to ScrollView content when keyboard is
  open so all form fields remain reachable
- Import Keyboard from react-native
- Add src/services/crashReporter.ts: persists crash records to
  AsyncStorage, installs a global ErrorUtils handler for uncaught JS
  errors, detects previous crash on next launch, and supports optional
  remote endpoint reporting
- Add src/components/CrashRecoveryModal.tsx: modal shown on launch
  when a previous crash is detected; lets user trigger data recovery
  or continue without recovering
- Update ErrorBoundary to call crashReporter.recordCrash() in
  componentDidCatch so React render errors are also persisted
- Initialize crashReporter early in App startup (alongside i18n)
- On launch, if a previous crash is detected, show CrashRecoveryModal
- handleRecover calls crashReporter.attemptDataRecovery() which clears
  corrupted AsyncStorage state while preserving settings and auth keys
- handleDismissRecovery marks the crash as notified so the modal does
  not reappear on subsequent launches
- Import Alert for recovery-failure feedback
- Add src/types/transaction.ts: Transaction interface with id,
  subscriptionId, subscriptionName, amount, currency, status, type,
  date, txHash, chainId, explorerUrl, failureReason, notes
- Add TransactionStatus (pending/confirmed/failed/cancelled) and
  TransactionType (fiat/crypto/refund) enums
- Add src/store/transactionStore.ts: Zustand persisted store with
  addTransaction, updateTransactionStatus, getBySubscription,
  getByStatus, clearHistory; capped at 500 records via AsyncStorage
- Export useTransactionStore from src/store/index.ts
- Add TransactionHistory route to RootStackParamList
…d explorer link

- Add src/screens/TransactionHistoryScreen.tsx:
  - FlatList of all transactions, newest first
  - Filter chips: All / Confirmed / Pending / Failed
  - Each row shows subscription name, date, type, amount, status badge
  - Crypto transactions show shortened tx hash
  - Tap a row to open a bottom-sheet detail panel with full info
  - Detail panel shows txHash, chainId, failureReason, notes
  - 'View on Block Explorer' button opens explorerUrl/tx/<hash> via
    Linking.openURL (satisfies 'links to explorer' acceptance criterion)
- Register TransactionHistory screen in AppNavigator (SettingsStack)
@drips-wave

drips-wave Bot commented Jun 1, 2026

Copy link
Copy Markdown

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

@Smartdevs17

Copy link
Copy Markdown
Owner

⚠️ Merge failed — check CI status.

🤖 Drips Wave Merge Agent

@Smartdevs17

Copy link
Copy Markdown
Owner

❌ This PR has merge conflicts.

Hi @senmalong,

Please resolve the conflicts with main so this can be merged.


🤖 Drips Wave Merge Agent

@senmalong

Copy link
Copy Markdown
Contributor Author

@Smartdevs17 conflict resolved

@senmalong

Copy link
Copy Markdown
Contributor Author

@Smartdevs17 kindky review

@gitguardian

gitguardian Bot commented Jun 25, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard.
Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
34266369 Triggered Generic Password 66f2c0d backend/config/tests/redis.test.ts View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@Smartdevs17 Smartdevs17 merged commit 85350c4 into Smartdevs17:main Jun 25, 2026
10 of 30 checks passed
abimbolaalabi pushed a commit to abimbolaalabi/SubTrackr that referenced this pull request Jun 26, 2026
* fix(Smartdevs17#72): replace autoFocus with delayed focus via useRef

autoFocus opens the keyboard immediately on mount, which can block
UI elements before the screen finishes rendering. Replace it with a
ref-based focus triggered after a 300 ms delay, giving the navigation
transition time to complete on both iOS and Android.

- Add nameInputRef (useRef<TextInput>) to the name field
- Remove autoFocus prop from the name TextInput
- Focus the input programmatically after 300 ms in a useEffect
- Import useRef from React

* fix(Smartdevs17#72): improve KeyboardAvoidingView and keyboard visibility tracking

- Switch KeyboardAvoidingView behavior to 'padding' on iOS and
  undefined on Android (Android handles scroll natively)
- Track keyboard show/hide events with Keyboard listeners to set
  isKeyboardVisible state
- Apply extra bottom padding to ScrollView content when keyboard is
  open so all form fields remain reachable
- Import Keyboard from react-native

* fix(Smartdevs17#59): add crash reporter service and recovery modal

- Add src/services/crashReporter.ts: persists crash records to
  AsyncStorage, installs a global ErrorUtils handler for uncaught JS
  errors, detects previous crash on next launch, and supports optional
  remote endpoint reporting
- Add src/components/CrashRecoveryModal.tsx: modal shown on launch
  when a previous crash is detected; lets user trigger data recovery
  or continue without recovering
- Update ErrorBoundary to call crashReporter.recordCrash() in
  componentDidCatch so React render errors are also persisted

* fix(Smartdevs17#59): wire crash reporting into App.tsx startup

- Initialize crashReporter early in App startup (alongside i18n)
- On launch, if a previous crash is detected, show CrashRecoveryModal
- handleRecover calls crashReporter.attemptDataRecovery() which clears
  corrupted AsyncStorage state while preserving settings and auth keys
- handleDismissRecovery marks the crash as notified so the modal does
  not reappear on subsequent launches
- Import Alert for recovery-failure feedback

* fix(Smartdevs17#50): add Transaction types and transactionStore

- Add src/types/transaction.ts: Transaction interface with id,
  subscriptionId, subscriptionName, amount, currency, status, type,
  date, txHash, chainId, explorerUrl, failureReason, notes
- Add TransactionStatus (pending/confirmed/failed/cancelled) and
  TransactionType (fiat/crypto/refund) enums
- Add src/store/transactionStore.ts: Zustand persisted store with
  addTransaction, updateTransactionStatus, getBySubscription,
  getByStatus, clearHistory; capped at 500 records via AsyncStorage
- Export useTransactionStore from src/store/index.ts
- Add TransactionHistory route to RootStackParamList

* fix(Smartdevs17#50): add TransactionHistoryScreen with detail view and explorer link

- Add src/screens/TransactionHistoryScreen.tsx:
  - FlatList of all transactions, newest first
  - Filter chips: All / Confirmed / Pending / Failed
  - Each row shows subscription name, date, type, amount, status badge
  - Crypto transactions show shortened tx hash
  - Tap a row to open a bottom-sheet detail panel with full info
  - Detail panel shows txHash, chainId, failureReason, notes
  - 'View on Block Explorer' button opens explorerUrl/tx/<hash> via
    Linking.openURL (satisfies 'links to explorer' acceptance criterion)
- Register TransactionHistory screen in AppNavigator (SettingsStack)
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.

📊 Add transaction history tracking

2 participants