Skip to content

feat(4173): Send flow with contextual chain selector #13938

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 103 commits into
base: main
Choose a base branch
from

Conversation

EtherWizard33
Copy link
Contributor

@EtherWizard33 EtherWizard33 commented Mar 10, 2025

Description

Send flow to use contextual chain selector, WIP.

Related issues

Contributes to: #13674

Manual testing steps

  1. Enabled feature flag export MM_REMOVE_GLOBAL_NETWORK_SELECTOR="true"
  2. start app with yarn watch:clean
  3. do a send transaction, where on the first screen of the send flow you pick a network different than the globally selected network

Screenshots/Recordings

Before (feature flag OFF) After (feature flag ON)
Screenshot 2024-04-18 at 3 56 43 PM Screenshot 2024-04-18 at 3 56 43 PM

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

EtherWizard33 and others added 19 commits February 19, 2025 19:05
…ature can work when its feature flags are enabled

make sure to include all env vars:
export MM_MULTICHAIN_V1_ENABLED="true"
export MM_CHAIN_PERMISSIONS="true"
export MM_PER_DAPP_SELECTED_NETWORK="1"
export MULTICHAIN_V1="true"
- Replace direct checks of process.env.MM_PER_DAPP_SELECTED_NETWORK in AccountPermissionsConnected.tsx with the isPerDappSelectedNetworkEnabled function.
- Update ethereum-chain-utils.js to use isPerDappSelectedNetworkEnabled when switching networks.
- Modify selectedNetworkController selectors to use isPerDappSelectedNetworkEnabled for feature flag checks.
- Add the isPerDappSelectedNetworkEnabled utility in util/networks/index.js.

This change centralizes the per-DApp network logic for better consistency and maintainability.
Add a touchable favicon to the permission summary header that enables network
switching for dapps. This combines the dapp's identity (favicon/token) with
network selection in a single interactive component.

- Replace static WebsiteIcon with touchable BadgeWrapper pattern
- Add network badge to indicate current network
- Enable network switching via network selector bottom sheet
- Add fallback to AvatarToken when favicon unavailable
- Guard implementation behind per-dapp network selection feature flag
- Preserve original WebsiteIcon when feature disabled

This matches the interaction pattern from AccountPermissionsConnected,
providing a consistent way to manage dapp-specific networks across the app.
…flag

The domain logo container view was incorrectly placed outside the per-dapp network
feature flag check. This change moves the container view inside the feature flag
condition to ensure consistent UI behavior when the feature is enabled/disabled.

- Moved View wrapper inside isPerDappSelectedNetworkEnabled() check
- Simplified conditional rendering logic
- Maintains existing functionality but with proper feature flag control
…permission sumamry is displayed, keep showing the WebsiteIcon rather than the AvatarFavicon.
…1Enabled rather than its 'corresponding' env variable MULTICHAIN_V1
Remove the permission check for non-permitted network flows in dapps, paving the way for the per-dapp-selected-network feature. Temporary screens handling these flows are pending removal upon feature completion.
- Replace global network selectors with origin-specific useNetworkInfo hook
- Update network name and image source to be origin-aware
- Update test snapshot for network name changes
- Add origin prop to AccountFromToInfoCard for per-dapp network info
- Add debug logs for transaction review flow
@EtherWizard33 EtherWizard33 added Run Smoke E2E Requires smoke E2E testing team-wallet-ux labels Mar 10, 2025
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@EtherWizard33 EtherWizard33 changed the base branch from main to feat-4144-per-dapp-selected-network-poc-2 March 10, 2025 13:57
@EtherWizard33 EtherWizard33 added No QA Needed Apply this label when your PR does not need any QA effort. and removed Run Smoke E2E Requires smoke E2E testing labels Mar 10, 2025
@EtherWizard33 EtherWizard33 added No E2E Smoke Needed If the PR does not need E2E smoke test run and removed No QA Needed Apply this label when your PR does not need any QA effort. labels Mar 10, 2025
This commit:
- Adds redux state to track chain ID specifically in send flow context
- Dispatches chain ID updates when switching networks from send flow
- Adds selector and logging to monitor contextual chain ID changes
- Only tracks chain ID when network selector is used from send flow
…r reducer

- Move contextual chain ID from transaction to networkSelector reducer
- Update selectors to read from new location
- Add debug logging for state transitions
- Reset contextual chain ID when canceling transaction
- Initialize contextual chain ID in SendTo component
- Display network name in navbar using contextual chain ID

BREAKING CHANGE: sendFlowContextualChainId moved from transaction to networkSelector reducer
@EtherWizard33 EtherWizard33 added Run Smoke E2E Requires smoke E2E testing No QA Needed Apply this label when your PR does not need any QA effort. and removed Run Smoke E2E Requires smoke E2E testing labels Jun 17, 2025
@EtherWizard33
Copy link
Contributor Author

note: the no e2e and no qa labels are temporary, will add them once the feature works again

…d since, on new installs, assets are not shown unless the user switched the GNS to that chain at least one.

Other than that, add loging, and set the networkClientId to the contextual to the addTransaction call as suggested by Goktug to make the Confirmation screen of the send flow to be contextual.
… flag the changes specific to the contextual send flow.
…ture flag th

e changes specific to the contextual send flow
…the changes specific to the contextual send flow.
…hind feature flag the changes specific to the contextual send flow.
@EtherWizard33 EtherWizard33 force-pushed the feat-4173-send-flow-with-contextual-chain-selector branch from abfa4f4 to c1fe2ec Compare June 20, 2025 17:39
@EtherWizard33 EtherWizard33 added Run Smoke E2E Requires smoke E2E testing and removed No E2E Smoke Needed If the PR does not need E2E smoke test run labels Jun 20, 2025
Copy link
Contributor

github-actions bot commented Jun 20, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 9c4ba00
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/b77cf13c-cef9-4edd-9e57-3843847624d7

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@EtherWizard33 EtherWizard33 added needs-qa Any New Features that needs a full manual QA prior to being added to a release. and removed No QA Needed Apply this label when your PR does not need any QA effort. labels Jun 20, 2025
@EtherWizard33 EtherWizard33 marked this pull request as ready for review June 20, 2025 19:56
@EtherWizard33 EtherWizard33 requested review from a team as code owners June 20, 2025 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-qa Any New Features that needs a full manual QA prior to being added to a release. Run Smoke E2E Requires smoke E2E testing team-wallet-ux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants