Skip to content

Conversation

@DRadmir
Copy link
Contributor

@DRadmir DRadmir commented Dec 23, 2025

Summary

  • Refactor AlertToast to simplified banner-only style displayed from top (HUD-like)
  • Add EventManager package for centralized event/toast handling
  • Move toast presentation logic to RootScene level
  • Remove unused toast code and types

Changes

AlertToast refactoring:

  • Remove unused display modes (alert, hud) — keep only banner
  • Remove unused alert types (complete, error, image, loading, regular) — keep only systemImage
  • Show toast from top instead of bottom
  • Delete ActivityIndicator.swift
  • Simplify BlurView

Screencast

Simulator.Screen.Recording.-.iPhone.17.Pro.-.2025-12-26.at.13.17.59.mov

Fix: #1522

@DRadmir DRadmir requested a review from gemcoder21 December 23, 2025 06:46
@DRadmir DRadmir self-assigned this Dec 23, 2025
@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 resolves an issue where perpetual-related toasts were incorrectly displayed even when an operation was cancelled. The changes introduce a more robust and centralized system for managing these toasts by moving their presentation logic to the WalletSceneViewModel and introducing a dedicated isPresentingPerpetualToast binding. A new View+Toast extension simplifies toast display, ensuring that toasts are now only shown upon the successful completion of perpetual actions, thereby improving the user experience and accuracy of feedback.

Highlights

  • Centralized Perpetual Toast Management: Introduced a new isPresentingPerpetualToast binding in WalletSceneViewModel to centralize the management and display of toasts specifically for perpetual operations, ensuring they are only shown upon successful completion.
  • New View+Toast Extension: Added a View+Toast extension in PrimitivesComponents that allows views to present toasts directly using a Binding<ToastType?>, simplifying toast presentation logic and improving reusability.
  • Refactored Completion Handlers: Modified completion handler logic across WalletSceneViewModel and PerpetualNavigationView to ensure toasts are triggered only when an operation (like perpetual close or order) successfully completes, resolving the issue of toasts appearing on cancellation.
  • ToastType Equatable Conformance: Made the ToastType enum conform to the Equatable protocol, which is necessary for its use with onChange modifiers and other comparison operations in SwiftUI.

🧠 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 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 refactors the handling of toast messages, particularly for perpetual actions, by introducing a new isPresentingPerpetualToast: ToastType? binding. The PerpetualSceneViewModel no longer directly manages toastMessage and its related functions are consolidated into a generic onPerpetualActionComplete. The WalletSceneViewModel now sets the isPresentingPerpetualToast property based on transfer and perpetual recipient completion events. A new View+Toast extension simplifies toast presentation using ToastType, and ToastType itself is made Equatable. The PerpetualNavigationView and WalletNavigationStack are updated to utilize this new centralized toast management system. Additionally, a minor UI refactoring replaces a manual toolbar cancel button with a reusable .toolbarDismissItem in ConfirmTransferNavigationStack.

@DRadmir DRadmir force-pushed the 1522-perpetuals-toast-is-shown-when-it-shouldnt-be branch from 6d7c48d to 2bd6bee Compare December 23, 2025 06:54
@DRadmir DRadmir marked this pull request as draft December 24, 2025 18:16
@DRadmir DRadmir force-pushed the 1522-perpetuals-toast-is-shown-when-it-shouldnt-be branch from d651d92 to 7e628bf Compare December 26, 2025 08:04
…tation

  - Simplify AlertToast to banner-only style shown from top
  - Add EventManager package for event handling
  - Move toast presentation to RootScene level
@DRadmir DRadmir force-pushed the 1522-perpetuals-toast-is-shown-when-it-shouldnt-be branch from 7e628bf to 386e520 Compare December 26, 2025 08:14
@DRadmir DRadmir marked this pull request as ready for review December 26, 2025 15:53
@DRadmir DRadmir force-pushed the 1522-perpetuals-toast-is-shown-when-it-shouldnt-be branch from b89c262 to 01a8e24 Compare December 26, 2025 16:49
Renamed EventManager to EventPresenterService and updated all references throughout the codebase. Removed AppEvent and EventPresentationType in favor of ToastEvent, simplifying event handling to focus on toast presentation. Adjusted dependency injection, environment values, and test kits to use the new service. Updated affected files in Transfer, Gem, and related modules to reflect these changes.
@DRadmir DRadmir force-pushed the 1522-perpetuals-toast-is-shown-when-it-shouldnt-be branch from 01a8e24 to 4219356 Compare December 26, 2025 17:04
@DRadmir DRadmir merged commit 659f8cd into main Dec 26, 2025
3 checks passed
@DRadmir DRadmir deleted the 1522-perpetuals-toast-is-shown-when-it-shouldnt-be branch December 26, 2025 18:21
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.

Perpetuals toast is shown when it shouldn’t be

3 participants