Add fiat transactions history on buy/sell screen#1810
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a significant new feature, allowing users to view their fiat transaction history directly within the application's buy/sell interface. It provides a dedicated screen to list all fiat transactions and a detailed view for each, enhancing transparency and user experience for fiat operations. The changes involve new UI components, a dedicated service layer for transaction management, and robust data persistence to ensure transaction history is readily available. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a significant new feature: a history screen for fiat transactions. The implementation is well-structured, adding new scenes, view models, services, and database components across the relevant packages. The code follows existing architectural patterns, such as using reactive queries to populate views from a local store. My feedback focuses on improving user experience through better error handling, enhancing accessibility by adjusting color usage, and general code hygiene.
Packages/Primitives/TestKit/FiatTransaction+PrimitivesTestKit.swift
Outdated
Show resolved
Hide resolved
Packages/PrimitivesComponents/Sources/ViewModels/FiatTransactionViewModel.swift
Show resolved
Hide resolved
- Add FiatTransactionsScene (activity list) and FiatTransactionDetailScene with asset preview headers - Add FiatTransactionService for fetching and storing fiat transaction history - Add FiatTransactionStore with GRDB persistence and observable queries - Add FiatTransactionViewModel producing ListItemModel with status tags (pending/failed) - Add FiatTransactionStatusViewModel for consistent status colors - Add FiatProviderName display names and images for providers - Add FiatAmountDisplay for fiat-only transaction headers - Pass fiatTransactionService through model chain from app target (no @Entry/@Environment hack) - Update AmountSceneViewModel and ConfirmTransferSceneViewModel to carry fiatTransactionService - Add navigation from FiatConnectNavigationView to activity list and detail screens - Gray subtitle color for failed transactions, no +/- signs on fiat amounts
Keep only the transaction list for now. Remove: - FiatTransactionDetailScene, ViewModel, and Section types - FiatTransactionRequest (single-item GRDB query) - FiatAmountDisplay and AmountDisplay.fiat case - ExplorerService dependency from FiatConnect - Scenes.FiatTransaction navigation type
dbd98fc to
851a342
Compare
Features/FiatConnect/Sources/Scenes/FiatTransactionsScene.swift
Outdated
Show resolved
Hide resolved
Features/Transfer/Sources/ViewModels/AmountSceneViewModel.swift
Outdated
Show resolved
Hide resolved
| .references(AssetRecord.databaseTableName, onDelete: .cascade, onUpdate: .cascade) | ||
| $0.column(Columns.transactionType.name, .text) | ||
| .notNull() | ||
| $0.column(Columns.providerId.name, .text) |
There was a problem hiding this comment.
| $0.column(Columns.providerId.name, .text) | |
| $0.column(Columns.providerId.name, .jsonText) |
There was a problem hiding this comment.
we use .text for simple string/enum columns. jsonText is for JSON-encoded structures
…conformance Single FiatService handles both fiat API calls and transaction history, removing the dual injection of GemAPIFiatService + FiatTransactionService. Also adds consistent chevron to all fiat transaction rows.
…fiat-transactions-history-on-buy-sell-screen # Conflicts: # Packages/Store/Sources/Migrations.swift
| .filter(FiatTransactionRecord.Columns.walletId == walletId.id) | ||
| .asRequest(of: FiatTransactionRecordInfo.self) | ||
| .fetchAll(db) | ||
| .map { $0.map() } |
There was a problem hiding this comment.
.order(FiatTransactionRecord.Columns.createdAt.desc)
DateSectionBuilder uses to group by date, the sections will be correct, but items within sections may appear in arbitrary order.
| ListItemView(model: viewModel.listItemModel) | ||
| } | ||
| } else { | ||
| NavigationCustomLink( |
There was a problem hiding this comment.
There will be chevron with no action, maybe instead just use ListItemView?
…fiat-transactions-history-on-buy-sell-screen
Close: #1807
Close: #1409