Skip to content

Swaps token sources/verification messaging update#10346

Merged
danjm merged 10 commits intodevelopfrom
swaps-tkn-verification-messaging
Feb 5, 2021
Merged

Swaps token sources/verification messaging update#10346
danjm merged 10 commits intodevelopfrom
swaps-tkn-verification-messaging

Conversation

@danjm
Copy link
Copy Markdown
Contributor

@danjm danjm commented Feb 2, 2021

Provides a more emphasized message about token sources and verification of tokens on etherscan, on the build quote screen of swaps. In addition, if our server indicates that the token is only recognize by 1 of the multiple sources that it tracks, then it requires the user to click "Continue" before they can request quotes.

Resolves #10325

Peek.2021-02-02.18-00.mp4

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 2, 2021

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.

@danjm danjm force-pushed the swaps-tkn-verification-messaging branch 2 times, most recently from d74f1e0 to e1fc233 Compare February 3, 2021 14:14
@danjm danjm marked this pull request as ready for review February 3, 2021 14:20
@danjm danjm requested a review from a team as a code owner February 3, 2021 14:20
@danjm danjm requested a review from Gudahtt February 3, 2021 14:20
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [e1fc233]
Page Load Metrics (624 ± 34 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint46725673
domContentLoaded5528226237134
load5528236247134
domInteractive5518226237134

@Gudahtt
Copy link
Copy Markdown
Member

Gudahtt commented Feb 3, 2021

How does this handle the case where token metadata differs between the sources used by the API? We talked about doing something like this before, and the problem was that the API didn't expose whether the metadata differed between sources at all, which is much more important than whether it was confirmed by multiple sources.

"description": "Used in the transaction display list to describe a swap. $1 and $2 are the symbols of tokens in involved in a swap."
},
"swapTokenVerificationMessage": {
"message": "$1 Always confirm the token address on $2. $3",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

$1 here seems like an entirely separate sentence. Could this be broken out of this message, to simplify the work for translators? I'm not entirely sure why it's embedded.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Similarly, $2 and $3 can be represented as a single placeholder. There is no need for them to be separated.

@danjm danjm force-pushed the swaps-tkn-verification-messaging branch from e1fc233 to 9910d37 Compare February 4, 2021 16:12
@danjm
Copy link
Copy Markdown
Contributor Author

danjm commented Feb 4, 2021

@Gudahtt Your comments have been addressed in the latest commit

@danjm danjm force-pushed the swaps-tkn-verification-messaging branch from 9910d37 to 91effb4 Compare February 4, 2021 16:18
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [91effb4]
Page Load Metrics (919 ± 52 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint64137102189
domContentLoaded538108291810852
load540108391910852
domInteractive537108291710852

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [bb2e461]
Page Load Metrics (923 ± 30 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint7612795136
domContentLoaded80110449216330
load80210469236330
domInteractive80110439206330

@Gudahtt
Copy link
Copy Markdown
Member

Gudahtt commented Feb 4, 2021

Needs a rebase to fix conflicts from the semicolon eslint change

@danjm danjm force-pushed the swaps-tkn-verification-messaging branch from bb2e461 to 3aa2eb7 Compare February 4, 2021 20:48
@danjm
Copy link
Copy Markdown
Contributor Author

danjm commented Feb 4, 2021

This has been rebased

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [3aa2eb7]
Page Load Metrics (683 ± 105 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint429360189
domContentLoaded5161374681219105
load5171376683219105
domInteractive5161373681218105

<div className="actionable-message__message">{message}</div>
{(primaryAction || secondaryAction) && (
<div className="actionable-message__actions">
<div className={classnames('actionable-message__actions')}>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: This change is not necessary

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.

Removed in 7aa4baa

@danjm danjm dismissed a stale review via a039542 February 5, 2021 02:42
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [a039542]
Page Load Metrics (652 ± 75 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint459365157
domContentLoaded36389665115675
load36489765215675
domInteractive36289565015675


.actionable-message__action {
font-weight: normal;
cursor: pointer;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: This rule is redundant. It already has cursor: pointer from the base actionable-message__action class

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This can get cleaned up in the PR that makes this more accessible.

Copy link
Copy Markdown
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

The only problem I found is that the Continue button is not accessible. We should be using a <button> element there instead of making a div clickable. I won't block on it because it's a pre-existing issue with ActionableMessage buttons, but we should try to fix this before this ships.

@danjm danjm merged commit 33ab480 into develop Feb 5, 2021
@danjm danjm deleted the swaps-tkn-verification-messaging branch February 5, 2021 17:11
@github-actions github-actions bot locked and limited conversation to collaborators Feb 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Token verification UX (swaps)

3 participants