Skip to content

feat: define account name during creation#25191

Merged
k-g-j merged 265 commits intodevelopfrom
feat/define-account-name-during-creation
Jul 26, 2024
Merged

feat: define account name during creation#25191
k-g-j merged 265 commits intodevelopfrom
feat/define-account-name-during-creation

Conversation

@k-g-j
Copy link
Copy Markdown
Contributor

@k-g-j k-g-j commented Jun 10, 2024

Description

Changes the add snap account flow to include a final modal that allows snaps to suggest a name for the new account or for the user to input a name for their new account. The new snap account is now created with a name either inputted by the user, suggested by the snap, or the default fallback account name.

Open in GitHub Codespaces

Related issues

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

Manual testing steps

Testing with preinstalled snap
  1. Go to settings > experimental > toggle on "Enable Add a new Bitcoin account (Beta)"
  2. Click on the account list and select "+ Add account or hardware wallet" then "Add new Bitcoin account (Beta)"
  3. Go through the flow to add a Bitcoin account without inputting a name, with inputting a name, and canceling adding the account
Testing with account management snap
  1. Go to the SSK and connect the snap
  2. Go through the flow to create an account without inputting a name, with inputting a name, and canceling adding the account

Screenshots/Recordings

Demos

Preinstalled snap flow

Screen.Recording.2024-06-11.at.3.25.57.PM.mov

Account management snap flow

Screen.Recording.2024-06-11.at.3.23.35.PM.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.

k-g-j added 30 commits May 29, 2024 14:54
…snap-confirmations-bypass

# Conflicts:
#	yarn.lock
…t-name-during-creation

# Conflicts:
#	package.json
#	yarn.lock
…t-name-during-creation

# Conflicts:
#	app/scripts/lib/snap-keyring/snap-keyring.ts
#	yarn.lock
…t-name-during-creation

# Conflicts:
#	package.json
#	ui/components/multichain/create-account/create-account.tsx
#	yarn.lock
Copy link
Copy Markdown

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

The pull request introduces a feature allowing users to define account names during the creation process, either suggested by the Snap or inputted by the user.

  • Updated app/scripts/metamask-controller.js: Enhanced account creation flow to support setting and retrieving account names.
  • Modified ui/components/multichain/create-btc-account/create-btc-account.tsx: Integrated account name input and suggestion functionality.
  • Added test/e2e/tests/confirmations/alerts/queued-confirmations.spec.ts: Introduced end-to-end tests for queued confirmations feature.
  • Updated ui/pages/confirmations/components/confirm/info/row/text-token-units.tsx: Added a new component for displaying token values with precision.
  • Modified shared/constants/metametrics.ts: Added new event names and queue types for enhanced tracking of confirmation events.

No file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [a3fcb3a]
Page Load Metrics (71 ± 10 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint78143101188
domContentLoaded117231178
load50118712010
domInteractive117231178
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 573 Bytes (0.02%)
  • ui: -483.32 KiB (-6.42%)
  • common: 1.68 KiB (0.02%)

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [36c7403]
Page Load Metrics (174 ± 188 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint742341163517
domContentLoaded11154343215
load501874174391188
domInteractive11154343215
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 573 Bytes (0.02%)
  • ui: -483.32 KiB (-6.42%)
  • common: 1.68 KiB (0.02%)

jpuri
jpuri previously approved these changes Jul 26, 2024
accountsController.setAccountName.bind(accountsController),

setAccountLabel: (address, label) => {
this.preferencesController.setAccountLabel(address, label);
Copy link
Copy Markdown
Contributor

@ccharly ccharly Jul 26, 2024

Choose a reason for hiding this comment

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

For tracking purposes:

This is ok to remove that line, because AccountsController and PreferencesController keep their state "in sync" (calling setAccountName on one, will call the other, and reversely)

k-g-j added 2 commits July 26, 2024 09:27
…that account is not created in create-snap-account.spec
…t-name-during-creation

# Conflicts:
#	test/e2e/accounts/common.ts
@sonarqubecloud
Copy link
Copy Markdown

@k-g-j k-g-j merged commit 0a5be63 into develop Jul 26, 2024
@k-g-j k-g-j deleted the feat/define-account-name-during-creation branch July 26, 2024 16:36
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Jul 26, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jul 26, 2024
@metamaskbot metamaskbot added the release-12.4.0 Issue or pull request that will be included in release 12.4.0 label Jul 26, 2024
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [1f02535]
Page Load Metrics (56 ± 6 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint7011987136
domContentLoaded95523115
load409156126
domInteractive95523115
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 573 Bytes (0.02%)
  • ui: -483.32 KiB (-6.42%)
  • common: 1.68 KiB (0.02%)

@gauthierpetetin gauthierpetetin added release-12.3.0 Issue or pull request that will be included in release 12.3.0 and removed release-12.4.0 Issue or pull request that will be included in release 12.4.0 labels Sep 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-12.3.0 Issue or pull request that will be included in release 12.3.0 team-accounts-framework Accounts team type-enhancement

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.