Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThis change introduces an optional Changes
Sequence Diagram(s)sequenceDiagram
participant UI
participant CoinsManagerBloc
participant CoinsRepo
participant WalletMetadata
UI->>CoinsManagerBloc: User requests coin activation
CoinsManagerBloc->>CoinsRepo: activateCoinsSync(coins, addToWalletMetadata)
alt addToWalletMetadata = true
CoinsRepo->>WalletMetadata: Add coins to metadata
end
CoinsRepo-->>CoinsManagerBloc: Activation complete
CoinsManagerBloc-->>UI: Update state/UI
sequenceDiagram
participant NftsRepo
participant CoinsRepo
participant WalletMetadata
NftsRepo->>CoinsRepo: activateCoinsSync(parentCoins, notify: false, addToWalletMetadata: false)
Note right of CoinsRepo: Skips wallet metadata update
CoinsRepo-->>NftsRepo: Activation complete
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Visit the preview URL for this PR (updated for commit 5661859): https://walletrc--pull-3031-merge-6smzf6cw.web.app (expires Thu, 07 Aug 2025 20:04:36 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: f66a4ff03faa546f12f0ae5a841bd9eff2714dcc |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
legacy usdPrice and address fields were added to the Coin model props, which could result in duplication when those fields are updated while the user is filtering
4698217 to
e55f366
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR fixes issues with coin activation and deactivation states in the wallet's "Add Assets" page and prevents deactivated NFT coins from reappearing. The changes focus on improving state synchronization, preventing coin duplication, and ensuring proper silent activation of NFT parent coins.
Key changes:
- Added silent activation mechanism for NFT parent coins to avoid unwanted notifications
- Implemented unique filtering to prevent coin duplication in the assets list
- Improved state management for coin activation/deactivation flows
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| lib/model/coin.dart | Adds unique filtering extension to prevent coin duplication |
| lib/bloc/nfts/nft_main_repo.dart | Enables silent activation of NFT parent coins without notifications |
| lib/bloc/coins_manager/coins_manager_bloc.dart | Improves coin list management and state updates for responsive UI |
| lib/bloc/coins_bloc/coins_repo.dart | Adds parameters for controlling wallet metadata updates and notifications during activation |
Comments suppressed due to low confidence (1)
lib/model/coin.dart:285
- The parameter name 'inplace' should be 'inPlace' to follow Dart naming conventions for camelCase.
List<E> unique(Id Function(E element) id, [bool inplace = true]) {
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
lib/views/settings/widgets/security_settings/security_settings_page.dart
Outdated
Show resolved
Hide resolved
…ctivate coins needed for NFT (#3031) * fix(nft): do not add auto-activated parents to the wallet coins list * fix(coins-repo): notify listeners for disabling in add assets page * fix(add-assets): sync state, remove child coins, and formatting * fix(add-assets): deduplicate coins list legacy usdPrice and address fields were added to the Coin model props, which could result in duplication when those fields are updated while the user is filtering * fix(coins-manager): create copy of selectedCoins Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix(private-keys): filter out excluded assets from the private keys * refactor(private-keys): clone list from SDK before mutating --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ctivate coins needed for NFT (#3031) * fix(nft): do not add auto-activated parents to the wallet coins list * fix(coins-repo): notify listeners for disabling in add assets page * fix(add-assets): sync state, remove child coins, and formatting * fix(add-assets): deduplicate coins list legacy usdPrice and address fields were added to the Coin model props, which could result in duplication when those fields are updated while the user is filtering * fix(coins-manager): create copy of selectedCoins Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix(private-keys): filter out excluded assets from the private keys * refactor(private-keys): clone list from SDK before mutating --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ctivate coins needed for NFT (#3031) * fix(nft): do not add auto-activated parents to the wallet coins list * fix(coins-repo): notify listeners for disabling in add assets page * fix(add-assets): sync state, remove child coins, and formatting * fix(add-assets): deduplicate coins list legacy usdPrice and address fields were added to the Coin model props, which could result in duplication when those fields are updated while the user is filtering * fix(coins-manager): create copy of selectedCoins Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix(private-keys): filter out excluded assets from the private keys * refactor(private-keys): clone list from SDK before mutating --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ctivate coins needed for NFT (#3031) * fix(nft): do not add auto-activated parents to the wallet coins list * fix(coins-repo): notify listeners for disabling in add assets page * fix(add-assets): sync state, remove child coins, and formatting * fix(add-assets): deduplicate coins list legacy usdPrice and address fields were added to the Coin model props, which could result in duplication when those fields are updated while the user is filtering * fix(coins-manager): create copy of selectedCoins Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix(private-keys): filter out excluded assets from the private keys * refactor(private-keys): clone list from SDK before mutating --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ctivate coins needed for NFT (#3031) * fix(nft): do not add auto-activated parents to the wallet coins list * fix(coins-repo): notify listeners for disabling in add assets page * fix(add-assets): sync state, remove child coins, and formatting * fix(add-assets): deduplicate coins list legacy usdPrice and address fields were added to the Coin model props, which could result in duplication when those fields are updated while the user is filtering * fix(coins-manager): create copy of selectedCoins Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix(private-keys): filter out excluded assets from the private keys * refactor(private-keys): clone list from SDK before mutating --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ctivate coins needed for NFT (#3031) * fix(nft): do not add auto-activated parents to the wallet coins list * fix(coins-repo): notify listeners for disabling in add assets page * fix(add-assets): sync state, remove child coins, and formatting * fix(add-assets): deduplicate coins list legacy usdPrice and address fields were added to the Coin model props, which could result in duplication when those fields are updated while the user is filtering * fix(coins-manager): create copy of selectedCoins Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix(private-keys): filter out excluded assets from the private keys * refactor(private-keys): clone list from SDK before mutating --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ctivate coins needed for NFT (#3031) * fix(nft): do not add auto-activated parents to the wallet coins list * fix(coins-repo): notify listeners for disabling in add assets page * fix(add-assets): sync state, remove child coins, and formatting * fix(add-assets): deduplicate coins list legacy usdPrice and address fields were added to the Coin model props, which could result in duplication when those fields are updated while the user is filtering * fix(coins-manager): create copy of selectedCoins Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix(private-keys): filter out excluded assets from the private keys * refactor(private-keys): clone list from SDK before mutating --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Fixes the following issues:
Summary by CodeRabbit
Refactor
Style