Conversation
Summary of ChangesHello @thakel, 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 mechanism to conditionally hide the airdrop login functionality within the mobile wallet application. It refactors the "no activity" message into a reusable component and enhances the transaction service to calculate mined Tari, which influences the display of activity-related UI elements. These changes streamline the user experience by adapting the profile view based on airdrop support and improving UI component reusability. Highlights
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. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a feature flag to hide the Airdrop login functionality, presenting a simplified profile view instead. This is a good step towards modularizing features. The "no activity" UI has been nicely refactored into a reusable SwiftUI component, and a similar implementation was added for the UIKit-based profile screen. I've also noticed a good bug fix where the amount of mined Tari is now calculated correctly from coinbase transactions instead of using the total wallet balance.
My review includes a few suggestions for improvement, mainly around localizing hardcoded strings for better maintainability and internationalization, and removing some redundant or dead code. Overall, the changes are well-structured and improve the codebase.
| Text("You don’t have any activity yet.") | ||
| .headingLarge() | ||
| Text("Once you receive some XTM, you’ll see it here.") | ||
| .body2() |
There was a problem hiding this comment.
The strings "You don’t have any activity yet." and "Once you receive some XTM, you’ll see it here." are hardcoded. For better maintainability and to support internationalization, these strings should be extracted into a localization file (e.g., Localizable.strings). SwiftUI's Text initializer can then use the localization keys directly.
| Text("You don’t have any activity yet.") | |
| .headingLarge() | |
| Text("Once you receive some XTM, you’ll see it here.") | |
| .body2() | |
| Text("no_activity.title", comment: "Title for empty activity list") | |
| .headingLarge() | |
| Text("no_activity.subtitle.xtm", comment: "Subtitle for empty activity list") | |
| .body2() |
| vstack.alignment = .center | ||
| vstack.distribution = .fill | ||
| vstack.spacing = 0 | ||
| vstack.translatesAutoresizingMaskIntoConstraints = false |
There was a problem hiding this comment.
This line is likely redundant. Other views in this file that are decorated with the @TariView property wrapper do not set translatesAutoresizingMaskIntoConstraints = false explicitly, which suggests that the property wrapper handles this configuration. To maintain consistency, please verify and remove this line.
| let title = UILabel() | ||
| title.text = "You don’t have any activity yet." | ||
| title.font = .Poppins.SemiBold.withSize(16) | ||
| vstack.addArrangedSubview(title) | ||
|
|
||
| let subtitle = UILabel() | ||
| subtitle.text = "Once you receive some XTM, you’ll see it here." | ||
| subtitle.font = .Poppins.Medium.withSize(12) | ||
| vstack.addArrangedSubview(subtitle) |
There was a problem hiding this comment.
The text for the title and subtitle labels is hardcoded. To support internationalization and improve maintainability, these strings should be localized using NSLocalizedString. This also helps in keeping the text consistent with the SwiftUI NoActivity view by sharing localization keys.
| let title = UILabel() | |
| title.text = "You don’t have any activity yet." | |
| title.font = .Poppins.SemiBold.withSize(16) | |
| vstack.addArrangedSubview(title) | |
| let subtitle = UILabel() | |
| subtitle.text = "Once you receive some XTM, you’ll see it here." | |
| subtitle.font = .Poppins.Medium.withSize(12) | |
| vstack.addArrangedSubview(subtitle) | |
| let title = UILabel() | |
| title.text = NSLocalizedString("no_activity.title", comment: "Title for empty activity list") | |
| title.font = .Poppins.SemiBold.withSize(16) | |
| vstack.addArrangedSubview(title) | |
| let subtitle = UILabel() | |
| subtitle.text = NSLocalizedString("no_activity.subtitle.xtm", comment: "Subtitle for empty activity list") | |
| subtitle.font = .Poppins.Medium.withSize(12) | |
| vstack.addArrangedSubview(subtitle) |
| @@ -87,8 +89,12 @@ final class ProfileViewController: SecureViewController<NewProfileView>, WKNavig | |||
| .store(in: &cancellables) | |||
|
|
|||
| Tari.shared.wallet(.main).walletBalance.$balance | |||
No description provided.