Skip to content

feat: Integrate SIP-12 update#23697

Merged
hmalik88 merged 111 commits intodevelopfrom
hm/integrate-SIP-12-changes
Jun 12, 2024
Merged

feat: Integrate SIP-12 update#23697
hmalik88 merged 111 commits intodevelopfrom
hm/integrate-SIP-12-changes

Conversation

@hmalik88
Copy link
Copy Markdown
Contributor

@hmalik88 hmalik88 commented Mar 25, 2024

This PR brings the domain resolution integration up to specification.

There's a lot going on in this PR so here's a quick breakdown of what's going on:

  • The DomainInputResolutionCell component is responsible for displaying a single resolution, it can properly display both ENS and snap provided resolutions. It also has logic to detect overflowing titles so that it can replace the title component with one that has an ellipsis and a tooltip showing the entire title.
  • The confusable component was modified to include an option to wrap the points in a text component instead of span and I added a prop to be able to assign a classname to the tooltip wrapper, I did this to allow for my use case of having a tooltip within a tooltip (an overflowing domain name with confusables).
  • The update to the AddressListItem component snapshot is because of the update to the confusable component.
  • I had to update implementation of the AddRecipient components because the update in the name resolution api would break the existing implementation. Those components will be removed at some point by the extension team. (These components have since been removed)
  • The AddContact component was updated to use the domain input resolution cell component.
  • The AddressListItem component was updated to accommodate overflowing titles (specifically when viewing all contacts).
  • The ViewContact & EditContact components were also updated to accommodate overflowing titles.
  • After the add/remove from address book actions, the old state would momentarily hang, so now I’m forcing the update for a cleaner UX where the old state won’t hang at all.

Previous AddContact screen:

317744893-1c15eebe-3a17-49df-8923-8cb84540761c.mov

New screens:

domainresolution.mov

Note: The AddContact screen was re-done to accommodate for snap provided resolutions and to update the designs as it seemed the screen was largely undesigned. See previous design video.

@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 INVALID-PR-TEMPLATE PR's body doesn't match template label Mar 25, 2024
@hmalik88 hmalik88 removed the INVALID-PR-TEMPLATE PR's body doesn't match template label Mar 25, 2024
@hmalik88 hmalik88 added team-snaps-platform-deprecated DEPRECATED: please use "team-core-platform" instead (or "team-new-networks" for Solana snap issues) flask labels Mar 28, 2024
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [e3cde27]
Page Load Metrics (126 ± 149 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint7111887105
domContentLoaded9131111
load431476126310149
domInteractive9131111
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 5.68 KiB (0.08%)
  • common: 377 Bytes (0.01%)

FrederikBolding
FrederikBolding previously approved these changes Jun 7, 2024
Copy link
Copy Markdown
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

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

LGTM! UI is looking great 💯 a few non-critical things to remember that we should probably add some linting for

  • We should try to avoid inline styles in favor of custom CSS classnames
  • It would be great if we can replace deprecated components in files that are updated

Comment on lines +170 to +175
await driver.clickElement('.settings-page__address-book-button');

// it checks if account is deleted
const exists = await driver.isElementPresent(contact);
const exists = await driver.isElementPresent(
By.css('.address-list-item__label'),
);
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.

non-blocking: CSS selectors are generally discouraged in favor of data-test-ids or tags and text
https://github.com/MetaMask/contributor-docs/blob/main/docs/e2e/extension-e2e-guidelines.md#guidelines

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

findElement was hanging and so I had to use isElementPresent and the By class, I don't see any static method that lets me select with data-test-ids or text.


await driver.pasteIntoField(
'input[placeholder="Enter public address (0x) or ENS name"]',
'.ens-input__wrapper__input',
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.

non-blocking: CSS classname selectors are generally discouraged

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

hmm for this one, the selector wasn't working for some reason, had to use this method.

Comment on lines +132 to +136
iconProps={{
color: IconColor.infoInverse,
style: { width: '12px', height: '12px' },
name: IconName.Snaps,
}}
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.

Will try to resolve the size issue with the AvatarIcon icon size in this PR #25155

{t('deleteContact')}
</Button>
<Box className="settings-page__address-book-button">
<Button
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.

non-blocking: it would help if we can replace deprecated code with component-library in files that are updated

Screenshot 2024-06-11 at 8 27 36 AM

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll replace once we get the BadgeIcon in, thanks!

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [eeef3d8]
Page Load Metrics (47 ± 3 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint65907774
domContentLoaded8221131
load39664773
domInteractive8221131
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 5.66 KiB (0.08%)
  • common: 377 Bytes (0.01%)

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [27ef0ac]
Page Load Metrics (48 ± 5 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint6011279136
domContentLoaded8171021
load398348115
domInteractive8171021
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 5.66 KiB (0.08%)
  • common: 377 Bytes (0.01%)

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [d9d1db4]
Page Load Metrics (619 ± 459 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint782221153416
domContentLoaded106520136
load482639619955459
domInteractive106520136
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 5.66 KiB (0.08%)
  • common: 377 Bytes (0.01%)

className="ens-input__wrapper__action-icon-button"
onClick={() => {
if (userInput) {
if (userInput.length > 0) {
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.

May be if (userInput?.length > 0) {

@hmalik88 hmalik88 merged commit a3cbcef into develop Jun 12, 2024
@hmalik88 hmalik88 deleted the hm/integrate-SIP-12-changes branch June 12, 2024 14:38
@github-actions github-actions bot locked and limited conversation to collaborators Jun 12, 2024
@metamaskbot metamaskbot added the release-12.1.0 Issue or pull request that will be included in release 12.1.0 label Jun 12, 2024
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [cb4df56]
Page Load Metrics (43 ± 2 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint62937563
domContentLoaded8131011
load38534342
domInteractive8131011
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 5.66 KiB (0.08%)
  • common: 377 Bytes (0.01%)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

flask INVALID-PR-TEMPLATE PR's body doesn't match template needs-assets-ux-review A shared label between the Assets and UX team to flag PRs ready for consolidated team review. release-12.1.0 Issue or pull request that will be included in release 12.1.0 team-snaps-platform-deprecated DEPRECATED: please use "team-core-platform" instead (or "team-new-networks" for Solana snap issues)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants