Skip to content

Conversation

@DRadmir
Copy link
Contributor

@DRadmir DRadmir commented Oct 31, 2025

BannerSetupService is now injected and used throughout onboarding and wallet creation flows. The VerifyPhraseViewModel uses BannerSetupService to set up onboarding banners after wallet import. Service injection and environment propagation have been updated across navigation stacks, view models, and service factories. BannerSetupService's onboarding logic is refactored for direct invocation.

Features/Onboarding/Sources/Scenes/ShowSecretDataScene.swift minor fix

BannerSetupService is now injected and used throughout onboarding and wallet creation flows. The VerifyPhraseViewModel uses BannerSetupService to set up onboarding banners after wallet import. Service injection and environment propagation have been updated across navigation stacks, view models, and service factories. BannerSetupService's onboarding logic is refactored for direct invocation.
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @DRadmir, 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 streamlines the process of setting up onboarding banners by integrating the BannerSetupService throughout the application's wallet creation and import flows. The changes involve updating dependency injection mechanisms across several view models and navigation stacks, as well as refactoring the banner setup logic to be more directly invokable and less coupled to internal state checks.

Highlights

  • BannerSetupService Integration: The BannerSetupService has been deeply integrated into the onboarding and wallet creation flows, ensuring that banner setup logic is consistently applied during these critical user journeys.
  • Dependency Injection Updates: The BannerSetupService is now injected across various components, including CreateWalletNavigationStack, OnboardingViewModel, VerifyPhraseViewModel, and RootSceneViewModel, and propagated through AppResolver, ServicesFactory, and EnvironmentValues.
  • Onboarding Banner Logic Refinement: The VerifyPhraseViewModel now directly invokes bannerSetupService.setupOnboarding after a wallet import, replacing a previous completeInitialSynchronization call. The setupOnboarding method in BannerSetupService has been made public and simplified by removing an internal isCompleteInitialSynchronization check.
  • Minor UI Adjustment: A redundant .listStyle(.plain) modifier was removed from the ShowSecretDataScene.
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
Contributor

@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 successfully integrates BannerSetupService into the onboarding and wallet creation flows. The dependency is now correctly propagated through the necessary view models and navigation stacks. The logic for displaying onboarding banners has been refactored for a more direct invocation, which simplifies the process. I've included a couple of suggestions to enhance error handling and to clarify a logic change that occurred during the refactoring concerning view-only wallets. Overall, the changes are well-implemented.

let wallet = try await walletService.importWallet(name: name, type: .phrase(words: self.words, chains: AssetConfiguration.allChains))

WalletPreferences(walletId: wallet.id).completeInitialSynchronization()
try? bannerSetupService.setupOnboarding(wallet: wallet)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The importWallet() function is marked as throws, but the potential error from bannerSetupService.setupOnboarding(wallet: wallet) is being suppressed with try?. This means if adding the onboarding banner fails, the error will be silently ignored. It would be better to let the error propagate to the caller, onImportWallet(), which already has a do-catch block to handle errors and inform the user.

Suggested change
try? bannerSetupService.setupOnboarding(wallet: wallet)
try bannerSetupService.setupOnboarding(wallet: wallet)

Comment on lines +46 to +50
public func setupOnboarding(wallet: Wallet) throws {
try store.addBanners([
NewBanner.onboarding(walletId: wallet.walletId)
])
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The previous implementation of setupOnboarding included a check to avoid showing the banner for view-only wallets. This check was removed during refactoring. This might be unintentional, as view-only wallets have limited functionality and some onboarding steps may not be relevant. If this was an oversight, consider re-introducing a check for the wallet type to avoid showing this banner for view-only wallets.

Suggested change
public func setupOnboarding(wallet: Wallet) throws {
try store.addBanners([
NewBanner.onboarding(walletId: wallet.walletId)
])
}
public func setupOnboarding(wallet: Wallet) throws {
guard wallet.type != .view else { return }
try store.addBanners([
NewBanner.onboarding(walletId: wallet.walletId)
])
}

@DRadmir DRadmir self-assigned this Oct 31, 2025
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.

2 participants