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

MetaMask action view should default to showing a connected account for the current tab #9020

Open
danfinlay opened this issue Jul 16, 2020 · 5 comments

Comments

@danfinlay
Copy link
Contributor

Inspired by the kind of confusion reported in issue #8956 and #8929

Problem

  • When a user re-visits a site with a non-connected account selected, previous version users expect the dapp to see their globally-selected account.
    • We handle this gracefully when the user switches the account within MetaMask, by prompting to connect or dismiss.
    • We do not provide indication when the user switches the account on a different site and then returns to the site with that different account selected.

The Classic Suggestion

For long-time MetaMask users and developers, the obvious solution is to implement behavior that more closely resembles breaking the connection, so when user re-visits site A, they do not carry context from site B.

This can be achieved with a log-out button like #8990, or by recognizing when a user is returning with a non-enabled account selected, and acting "not logged in" in this context.

That issue was closed because of a decent workaround, but it doesn't change the case for old dapps that are not implementing this workaround, with old users who expect a single globally-selected account.

The Version 8 Native Solution

There is another approach that I think is better in the long run, and it goes back to the original V8 designs, and an improvement that we cut from the first v8 release for the sake of shipping it sooner:

When clicking the MetaMask fox, you should always see a view that is contextual to the current site you are viewing.

This may be a list of the connected accounts, but at the bare minimum, it should be a connected account.

This does not solve the problem of "users who expect a single globally connected account", which is our old behavior, and it's unfortunate that this means breaking an established expectation.

This does have a behavior that we believe is more intuitive to new users from web2, however: The MetaMask fox becomes like a login widget in the corner of any site, and it allows you to reference the account that is connected to that site.

examples of login menus around the web

We did not implement this behavior originally so that we could ship V8 a bit sooner, as it had some major changes that were otherwise blocking production, but now that it's out, this is a pretty clear improvement that was long part of the plan, so we just need to prioritize it appropriately.

@pi0neerpat
Copy link

I think I would like this behavior, so I'm all for it.

Also, can we nail down naming?

MetaMask Account Management Behaviors

Name Description Notes
Global Single globally connected account, legacy behavior What everyone is familiar with now
Login/Logout The behavior you expect in web2 apps. Resembles breaking the connection by acting "not logged in" Minimalist option. Also a workaround until Site-Specific is implemented #8990
Site-Specific contextual to the current site / Version 8 Native Solution

@tdvni
Copy link

tdvni commented Jul 18, 2020

I think that an api should be provided to get metamask current display account, so that the old DApp only needs to judge whether it needs to call "wallet_requestPermissions" based on the current display account.

@pi0neerpat
Copy link

pi0neerpat commented Jul 19, 2020

@tdvni agreed. See conversation here #8956 (comment)

@danfinlay
Copy link
Contributor Author

Just an update here, we have another design proposal that may solve this issue better than even this, and we're fleshing out that design a bit more before deciding whether or not this should be implemented before that larger change.

@sennett
Copy link

sennett commented Dec 1, 2021

What happened with this in the end? Is the workaround at #8990 (comment) still the way to go? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants