Skip to content

feat: adding context to send pages#17453

Merged
jpuri merged 57 commits into
mainfrom
send_context
Jul 30, 2025
Merged

feat: adding context to send pages#17453
jpuri merged 57 commits into
mainfrom
send_context

Conversation

@jpuri

@jpuri jpuri commented Jul 22, 2025

Copy link
Copy Markdown
Contributor

Description

The PR add:

  1. A shared contest for send pages
  2. Creating evm transaction and reviewing on send page

Changelog

CHANGELOG entry:

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/5411
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/5426

Manual testing steps

  1. Enable new send page locally
  2. Submit an native asset send and check new flow

Screenshots/Recordings

Screen.Recording.2025-07-23.at.11.05.17.AM.mov

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.

@github-actions

Copy link
Copy Markdown
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.

@metamaskbot metamaskbot added the team-confirmations Push issues to confirmations team label Jul 22, 2025
cursor[bot]

This comment was marked as outdated.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: Transaction Preparation Fails with Undefined Address

The from?.address as string type assertion can mask a potential undefined value for transactionParams.from if selectSelectedInternalAccount returns undefined, which could lead to runtime errors during transaction preparation or processing. Additionally, a commented-out hardcoded Ethereum address (// to: '0x089595380921f555d52AB6f5a49defdAaB23B444',) was accidentally committed, likely as debugging/test code, and should be removed.

app/components/Views/confirmations/context/send-context/send-context.tsx#L76-L82

const from = useSelector(selectSelectedInternalAccount);
const [transactionParams, setTransactionParams] = useState<TransactionParams>(
{
from: from?.address as string,
// to: '0x089595380921f555d52AB6f5a49defdAaB23B444',
},
);

Fix in CursorFix in Web


Bug: Test Fails: Missing Context Provider

The new tests for Amount and To components render them directly without wrapping them in SendContextProvider. Both components use the useSendContext() hook, which requires this provider, causing the tests to fail at runtime due to the missing context.

app/components/Views/confirmations/components/send/to/to.test.tsx#L7-L11

it('renders correctly', async () => {
const { getByText } = render(<To />);
expect(getByText('To:')).toBeTruthy();
});

app/components/Views/confirmations/components/send/amount/amount.test.tsx#L7-L11

it('renders correctly', async () => {
const { getByText } = render(<Amount />);
expect(getByText('Value:')).toBeTruthy();
});

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

Base automatically changed from send_asset to main July 24, 2025 11:32
@jpuri jpuri requested a review from a team as a code owner July 24, 2025 11:32
@jpuri jpuri enabled auto-merge July 24, 2025 12:33
@github-actions

github-actions Bot commented Jul 24, 2025

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: db47d29
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/3b55ae64-1b1b-463f-be5f-dbc5707a078f

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

@sonarqubecloud

Copy link
Copy Markdown

Comment thread app/components/Views/confirmations/components/send/asset/asset.tsx
Comment thread app/components/Views/confirmations/components/send/send.tsx
Comment thread app/components/Views/confirmations/components/send/to/to.tsx
Comment thread app/components/Views/confirmations/components/send/to/to.tsx
@jpuri jpuri requested a review from matthewwalsh0 July 29, 2025 15:17
@jpuri jpuri mentioned this pull request Jul 30, 2025
7 tasks
@jpuri jpuri added this pull request to the merge queue Jul 30, 2025
Merged via the queue into main with commit 2c3a464 Jul 30, 2025
52 of 54 checks passed
@jpuri jpuri deleted the send_context branch July 30, 2025 14:32
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 30, 2025
@metamaskbot metamaskbot added the release-7.53.0 Issue or pull request that will be included in release 7.53.0 label Jul 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

No QA Needed Apply this label when your PR does not need any QA effort. release-7.53.0 Issue or pull request that will be included in release 7.53.0 team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants