Skip to content

feat(add-assets): show wallet enabled coins in the "Add Assets" page#2976

Merged
CharlVS merged 22 commits intodevfrom
feat/show-wallet-coins-in-add-assets
Jul 25, 2025
Merged

feat(add-assets): show wallet enabled coins in the "Add Assets" page#2976
CharlVS merged 22 commits intodevfrom
feat/show-wallet-coins-in-add-assets

Conversation

@takenagain
Copy link
Copy Markdown
Contributor

@takenagain takenagain commented Jul 22, 2025

Fixes

The same coin deactivation logic from #2750 should apply here as well:

Coin activation failures tested with:

  • GRR
  • DOT-HCO20

Coin deactivation test cases from #2750 (comment) should apply in the "Add Assets" page as well:

  • Disabling coin works and persists after logging out and back in again.
  • Disabling parent shows popup listing child tokens.
  • Disabling parent disables children as well.
  • Disabling parent is permanent (does not re-appear, persists through logout/login cycle).
  • Disabling coin with open maker order shows popup warning.
  • Disabling coin with open maker order cancels the order.
  • Disabling parent coin with open maker order cancels the order, disables parent, and disables children.
  • Disabling coin with active swap shows a popup warning and does not allow the user to proceed

Summary by CodeRabbit

  • New Features

    • Added sorting options for coins by protocol, balance, or name in the Coins Manager.
    • Introduced coin removal workflow with confirmation dialogs and checks for active swaps or open orders.
    • Enhanced filtering to exclude test coins based on user settings.
  • Improvements

    • Coin activation and deactivation now occur asynchronously with improved error handling.
    • Coin selection in "add" mode now reflects wallet coins automatically.
    • Send and swap buttons update their enabled state based on coin activity and balance.
    • Added control over notification broadcasting during coin activation.
    • Coins Manager now merges wallet coins into selected coins list and applies sorting and filtering consistently.
    • Added robust retry logic with exponential backoff for coin and asset activation.
    • Unified and simplified coin activation and synchronization logic.
    • Updated authentication state handling to prevent premature logged-in state emission.
    • Immediate loading state emitted during Trezor authentication initialization.
  • Bug Fixes

    • Unified logic for disabling actions on inactive coins.
    • Avoided unnecessary state emissions during coin updates.
  • Removals

    • Removed deprecated address selection widgets and related UI components.
    • Deprecated switching between adding and removing assets in the Coins Manager.
    • Removed deprecated fields and methods from the Coin model and repository.
  • Refactor

    • Simplified and centralized coin sorting, filtering, and removal logic within the Coins Manager.
    • Updated Coin model to use value equality and removed deprecated fields.
    • Moved coin removal validation and confirmation flow from UI layer to bloc-driven event handling.
    • Simplified coin balance refreshing logic by removing wallet type branching.
    • Removed local sorting state from UI components, delegating sorting fully to bloc state.

* feat(wallet): show enabled coins in add asset

* fix(wallet): show enabled assets in add coins
@takenagain takenagain self-assigned this Jul 22, 2025
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jul 22, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This change set introduces new dependencies and event handlers for the Coins Manager feature, refactors sorting and coin removal logic into the bloc, and updates state management accordingly. It also modifies coin activation logic to allow notification suppression, removes deprecated fields and widgets, and adjusts UI logic to rely on bloc-driven state and events.

Changes

File(s) Change Summary
lib/bloc/app_bloc_root.dart Injects SettingsRepository and TradingEntitiesBloc into CoinsManagerBloc provider.
lib/bloc/coins_bloc/coins_bloc.dart Simplifies coin refresh logic, changes event transformers, improves state emission, and refactors coin activation and synchronization logic.
lib/bloc/coins_bloc/coins_repo.dart Adds notify parameter to activation methods with retry logic and exponential backoff; removes deprecated methods; updates wallet metadata handling.
lib/bloc/coins_manager/coins_manager_bloc.dart Adds dependencies, event handlers, async activation/deactivation, sorting, and coin removal confirmation with trading-related blocking checks.
lib/bloc/coins_manager/coins_manager_event.dart Adds new events for sorting and coin removal; deprecates switching event.
lib/bloc/coins_manager/coins_manager_sort.dart Adds sorting enum and data class for coin manager.
lib/bloc/coins_manager/coins_manager_state.dart Adds sorting and removal state to CoinsManagerState; introduces removal block reason and state class.
lib/model/coin.dart Removes deprecated accounts field; makes Coin extend Equatable with defined props.
lib/views/wallet/coin_details/coin_details_info/address_select.dart Removes the AddressSelect widget and its implementation.
lib/views/wallet/coin_details/coin_details_info/coin_details_common_buttons.dart Updates button enabled logic to use SDK balance and coin activity status.
lib/views/wallet/coin_details/withdraw_form/widgets/fill_form/fields/fill_form_trezor_sender_address.dart Removes the FillFormTrezorSenderAddress widget.
lib/views/wallet/coins_manager/coins_manager_list_header.dart Updates imports; no logic changes.
lib/views/wallet/coins_manager/coins_manager_list_wrapper.dart Refactors to use bloc-driven sorting and removal, moves confirmation logic to bloc listener.
lib/views/wallet/coins_manager/coins_manager_page.dart Removes coins state listener, now uses auth state for UI rendering.
test_units/tests/utils/test_util.dart Removes deprecated accounts field from Coin construction in tests.
lib/bloc/auth_bloc/auth_bloc.dart Removes Trezor wallet check in lifecycle handler; blocks emitting loggedIn state during loading.
lib/bloc/auth_bloc/trezor_auth_mixin.dart Emits loading state immediately at start of Trezor auth handler.
lib/shared/utils/utils.dart Changes confirmBeforeDisablingCoin callback to named optional parameter.
lib/views/wallet/coin_details/coin_details_info/coin_details_info.dart Updates call to confirmBeforeDisablingCoin to use named callback parameter.
lib/views/wallet/wallet_page/common/expandable_coin_list_item.dart Updates call to confirmBeforeDisablingCoin to remove deprecated argument.

Sequence Diagram(s)

sequenceDiagram
    participant UI
    participant CoinsManagerBloc
    participant SettingsRepository
    participant TradingEntitiesBloc
    participant CoinsRepo

    UI->>CoinsManagerBloc: CoinsManagerSortChanged / CoinsManagerCoinRemoveRequested
    CoinsManagerBloc->>SettingsRepository: (for filtering/sorting settings)
    CoinsManagerBloc->>TradingEntitiesBloc: (check for open orders/swaps)
    CoinsManagerBloc->>CoinsRepo: activateCoinsSync/deactivateCoinsSync (with notify flag)
    CoinsRepo-->>CoinsManagerBloc: Activation/deactivation result
    CoinsManagerBloc-->>UI: Updated state (with sort/removal info)
    UI->>CoinsManagerBloc: CoinsManagerCoinRemoveConfirmed/Cancelled (via dialog)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~90 minutes

Possibly related PRs

Suggested labels

bug, QA

Suggested reviewers

  • smk762
  • AndrewDelaney
  • CharlVS

Poem

🐇 Through coin lists and states I hop,
Sorting, removing, no more flop.
With retries and checks, activation's tight,
Errors cleared, and UI light.
No more old fields, just clean and bright,
Coins managed well, in day and night! ✨

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/show-wallet-coins-in-add-assets

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jul 22, 2025

Visit the preview URL for this PR (updated for commit f6edb10):

https://walletrc--pull-2976-merge-4dyp53me.web.app

(expires Fri, 01 Aug 2025 00:39:55 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: f66a4ff03faa546f12f0ae5a841bd9eff2714dcc

@takenagain takenagain added the UX Cosmetic or flow efficiency enhancements for improved User Experience label Jul 22, 2025
@takenagain takenagain added this to the v0.10.0 Release milestone Jul 22, 2025
@takenagain
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jul 23, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@takenagain takenagain requested a review from Copilot July 23, 2025 08:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements wallet coin visibility in the "Add Assets" page by showing enabled (active) coins with their checkboxes pre-selected. The key changes include significant refactoring of the coins manager to improve separation of concerns, state management, and coin removal flow handling.

Key Changes:

  • Added wallet coins to the "Add Assets" list with pre-selected checkboxes for active coins
  • Refactored coin removal logic into a more structured state-driven approach with proper trading activity validation
  • Moved sorting logic and coin filtering from UI components to the bloc for better state management

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
lib/bloc/coins_manager/coins_manager_bloc.dart Major refactoring with new coin removal state handling, improved sorting logic, and wallet coin integration
lib/bloc/coins_manager/coins_manager_state.dart Added removal state tracking and sort data to state management
lib/bloc/coins_manager/coins_manager_event.dart Added new events for removal flow and sort changes
lib/views/wallet/coins_manager/coins_manager_list_wrapper.dart Simplified UI logic by moving sorting and filtering to bloc
lib/model/coin.dart Made Coin extend Equatable and removed deprecated accounts field
lib/bloc/coins_bloc/coins_repo.dart Added notify parameter to activation methods for better control
Comments suppressed due to low confidence (1)

lib/bloc/coins_manager/coins_manager_bloc.dart:292

  • Using assets.single when iterating over multiple assets will cause a runtime error. Should use the current asset from the loop instead.
        ? coins

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🔭 Outside diff range comments (2)
lib/views/wallet/coin_details/coin_details_info/coin_details_common_buttons.dart (1)

297-329: Replace deprecated withOpacity method.

The pipeline flags that withOpacity is deprecated and should be replaced with withValues() to avoid precision loss.

-                color: Theme.of(context).colorScheme.onSurface.withOpacity(0.7),
+                color: Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.7),

Apply similar changes to other instances of withOpacity in this section.

lib/views/wallet/coins_manager/coins_manager_page.dart (1)

6-7: Remove unused imports.

The pipeline flags that the imports for CoinsBloc and CoinsManagerBloc are no longer used after the refactoring.

-import 'package:web_dex/bloc/coins_bloc/coins_bloc.dart';
-import 'package:web_dex/bloc/coins_manager/coins_manager_bloc.dart';
🧹 Nitpick comments (3)
lib/views/wallet/coins_manager/coins_manager_list_header.dart (1)

8-9: Consider using super parameter for the key.

The pipeline suggests converting the key parameter to a super parameter for better performance and cleaner code.

-  const CoinsManagerListHeader({
-    Key? key,
+  const CoinsManagerListHeader({
+    super.key,
     required this.sortData,
     required this.isAddAssets,
     required this.onSortChange,
-  }) : super(key: key);
+  });
lib/views/wallet/coins_manager/coins_manager_page.dart (1)

14-19: Consider using super parameter for the key.

The pipeline suggests converting the key parameter to a super parameter for consistency with modern Dart practices.

-  const CoinsManagerPage({
-    Key? key,
+  const CoinsManagerPage({
+    super.key,
     required this.action,
     required this.closePage,
-  }) : super(key: key);
+  });
lib/views/wallet/coins_manager/coins_manager_list_wrapper.dart (1)

83-136: Well-structured coin removal flow!

The method properly handles all edge cases for coin removal with appropriate user feedback. The sequential checks for active swaps, open orders, and parent-child relationships ensure safe coin removal.

Consider extracting the dialog confirmation logic into separate methods for better testability:

+  Future<void> _handleOpenOrdersConfirmation(
+    BuildContext context,
+    CoinRemovalState removalState,
+    CoinsManagerBloc bloc,
+  ) async {
+    final confirmed = await confirmCoinDisableWithOrders(
+      context,
+      coin: removalState.coin.abbr,
+      ordersCount: removalState.openOrdersCount,
+    );
+    bloc.add(confirmed
+        ? const CoinsManagerCoinRemoveConfirmed()
+        : const CoinsManagerCoinRemovalCancelled());
+  }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ce1956e and 1b77daf.

📒 Files selected for processing (15)
  • lib/bloc/app_bloc_root.dart (1 hunks)
  • lib/bloc/coins_bloc/coins_bloc.dart (2 hunks)
  • lib/bloc/coins_bloc/coins_repo.dart (6 hunks)
  • lib/bloc/coins_manager/coins_manager_bloc.dart (5 hunks)
  • lib/bloc/coins_manager/coins_manager_event.dart (2 hunks)
  • lib/bloc/coins_manager/coins_manager_sort.dart (1 hunks)
  • lib/bloc/coins_manager/coins_manager_state.dart (4 hunks)
  • lib/model/coin.dart (3 hunks)
  • lib/views/wallet/coin_details/coin_details_info/address_select.dart (0 hunks)
  • lib/views/wallet/coin_details/coin_details_info/coin_details_common_buttons.dart (4 hunks)
  • lib/views/wallet/coin_details/withdraw_form/widgets/fill_form/fields/fill_form_trezor_sender_address.dart (0 hunks)
  • lib/views/wallet/coins_manager/coins_manager_list_header.dart (1 hunks)
  • lib/views/wallet/coins_manager/coins_manager_list_wrapper.dart (2 hunks)
  • lib/views/wallet/coins_manager/coins_manager_page.dart (1 hunks)
  • test_units/tests/utils/test_util.dart (0 hunks)
🧠 Learnings (13)
📓 Common learnings
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
lib/views/wallet/coins_manager/coins_manager_list_header.dart (4)

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for app_config.dart in coins_bloc.dart is necessary because the part file coins_state.dart uses excludedAssetList from that package.

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The excludedAssetList from app_config.dart is used in the _filterExcludedAssets method in coins_state.dart. Since coins_state.dart is a part file of coins_bloc.dart, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.

Learnt from: takenagain
PR: #2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.

Learnt from: takenagain
PR: #2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.

lib/bloc/app_bloc_root.dart (2)

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for app_config.dart in coins_bloc.dart is necessary because the part file coins_state.dart uses excludedAssetList from that package.

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The excludedAssetList from app_config.dart is used in the _filterExcludedAssets method in coins_state.dart. Since coins_state.dart is a part file of coins_bloc.dart, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.

lib/bloc/coins_bloc/coins_bloc.dart (2)

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for app_config.dart in coins_bloc.dart is necessary because the part file coins_state.dart uses excludedAssetList from that package.

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The excludedAssetList from app_config.dart is used in the _filterExcludedAssets method in coins_state.dart. Since coins_state.dart is a part file of coins_bloc.dart, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.

lib/views/wallet/coins_manager/coins_manager_page.dart (2)

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for app_config.dart in coins_bloc.dart is necessary because the part file coins_state.dart uses excludedAssetList from that package.

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The excludedAssetList from app_config.dart is used in the _filterExcludedAssets method in coins_state.dart. Since coins_state.dart is a part file of coins_bloc.dart, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.

lib/bloc/coins_manager/coins_manager_sort.dart (2)

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for app_config.dart in coins_bloc.dart is necessary because the part file coins_state.dart uses excludedAssetList from that package.

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The excludedAssetList from app_config.dart is used in the _filterExcludedAssets method in coins_state.dart. Since coins_state.dart is a part file of coins_bloc.dart, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.

lib/bloc/coins_manager/coins_manager_event.dart (2)

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The excludedAssetList from app_config.dart is used in the _filterExcludedAssets method in coins_state.dart. Since coins_state.dart is a part file of coins_bloc.dart, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for app_config.dart in coins_bloc.dart is necessary because the part file coins_state.dart uses excludedAssetList from that package.

lib/bloc/coins_bloc/coins_repo.dart (2)

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The excludedAssetList from app_config.dart is used in the _filterExcludedAssets method in coins_state.dart. Since coins_state.dart is a part file of coins_bloc.dart, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for app_config.dart in coins_bloc.dart is necessary because the part file coins_state.dart uses excludedAssetList from that package.

lib/views/wallet/coin_details/coin_details_info/coin_details_common_buttons.dart (6)

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for app_config.dart in coins_bloc.dart is necessary because the part file coins_state.dart uses excludedAssetList from that package.

Learnt from: takenagain
PR: #2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional dart:io imports in the Komodo wallet codebase when the usage is guarded by !kIsWeb conditional checks that prevent the platform-specific code from being executed in web environments.

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The excludedAssetList from app_config.dart is used in the _filterExcludedAssets method in coins_state.dart. Since coins_state.dart is a part file of coins_bloc.dart, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.

Learnt from: takenagain
PR: #2611
File: test_units/tests/system_health/http_head_time_provider_test.dart:8-24
Timestamp: 2025-05-08T19:05:13.083Z
Learning: In the Komodo Wallet project, test functions are defined in individual files under test_units/tests/ but are executed through the central entry point in test_units/main.dart, so individual test files don't need their own main() function.

Learnt from: takenagain
PR: #2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.

Learnt from: takenagain
PR: #2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.

lib/bloc/coins_manager/coins_manager_state.dart (2)

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The excludedAssetList from app_config.dart is used in the _filterExcludedAssets method in coins_state.dart. Since coins_state.dart is a part file of coins_bloc.dart, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for app_config.dart in coins_bloc.dart is necessary because the part file coins_state.dart uses excludedAssetList from that package.

lib/model/coin.dart (6)

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The excludedAssetList from app_config.dart is used in the _filterExcludedAssets method in coins_state.dart. Since coins_state.dart is a part file of coins_bloc.dart, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for app_config.dart in coins_bloc.dart is necessary because the part file coins_state.dart uses excludedAssetList from that package.

Learnt from: takenagain
PR: #2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional dart:io imports in the Komodo wallet codebase when the usage is guarded by !kIsWeb conditional checks that prevent the platform-specific code from being executed in web environments.

Learnt from: takenagain
PR: #2611
File: test_units/tests/system_health/http_head_time_provider_test.dart:8-24
Timestamp: 2025-05-08T19:05:13.083Z
Learning: In the Komodo Wallet project, test functions are defined in individual files under test_units/tests/ but are executed through the central entry point in test_units/main.dart, so individual test files don't need their own main() function.

Learnt from: takenagain
PR: #2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.

Learnt from: takenagain
PR: #2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.

lib/views/wallet/coins_manager/coins_manager_list_wrapper.dart (6)

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The excludedAssetList from app_config.dart is used in the _filterExcludedAssets method in coins_state.dart. Since coins_state.dart is a part file of coins_bloc.dart, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for app_config.dart in coins_bloc.dart is necessary because the part file coins_state.dart uses excludedAssetList from that package.

Learnt from: takenagain
PR: #2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.

Learnt from: takenagain
PR: #2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.

Learnt from: takenagain
PR: #2611
File: test_units/tests/system_health/http_head_time_provider_test.dart:8-24
Timestamp: 2025-05-08T19:05:13.083Z
Learning: In the Komodo Wallet project, test functions are defined in individual files under test_units/tests/ but are executed through the central entry point in test_units/main.dart, so individual test files don't need their own main() function.

Learnt from: takenagain
PR: #2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional dart:io imports in the Komodo wallet codebase when the usage is guarded by !kIsWeb conditional checks that prevent the platform-specific code from being executed in web environments.

lib/bloc/coins_manager/coins_manager_bloc.dart (6)

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for app_config.dart in coins_bloc.dart is necessary because the part file coins_state.dart uses excludedAssetList from that package.

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The excludedAssetList from app_config.dart is used in the _filterExcludedAssets method in coins_state.dart. Since coins_state.dart is a part file of coins_bloc.dart, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.

Learnt from: takenagain
PR: #2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional dart:io imports in the Komodo wallet codebase when the usage is guarded by !kIsWeb conditional checks that prevent the platform-specific code from being executed in web environments.

Learnt from: takenagain
PR: #2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.

Learnt from: takenagain
PR: #2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.

Learnt from: takenagain
PR: #2611
File: test_units/tests/system_health/http_head_time_provider_test.dart:8-24
Timestamp: 2025-05-08T19:05:13.083Z
Learning: In the Komodo Wallet project, test functions are defined in individual files under test_units/tests/ but are executed through the central entry point in test_units/main.dart, so individual test files don't need their own main() function.

🪛 GitHub Actions: takenagain is validating code guidelines 🚀
lib/views/wallet/coins_manager/coins_manager_list_header.dart

[info] 8-8: Parameter 'key' could be a super parameter.

lib/views/wallet/coins_manager/coins_manager_page.dart

[warning] 6-7: Unused imports: 'package:web_dex/bloc/coins_bloc/coins_bloc.dart' and 'package:web_dex/bloc/coins_manager/coins_manager_bloc.dart'.


[info] 15-15: Parameter 'key' could be a super parameter.

lib/views/wallet/coin_details/coin_details_info/coin_details_common_buttons.dart

[info] 297-329: 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss.

lib/model/coin.dart

[warning] 11-11: This class (or a class that this class inherits from) is marked as '@immutable', but one or more of its instance fields aren't final: Coin.usdPrice, Coin.isCustomCoin, Coin.address, Coin.fallbackSwapContract, Coin.parentCoin, Coin.state, Coin.sendableBalance.

💤 Files with no reviewable changes (3)
  • test_units/tests/utils/test_util.dart
  • lib/views/wallet/coin_details/withdraw_form/widgets/fill_form/fields/fill_form_trezor_sender_address.dart
  • lib/views/wallet/coin_details/coin_details_info/address_select.dart
🧰 Additional context used
🧠 Learnings (13)
📓 Common learnings
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
lib/views/wallet/coins_manager/coins_manager_list_header.dart (4)

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for app_config.dart in coins_bloc.dart is necessary because the part file coins_state.dart uses excludedAssetList from that package.

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The excludedAssetList from app_config.dart is used in the _filterExcludedAssets method in coins_state.dart. Since coins_state.dart is a part file of coins_bloc.dart, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.

Learnt from: takenagain
PR: #2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.

Learnt from: takenagain
PR: #2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.

lib/bloc/app_bloc_root.dart (2)

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for app_config.dart in coins_bloc.dart is necessary because the part file coins_state.dart uses excludedAssetList from that package.

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The excludedAssetList from app_config.dart is used in the _filterExcludedAssets method in coins_state.dart. Since coins_state.dart is a part file of coins_bloc.dart, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.

lib/bloc/coins_bloc/coins_bloc.dart (2)

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for app_config.dart in coins_bloc.dart is necessary because the part file coins_state.dart uses excludedAssetList from that package.

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The excludedAssetList from app_config.dart is used in the _filterExcludedAssets method in coins_state.dart. Since coins_state.dart is a part file of coins_bloc.dart, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.

lib/views/wallet/coins_manager/coins_manager_page.dart (2)

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for app_config.dart in coins_bloc.dart is necessary because the part file coins_state.dart uses excludedAssetList from that package.

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The excludedAssetList from app_config.dart is used in the _filterExcludedAssets method in coins_state.dart. Since coins_state.dart is a part file of coins_bloc.dart, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.

lib/bloc/coins_manager/coins_manager_sort.dart (2)

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for app_config.dart in coins_bloc.dart is necessary because the part file coins_state.dart uses excludedAssetList from that package.

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The excludedAssetList from app_config.dart is used in the _filterExcludedAssets method in coins_state.dart. Since coins_state.dart is a part file of coins_bloc.dart, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.

lib/bloc/coins_manager/coins_manager_event.dart (2)

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The excludedAssetList from app_config.dart is used in the _filterExcludedAssets method in coins_state.dart. Since coins_state.dart is a part file of coins_bloc.dart, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for app_config.dart in coins_bloc.dart is necessary because the part file coins_state.dart uses excludedAssetList from that package.

lib/bloc/coins_bloc/coins_repo.dart (2)

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The excludedAssetList from app_config.dart is used in the _filterExcludedAssets method in coins_state.dart. Since coins_state.dart is a part file of coins_bloc.dart, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for app_config.dart in coins_bloc.dart is necessary because the part file coins_state.dart uses excludedAssetList from that package.

lib/views/wallet/coin_details/coin_details_info/coin_details_common_buttons.dart (6)

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for app_config.dart in coins_bloc.dart is necessary because the part file coins_state.dart uses excludedAssetList from that package.

Learnt from: takenagain
PR: #2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional dart:io imports in the Komodo wallet codebase when the usage is guarded by !kIsWeb conditional checks that prevent the platform-specific code from being executed in web environments.

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The excludedAssetList from app_config.dart is used in the _filterExcludedAssets method in coins_state.dart. Since coins_state.dart is a part file of coins_bloc.dart, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.

Learnt from: takenagain
PR: #2611
File: test_units/tests/system_health/http_head_time_provider_test.dart:8-24
Timestamp: 2025-05-08T19:05:13.083Z
Learning: In the Komodo Wallet project, test functions are defined in individual files under test_units/tests/ but are executed through the central entry point in test_units/main.dart, so individual test files don't need their own main() function.

Learnt from: takenagain
PR: #2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.

Learnt from: takenagain
PR: #2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.

lib/bloc/coins_manager/coins_manager_state.dart (2)

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The excludedAssetList from app_config.dart is used in the _filterExcludedAssets method in coins_state.dart. Since coins_state.dart is a part file of coins_bloc.dart, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for app_config.dart in coins_bloc.dart is necessary because the part file coins_state.dart uses excludedAssetList from that package.

lib/model/coin.dart (6)

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The excludedAssetList from app_config.dart is used in the _filterExcludedAssets method in coins_state.dart. Since coins_state.dart is a part file of coins_bloc.dart, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for app_config.dart in coins_bloc.dart is necessary because the part file coins_state.dart uses excludedAssetList from that package.

Learnt from: takenagain
PR: #2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional dart:io imports in the Komodo wallet codebase when the usage is guarded by !kIsWeb conditional checks that prevent the platform-specific code from being executed in web environments.

Learnt from: takenagain
PR: #2611
File: test_units/tests/system_health/http_head_time_provider_test.dart:8-24
Timestamp: 2025-05-08T19:05:13.083Z
Learning: In the Komodo Wallet project, test functions are defined in individual files under test_units/tests/ but are executed through the central entry point in test_units/main.dart, so individual test files don't need their own main() function.

Learnt from: takenagain
PR: #2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.

Learnt from: takenagain
PR: #2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.

lib/views/wallet/coins_manager/coins_manager_list_wrapper.dart (6)

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The excludedAssetList from app_config.dart is used in the _filterExcludedAssets method in coins_state.dart. Since coins_state.dart is a part file of coins_bloc.dart, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for app_config.dart in coins_bloc.dart is necessary because the part file coins_state.dart uses excludedAssetList from that package.

Learnt from: takenagain
PR: #2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.

Learnt from: takenagain
PR: #2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.

Learnt from: takenagain
PR: #2611
File: test_units/tests/system_health/http_head_time_provider_test.dart:8-24
Timestamp: 2025-05-08T19:05:13.083Z
Learning: In the Komodo Wallet project, test functions are defined in individual files under test_units/tests/ but are executed through the central entry point in test_units/main.dart, so individual test files don't need their own main() function.

Learnt from: takenagain
PR: #2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional dart:io imports in the Komodo wallet codebase when the usage is guarded by !kIsWeb conditional checks that prevent the platform-specific code from being executed in web environments.

lib/bloc/coins_manager/coins_manager_bloc.dart (6)

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for app_config.dart in coins_bloc.dart is necessary because the part file coins_state.dart uses excludedAssetList from that package.

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The excludedAssetList from app_config.dart is used in the _filterExcludedAssets method in coins_state.dart. Since coins_state.dart is a part file of coins_bloc.dart, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.

Learnt from: takenagain
PR: #2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional dart:io imports in the Komodo wallet codebase when the usage is guarded by !kIsWeb conditional checks that prevent the platform-specific code from being executed in web environments.

Learnt from: takenagain
PR: #2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.

Learnt from: takenagain
PR: #2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.

Learnt from: takenagain
PR: #2611
File: test_units/tests/system_health/http_head_time_provider_test.dart:8-24
Timestamp: 2025-05-08T19:05:13.083Z
Learning: In the Komodo Wallet project, test functions are defined in individual files under test_units/tests/ but are executed through the central entry point in test_units/main.dart, so individual test files don't need their own main() function.

🪛 GitHub Actions: takenagain is validating code guidelines 🚀
lib/views/wallet/coins_manager/coins_manager_list_header.dart

[info] 8-8: Parameter 'key' could be a super parameter.

lib/views/wallet/coins_manager/coins_manager_page.dart

[warning] 6-7: Unused imports: 'package:web_dex/bloc/coins_bloc/coins_bloc.dart' and 'package:web_dex/bloc/coins_manager/coins_manager_bloc.dart'.


[info] 15-15: Parameter 'key' could be a super parameter.

lib/views/wallet/coin_details/coin_details_info/coin_details_common_buttons.dart

[info] 297-329: 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss.

lib/model/coin.dart

[warning] 11-11: This class (or a class that this class inherits from) is marked as '@immutable', but one or more of its instance fields aren't final: Coin.usdPrice, Coin.isCustomCoin, Coin.address, Coin.fallbackSwapContract, Coin.parentCoin, Coin.state, Coin.sendableBalance.

🔇 Additional comments (30)
lib/views/wallet/coins_manager/coins_manager_list_header.dart (1)

4-5: LGTM! Import reorganization aligns with refactoring.

The import changes correctly reflect the move of sorting functionality to the bloc layer and removal of the list wrapper dependency.

lib/bloc/app_bloc_root.dart (1)

288-296: LGTM! Dependency injection enhances CoinsManagerBloc functionality.

The addition of SettingsRepository and TradingEntitiesBloc dependencies enables the enhanced coins manager features including sorting, coin removal workflows, and preventing removal of coins with active swaps or orders.

lib/views/wallet/coin_details/coin_details_info/coin_details_common_buttons.dart (4)

5-5: LGTM! SDK integration improves balance accuracy.

The addition of KomodoDefiSdk import enables more accurate balance retrieval directly from the SDK.


357-375: LGTM! Improved send button logic with SDK balance.

The send button now uses the SDK's last known balance and consistent isActive status check, which provides more accurate state management.


420-420: LGTM! Consistent coin status check.

The swap button now uses !coin.isActive which aligns with the unified coin status checking approach throughout the codebase.


427-429: LGTM! Consistent status check in Bitrefill tooltip.

The tooltip logic now uses !coin.isActive for consistency with other button status checks.

lib/model/coin.dart (4)

1-1: LGTM! Equatable import supports proper equality comparison.

The Equatable import enables value-based equality comparison for the Coin class.


11-11: LGTM! Coin class extends Equatable for proper equality.

Extending Equatable enables proper value comparison based on the id field, which is more reliable than default reference equality.


209-212: LGTM! Equality based on AssetId is appropriate.

Using only the id (AssetId) for equality comparison is the correct approach, as it uniquely identifies a coin regardless of other mutable properties.


11-213: Consider addressing mutable fields in Equatable class.

The pipeline warns that this Equatable class has mutable fields (usdPrice, isCustomCoin, address, etc.). While this appears to be existing technical debt, consider whether these fields should be immutable or if the class design needs refactoring for better consistency.

This is likely existing technical debt rather than a new issue introduced by this PR, but it's worth noting for future cleanup.

lib/views/wallet/coins_manager/coins_manager_page.dart (1)

43-55: LGTM! UI simplification improves separation of concerns.

The refactoring from BlocConsumer<CoinsBloc, CoinsState> to BlocBuilder<AuthBloc, AuthBlocState> simplifies the UI by removing direct coin state management, which has been properly moved to the bloc layer.

lib/bloc/coins_manager/coins_manager_sort.dart (1)

1-23: LGTM! Clean sorting abstraction implementation.

The sorting types and data structure are well-defined and follow good Dart practices. The enum values are appropriate for coin management (protocol, balance, name, none) and the implementation correctly follows the generic SortData interface pattern.

lib/bloc/coins_bloc/coins_bloc.dart (2)

116-142: Approve the simplified balance refresh logic.

The refactored _onCoinsRefreshed method improves the code by:

  • Removing unnecessary wallet type branching
  • Using emit.forEach for cleaner stream handling
  • Maintaining proper error handling for coin synchronization

The logic is now more streamlined while preserving functionality.


424-424: Approve the notification suppression during activation.

Adding notify: false to the activateCoinsSync call is appropriate for preventing duplicate state broadcasts during coin activation, which aligns with the broader notification control improvements in the coins repository.

lib/bloc/coins_bloc/coins_repo.dart (5)

190-190: Approve the more explicit asset selection.

Changing from assets.first to assets.single is more appropriate here as it clearly expresses the expectation of exactly one asset and will throw if multiple assets are found, making debugging easier.


270-273: Approve the notification control parameter.

Adding the optional notify parameter with a default value of true maintains backward compatibility while enabling fine-grained control over state broadcasts during activation.


289-309: Approve the conditional notification broadcasts.

The conditional _broadcastAsset calls based on the notify parameter provide proper control over state notifications during activation, preventing duplicate broadcasts when needed.


329-332: Approve the consistent method signature update.

The activateCoinsSync method signature update maintains consistency with activateAssetsSync by adding the same notification control parameter.


361-385: Approve the notification control implementation.

The conditional notification logic is consistently applied throughout the coin activation flow, providing proper control over state broadcasts while maintaining existing functionality.

lib/bloc/coins_manager/coins_manager_event.dart (2)

23-25: Approve the proper deprecation with clear reasoning.

The deprecation annotation includes a helpful message explaining why the event is no longer needed, which will guide developers during refactoring.


46-63: Approve the new event classes for enhanced functionality.

The new events properly support the expanded coin management features:

  • CoinsManagerSortChanged integrates with the new sorting system
  • The removal workflow events (CoinsManagerCoinRemoveRequested, CoinsManagerCoinRemoveConfirmed, CoinsManagerCoinRemovalCancelled) provide a clear state machine for coin removal with user confirmation

All events follow consistent naming patterns and include appropriate data payloads.

lib/bloc/coins_manager/coins_manager_state.dart (4)

10-21: Approve the state extensions for new functionality.

The addition of sortData and removalState fields properly extends the state to support sorting and coin removal confirmation workflows. Making removalState optional is appropriate since it's only needed during removal operations.


33-38: Approve the sensible default sorting configuration.

Setting the initial sort direction and type to none is appropriate, allowing users to explicitly choose their preferred sorting without imposing a default order.


48-61: Approve the proper state mutation handling.

The copyWith method correctly handles the new fields, with removalState properly supporting null assignment for clearing the removal state.


82-107: Approve the comprehensive removal state management.

The CoinRemovalBlockReason enum and CoinRemovalState class provide a well-structured approach to handling coin removal blocking scenarios:

  • Clear enum values for different blocking reasons
  • Comprehensive state tracking including child coins and order counts
  • Convenient getter methods for checking blocking conditions
  • Proper equality implementation

This design enables robust removal confirmation workflows with clear user feedback.

lib/views/wallet/coins_manager/coins_manager_list_wrapper.dart (2)

36-76: Clean refactoring to BlocConsumer!

The simplification from nested BlocListener/BlocBuilder to a single BlocConsumer improves readability. The widget now properly delegates all state management to the bloc.


138-151: Clean separation of concerns!

The method correctly delegates coin selection logic to the bloc based on the action mode, allowing the bloc to handle all trading checks and state management.

lib/bloc/coins_manager/coins_manager_bloc.dart (3)

177-248: Well-implemented asynchronous coin activation!

The implementation properly addresses the PR's concern about preventing activation spamming by:

  1. Immediately updating the UI state (line 204)
  2. Processing activation/deactivation asynchronously in the background
  3. Including error handling with logging

The analytics tracking for enable/disable events is also a nice addition.


361-462: Excellent implementation of safe coin removal workflow!

The implementation properly addresses the PR's TODO about testing behavior with failing coins by:

  1. Checking for active swaps (including child coins)
  2. Checking for open orders (including child coins)
  3. Canceling orders when confirmed
  4. Handling both add mode (deselection) and remove mode

The separation of concerns between checking conditions and handling confirmation is well-designed.


220-221: Clarify notification suppression usage in CoinManagerBloc

The activateCoinsSync and deactivateCoinsSync APIs use a named notify flag (defaulting to true)—there is no suppressNotifications parameter. In your CoinManagerBloc you’re calling them without overriding notify, so notifications will still be emitted. If the intent is to suppress notifications in these flows, you’ll need to pass notify: false.

Locations to review:

  • lib/bloc/coins_manager/coins_manager_bloc.dart
    • Line ~220: await _coinsRepo.deactivateCoinsSync([event.coin]);
    • Line ~236: await _coinsRepo.activateCoinsSync([event.coin]);

Suggested diff:

- await _coinsRepo.deactivateCoinsSync([event.coin]);
+ await _coinsRepo.deactivateCoinsSync([event.coin], notify: false);- await _coinsRepo.activateCoinsSync([event.coin]);
+ await _coinsRepo.activateCoinsSync([event.coin], notify: false);

Please verify whether these calls should indeed suppress notifications.

@takenagain
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jul 23, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (1)
lib/bloc/coins_manager/coins_manager_bloc.dart (1)

327-340: Correct use of unique identifier for coin merging

Using coin.id.id instead of coin.abbr properly handles coins with the same ticker on different chains.

🧹 Nitpick comments (1)
lib/bloc/auth_bloc/auth_bloc.dart (1)

331-335: Track this temporary workaround as technical debt

While this workaround prevents race conditions during login, marking it as "temporary" without a concrete plan for resolution could lead to technical debt accumulation. Consider:

  • Creating a GitHub issue to track the proper solution
  • Adding more context about what the "more robust solution" should look like
  • Setting a target timeline for addressing this

Would you like me to help create a GitHub issue to track this technical debt with a detailed description of the problem and potential solutions?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1b77daf and 7d53a49.

📒 Files selected for processing (8)
  • lib/bloc/auth_bloc/auth_bloc.dart (1 hunks)
  • lib/bloc/auth_bloc/trezor_auth_mixin.dart (1 hunks)
  • lib/bloc/coins_bloc/coins_bloc.dart (5 hunks)
  • lib/bloc/coins_bloc/coins_repo.dart (7 hunks)
  • lib/bloc/coins_manager/coins_manager_bloc.dart (5 hunks)
  • lib/bloc/coins_manager/coins_manager_event.dart (2 hunks)
  • lib/bloc/coins_manager/coins_manager_state.dart (4 hunks)
  • lib/views/wallet/coins_manager/coins_manager_list_wrapper.dart (5 hunks)
🧠 Learnings (3)
📓 Common learnings
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2976
File: lib/bloc/coins_manager/coins_manager_bloc.dart:82-83
Timestamp: 2025-07-23T09:31:17.701Z
Learning: In the CoinsManagerBloc, `state.selectedCoins` is used separately from `state.coins` to indicate whether a coin is enabled or not in the UI. The order of Set deduplication when merging coin lists doesn't affect UI behavior because selection state is tracked independently from the coin list used for filtering and sorting.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
lib/bloc/auth_bloc/auth_bloc.dart (1)

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for app_config.dart in coins_bloc.dart is necessary because the part file coins_state.dart uses excludedAssetList from that package.

lib/bloc/coins_manager/coins_manager_bloc.dart (7)

Learnt from: takenagain
PR: #2976
File: lib/bloc/coins_manager/coins_manager_bloc.dart:82-83
Timestamp: 2025-07-23T09:31:17.701Z
Learning: In the CoinsManagerBloc, state.selectedCoins is used separately from state.coins to indicate whether a coin is enabled or not in the UI. The order of Set deduplication when merging coin lists doesn't affect UI behavior because selection state is tracked independently from the coin list used for filtering and sorting.

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for app_config.dart in coins_bloc.dart is necessary because the part file coins_state.dart uses excludedAssetList from that package.

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The excludedAssetList from app_config.dart is used in the _filterExcludedAssets method in coins_state.dart. Since coins_state.dart is a part file of coins_bloc.dart, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.

Learnt from: takenagain
PR: #2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional dart:io imports in the Komodo wallet codebase when the usage is guarded by !kIsWeb conditional checks that prevent the platform-specific code from being executed in web environments.

Learnt from: takenagain
PR: #2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.

Learnt from: takenagain
PR: #2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.

Learnt from: takenagain
PR: #2611
File: test_units/tests/system_health/http_head_time_provider_test.dart:8-24
Timestamp: 2025-05-08T19:05:13.083Z
Learning: In the Komodo Wallet project, test functions are defined in individual files under test_units/tests/ but are executed through the central entry point in test_units/main.dart, so individual test files don't need their own main() function.

🚧 Files skipped from review as they are similar to previous changes (5)
  • lib/bloc/coins_bloc/coins_bloc.dart
  • lib/bloc/coins_bloc/coins_repo.dart
  • lib/bloc/coins_manager/coins_manager_state.dart
  • lib/views/wallet/coins_manager/coins_manager_list_wrapper.dart
  • lib/bloc/coins_manager/coins_manager_event.dart
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2976
File: lib/bloc/coins_manager/coins_manager_bloc.dart:82-83
Timestamp: 2025-07-23T09:31:17.701Z
Learning: In the CoinsManagerBloc, `state.selectedCoins` is used separately from `state.coins` to indicate whether a coin is enabled or not in the UI. The order of Set deduplication when merging coin lists doesn't affect UI behavior because selection state is tracked independently from the coin list used for filtering and sorting.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
lib/bloc/auth_bloc/auth_bloc.dart (1)

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for app_config.dart in coins_bloc.dart is necessary because the part file coins_state.dart uses excludedAssetList from that package.

lib/bloc/coins_manager/coins_manager_bloc.dart (7)

Learnt from: takenagain
PR: #2976
File: lib/bloc/coins_manager/coins_manager_bloc.dart:82-83
Timestamp: 2025-07-23T09:31:17.701Z
Learning: In the CoinsManagerBloc, state.selectedCoins is used separately from state.coins to indicate whether a coin is enabled or not in the UI. The order of Set deduplication when merging coin lists doesn't affect UI behavior because selection state is tracked independently from the coin list used for filtering and sorting.

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for app_config.dart in coins_bloc.dart is necessary because the part file coins_state.dart uses excludedAssetList from that package.

Learnt from: takenagain
PR: #2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The excludedAssetList from app_config.dart is used in the _filterExcludedAssets method in coins_state.dart. Since coins_state.dart is a part file of coins_bloc.dart, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.

Learnt from: takenagain
PR: #2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional dart:io imports in the Komodo wallet codebase when the usage is guarded by !kIsWeb conditional checks that prevent the platform-specific code from being executed in web environments.

Learnt from: takenagain
PR: #2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.

Learnt from: takenagain
PR: #2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.

Learnt from: takenagain
PR: #2611
File: test_units/tests/system_health/http_head_time_provider_test.dart:8-24
Timestamp: 2025-05-08T19:05:13.083Z
Learning: In the Komodo Wallet project, test functions are defined in individual files under test_units/tests/ but are executed through the central entry point in test_units/main.dart, so individual test files don't need their own main() function.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: Build Mobile (Android)
  • GitHub Check: Test web-app-linux-profile
  • GitHub Check: Build Mobile (iOS)
  • GitHub Check: Test web-app-macos
  • GitHub Check: validate_code_guidelines
  • GitHub Check: Build Desktop (linux)
  • GitHub Check: Build Desktop (macos)
  • GitHub Check: Build Desktop (windows)
  • GitHub Check: build_and_preview
  • GitHub Check: unit_tests
🔇 Additional comments (8)
lib/bloc/auth_bloc/trezor_auth_mixin.dart (1)

25-26: Good addition of loading state emission

This provides immediate user feedback when Trezor authentication starts, improving the user experience.

lib/bloc/coins_manager/coins_manager_bloc.dart (7)

24-61: Well-structured dependency injection and event handling setup

