-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Add Connected Accounts modal #8313
Conversation
f78f357
to
361ecd0
Compare
8250515
to
fd3009d
Compare
e42c69e
to
0d35cfb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
In addition to the inline suggestion, the way we identify the Primary account label is not correct. The permitted accounts are no longer ordered in the permissions state. They have to be sorted by preferences.identities[account].lastSelected
to identify which one is first. That's what we do before sending them to the dapp.
Currently, the Primary label is identified by whatever account is first in the permissions state.
Edit: We may also want to consider the name Primary. I was talking to @jennypollack about this earlier, and we want to encourage dapps to pay no attention to the order of the accounts returned from eth_accounts
or accountsChanged
, and let the dapp handle what the "primary" account is, if any. On the other hand, I'm not sure what that name should be. "Maybe the only account that the dapp will acknowledge until to switch to it in the MetaMask popup UI while browsing the dapp" doesn't exactly roll off the tongue.
...nnected-accounts-list/connected-accounts-list-item/connected-accounts-list-item.component.js
Outdated
Show resolved
Hide resolved
...-list/connected-accounts-list-options-item/connected-accounts-list-options-item.component.js
Outdated
Show resolved
Hide resolved
...-list/connected-accounts-list-options-item/connected-accounts-list-options-item.component.js
Outdated
Show resolved
Hide resolved
...-list/connected-accounts-list-options-item/connected-accounts-list-options-item.component.js
Show resolved
Hide resolved
...d-accounts-list/connected-accounts-list-options/connected-accounts-list-options.component.js
Outdated
Show resolved
Hide resolved
...d-accounts-list/connected-accounts-list-options/connected-accounts-list-options.component.js
Outdated
Show resolved
Hide resolved
ui/app/components/app/connected-accounts-list/connected-accounts-list.component.js
Outdated
Show resolved
Hide resolved
ui/app/components/app/connected-accounts-list/connected-accounts-list.component.js
Outdated
Show resolved
Hide resolved
ui/app/components/app/connected-accounts-list/connected-accounts-list.component.js
Outdated
Show resolved
Hide resolved
I'm not sure we do want to do this, and I don't think it's something we can reasonably accomplish. A lot of dapps just want to deal with a single account, not a list, and I don't see why we'd object to this. |
1ca63ad
to
0ec38c6
Compare
I'm just addressing the portal comment now, everything else should be good |
...nnected-accounts-list/connected-accounts-list-item/connected-accounts-list-item.component.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a question for learnin' reasons.
...nnected-accounts-list/connected-accounts-list-item/connected-accounts-list-item.component.js
Show resolved
Hide resolved
0ec38c6
to
76b80cc
Compare
@Gudahtt I moved the options into a tooltip in 76b80cc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far! I haven't reviewed the styles in detail yet, but I'll do that shortly. The account sort order is the only blocker.
ui/app/components/app/connected-accounts-list/connected-accounts-list.component.js
Outdated
Show resolved
Hide resolved
...d-accounts-list/connected-accounts-list-options/connected-accounts-list-options.component.js
Outdated
Show resolved
Hide resolved
4ede388
to
3ec2617
Compare
d99ee86
to
cd301f0
Compare
There's a single outstanding (small) issue here where switching accounts via the options list will keep the tooltip open. I'm not sure if there's an option to configure both hiding the tooltip when clicked and to have it be interactive. |
cd301f0
to
f050fe3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two outstanding issues remain:
- The account options menu is not great. It's weirdly slow to close (feels like almost a second!?), and doesn't close in all cases we'd want it to.
- The sort order of the accounts still isn't quite correct - the secondary order is now dictated by the order of permissions (which isn't supposed to be meaningful) rather the keyring controller order. This would be just a minor nuisance/inconsistency except that it is possible for accounts to have never been selected, so the primary account may still be wrong in some cases.
The first is not a deal-breaker, and the second is a weird edge case, so I think this is fine to merge for now so that design QA can start. I'll address both of these issues in separate PRs.
This has been addressed by #8607
This has been addressed by #8608 |
This PR implements the Connected Accounts modal designs.
Screenshots
Screenshots of the unconnected flow