Skip to content
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

feat: disable wallet buttons for accounts that cannot sign transactions #11330

Draft
wants to merge 1 commit into
base: feat/display-snap-accounts-list
Choose a base branch
from

Conversation

k-g-j
Copy link
Contributor

@k-g-j k-g-j commented Sep 19, 2024

Description

This PR disables certain buttons in the WalletActions component when the selected account cannot sign transactions. This change improves the user experience by preventing attempts to perform actions that require transaction signing when the account cannot do so.

  1. The reason for the change is to prevent users from attempting actions that their current account cannot perform.
  2. The improvement is that Buy, Sell, Send, Swap, and Bridge buttons are now disabled when the selected account cannot sign transactions, providing clear visual feedback to the user about available actions.

Related issues

Fixes: https://github.com/MetaMask/accounts-planning/issues/570

Manual testing steps

  1. Go to the SSK and create an account
  2. Update the account using this JSON, replacing the address and ID fields with the new account information (this update step removes eth_signTransaction from the account's methods)
{
    "id": "your new account ID",
    "address": "you new account address",
    "options": {},
    "methods": [
        "personal_sign",
        "eth_sign",
        "eth_signTypedData_v1",
        "eth_signTypedData_v3",
        "eth_signTypedData_v4"
    ],
    "type": "eip155:eoa"
}
  1. Switch to the account that cannot sign transactions if not already there
  2. Verify that the Buy, Sell, Send, Swap, and Bridge buttons are visually disabled with a message
  3. Attempt to tap on these buttons and confirm that no action is taken
  4. Switch back to an account that can sign transactions
  5. Verify that the buttons are now enabled and functional

Screenshots/Recordings

Before

[Insert screenshot of WalletActions before the change, with all buttons enabled]

After

[Insert screenshot of WalletActions after the change, with relevant buttons disabled for an account that can't sign transactions]

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.

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.

@k-g-j k-g-j changed the base branch from main to feat/display-snap-accounts-list September 19, 2024 20:56
@k-g-j k-g-j added area-UI needs-qa Any New Features that needs a full manual QA prior to being added to a release. team-accounts labels Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-UI needs-qa Any New Features that needs a full manual QA prior to being added to a release. team-accounts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant