Skip to content

Hide Airdrop login#1242

Merged
thakel merged 2 commits intodevelopmentfrom
hide-airdrop-support
Jan 23, 2026
Merged

Hide Airdrop login#1242
thakel merged 2 commits intodevelopmentfrom
hide-airdrop-support

Conversation

@thakel
Copy link
Copy Markdown
Contributor

@thakel thakel commented Jan 23, 2026

No description provided.

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

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

  • Conditional Airdrop Login Display: The profile screen now conditionally displays the airdrop login flow based on an isAirdropSupported flag. When not supported, the login view is hidden, and a simplified profile view is shown.
  • Refactoring of "No Activity" View: The "You don’t have any activity yet." message has been extracted into a dedicated NoActivity SwiftUI view and a noActivityView UIStackView for consistency and reusability across different parts of the application.
  • Mined Tari Calculation: A new utility function minedTari() has been added to TariTransactionsService to calculate the total amount of mined Tari from completed transactions, which is then used to determine the visibility of the "no activity" message.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +46 to +49
Text("You don’t have any activity yet.")
.headingLarge()
Text("Once you receive some XTM, you’ll see it here.")
.body2()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Comment on lines +431 to +439
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)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This line of code is a statement with no effect and appears to be unused. It seems to be a remnant from a previous implementation. It should be removed to clean up the code and avoid any potential confusion.

@thakel thakel merged commit 9eed825 into development Jan 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants