fix(#50): add transaction history tracking#491
Open
senmalong wants to merge 6 commits into
Open
Conversation
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)
|
@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! 🚀 |
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
Closes #50
Implements full transaction history tracking — store, types, screen with detail view, and block explorer links.
Files
src/types/transaction.ts(new)Transactioninterface:id,subscriptionId,subscriptionName,amount,currency,status,type,date(ISO),txHash,chainId,explorerUrl,failureReason,notesTransactionStatusenum:pending | confirmed | failed | cancelledTransactionTypeenum:fiat | crypto | refundsrc/store/transactionStore.ts(new)subtrackr-transaction-history)addTransaction— prepends and caps at 500 recordsupdateTransactionStatus— update status + optional failure reasongetBySubscription/getByStatus— filtered selectorsclearHistorysrc/screens/TransactionHistoryScreen.tsx(new)FlatListof all transactions, newest firstLinking.openURL(explorerUrl/tx/txHash)src/store/index.ts— exportsuseTransactionStoresrc/navigation/types.ts— addsTransactionHistoryroutesrc/navigation/AppNavigator.tsx— registersTransactionHistoryScreenAcceptance Criteria
Linking.openURL