The addition of SettingsRepository and TradingEntitiesBloc dependencies is clean and follows proper dependency injection patterns. The comment about the sequential transformer provides valuable context for future maintainers.


74-105: Good implementation of wallet coins merging and filtering

The logic for merging wallet coins in add mode is well-documented and addresses the UI state management needs. The test coins filtering based on user settings is a nice touch.


178-249: Good refactoring of coin selection logic

The extraction of activation/deactivation logic into separate methods improves code organization. The immediate state emission for UI responsiveness is a good UX improvement.

Note that errors during activation/deactivation are caught and logged but don't update the UI state. This is acceptable since the selection state has already been updated, but consider if users should be notified of activation failures.


276-283: Clean sorting implementation

The sorting logic is well-structured with clear separation between sort types. The delegation to specific sort functions maintains good modularity.

Also applies to: 342-360


362-494: Excellent implementation of coin removal flow with trading checks

The removal flow is comprehensive and handles all edge cases well:

  • Checks for active swaps on both parent and child coins
  • Verifies open orders before allowing removal
  • Includes order cancellation with proper error handling
  • Re-verifies order cancellation to ensure success
  • Provides clear error messages to users

The separation between add mode (deselection) and remove mode is well-handled.


285-325: Well-implemented filtering and merging logic

The filtering methods handle their responsibilities cleanly:

  • Test coins filtering respects user preferences
  • Phrase filtering includes alphabetical sorting for better UX
  • Wallet coins merging correctly prevents duplicates using coin IDs

496-526: Clean implementation of state management helpers

The cancellation and error clearing handlers are straightforward and correct. The _getOriginalCoinList helper properly filters excluded assets for the add action.

@takenagain
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jul 24, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@takenagain takenagain linked an issue Jul 24, 2025 that may be closed by this pull request
if user signed out, then signed back in again without refreshing, the activation state would be dropped due to a lack of listeners.

_enabledCoinsSubscription should only be cancelled in the onClose or when spawning another
@takenagain takenagain changed the title feat(add-assets): show wallet (enabled) coins in the "Add Assets" page feat(add-assets): show wallet enabled coins in the "Add Assets" page Jul 25, 2025
@takenagain takenagain marked this pull request as ready for review July 25, 2025 00:37
@takenagain takenagain added the QA Ready for QA Testing label Jul 25, 2025
@takenagain takenagain requested review from CharlVS and smk762 July 25, 2025 00:43
@smk762
Copy link
Copy Markdown
Collaborator

smk762 commented Jul 25, 2025

Though it may be too late for this PR, perhaps we could reduce this to a single page?

For example, on the main wallet page which only shows active coins, we could have another toggle (hide disabled coins) similar to the "hide zero balance" toggle. When in state where disabled are shown, switch out the address expansion arrow for an activation toggle, and block "click to coin wallet" on the disabled.

This would also shift the protocol filter into the main view, which currently lacks such a filter.

One last thing which deviates from legacy desktop, is that there is no bulk selection to activate / deactivate a selected set of coins. I'm in two minds over this, as lazy users could soon find their machines overwhelmed with a "activate 500 coins" command. On the other hand, its inconvenient to manually enable/disable coins individually if you have more than half a dozen to get thru.

A compromise which offers some convenience on the "disable" side, would be to add a "disable zero balance assets" button. This eliminates laborious single disable ops, without risk of performance issues via bulk enable.

I'll push the above in to an issue for next iteration 👍

@smk762
Copy link
Copy Markdown
Collaborator

smk762 commented Jul 25, 2025

When filtering for MATIC/PLG20, I noticed that MATIC itself was halfway down the list. It would be nice if for EVM/Tendermint assets, that the parent is pinned to the top (ie. frozen row), with tokens in selected order beneath.

To further reduce the potentially long lists, even when filtered, I'd propose we also include a "disabled only" / "active only" option to the filter panel.

Copy link
Copy Markdown
Collaborator

@smk762 smk762 left a comment

Choose a reason for hiding this comment

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

Thanks! Functions to intended specification.
A few additional releated comments, suggestions and observations have been delegated to issues for future enhancement.

Copy link
Copy Markdown
Collaborator

@CharlVS CharlVS left a comment

Choose a reason for hiding this comment

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

LGTM. The Coins "bloc" is an ongoing refactoring effort. There is still a decent chunk of tech debt surrounding it which we still revisit.

Image

@CharlVS CharlVS merged commit 137b65c into dev Jul 25, 2025
10 of 14 checks passed
@CharlVS CharlVS deleted the feat/show-wallet-coins-in-add-assets branch July 25, 2025 12:23
smk762 pushed a commit that referenced this pull request Aug 1, 2025
…2976)

* feat(activation): show enabled assets in Add Assets page (#2973)

* feat(wallet): show enabled coins in add asset

* fix(wallet): show enabled assets in add coins

* fix(coins-bloc): ignore repo broadcasts when activating from bloc

* refactor(coins): move sorting to bloc

* fix(coins): filter test coins in bloc

* refactor(coins-manager): add sequential transformer and fix warnings

* refactor(coins-manager): emit state first for responsive UI

* fix(coins-manager): filter and sort selected coins alongside others

* refactor(coin): remove unused legacy `accounts` field

* feat(coins-manager): move deactivation trading check to bloc

* fix(coin-details): disable send & swap buttons if coin is not active

* refactor(coins-manager): improve error handling

* fix(coins-bloc): incorrect active state emitted when syncing states

* fix(coins-repo): move metadata updating before coin activation

* fix(coins-manager): remove children from selected coins list

when disabling parent, children should also be indicated as disabled

* chore(deps): bump SDK to 74d8eff

* fix(coins-bloc): simplify and de-duplicate activation logic and syncing

* fix(activation): broadcast and subscribe to parent if child asset

* fix(activation): change login activation events to restartable

when logging in and out quickly the new events would be dropped in favor of the previous running event, resulting in an empty coins list

* fix(activation): do not cancel state syncing subscription on logout

if user signed out, then signed back in again without refreshing, the activation state would be dropped due to a lack of listeners.

_enabledCoinsSubscription should only be cancelled in the onClose or when spawning another
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

QA Ready for QA Testing UX Cosmetic or flow efficiency enhancements for improved User Experience

Projects

None yet

Development

Successfully merging this pull request may close these issues.

In the add asset modal, show enabled coins too

4 participants