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

Redesign the flow of Import account feature #222

Open
piotrwitek opened this issue Jan 31, 2022 · 6 comments
Open

Redesign the flow of Import account feature #222

piotrwitek opened this issue Jan 31, 2022 · 6 comments
Assignees
Labels
feature request New feature proposal

Comments

@piotrwitek
Copy link
Collaborator

piotrwitek commented Jan 31, 2022

What is the feature?
Currently when trying to import an account from the file Signer will open a new popup that is the duplication of the main window with the same contents of the main window causing confusion for the user:

It could be improved to make a new popup to show only the content of the Import page without duplicating the entire signer window with the menu bar. Also, the main window should not render the same content as the new popup, they should be separated.

This will improve a few things:

  1. This will not confuse the user anymore as there will be only one including the import page
  2. After the import is completed the import popup should close preventing the duplicated window issue.

Why is it an improvement?
Fix a duplicated popup issue and minimize the surface area of edge cases.

Any further details?
Feel free to add any specific information and/or risks that relate to the feature.

@piotrwitek piotrwitek added the feature request New feature proposal label Jan 31, 2022
@piotrwitek
Copy link
Collaborator Author

@George-cl could you please review and estimate please?

@George-cl
Copy link
Contributor

On Linux (Brave) when the new window opens the original popup closes which is less confusing. However, it remains open on macOS and Windows machines unfortunately.

Currently, all the code is doing is displaying the Signer's current view but in a new window. I don't think it'll be possible to have the window display anything different to the popup as it's tied to the same view/instance.
E.g. if the Signer instance is displaying page X, this can be viewed in the normal popup but we can also open another tab or window to interact with the extension but they will all display the same page X.

This can certainly be investigated to see if there is a workaround available but I'm not sure how long that might take.

Another route for investigation could be to see if we can manage to get the import process to work without requiring a persistent window to deal with the loss of focus when using the file explorer. This could be a re-architecture of where in the code the process occurs or maybe we could just open it in a new tab instead - I think Metamask does this for some tasks.

TL;DR: I don't think it's a feasible change with the current architecture however there are other routes we could investigate.

Hope this helps @piotrwitek

@piotrwitek
Copy link
Collaborator Author

piotrwitek commented Feb 1, 2022

@George-cl can you clarify please what you think is the blocker for displaying the different content for a new popup window created with browser.windows.create?

The API accepts the URL parameter with the HTML file to open. The current implementation is using index.html for both cases that's why it's showing the duplicated content. What if I pass another HTML file to open the popup for the import account case? Shouldn't that work as expected?

If you're not sure about the answer I'll create a POC to validate it.

@George-cl
Copy link
Contributor

What if I pass another HTML file to open the popup for the import account case? Shouldn't that work as expected?

I think you're right actually - just had a look at the code and I don't see why we couldn't pass another URL. I must have misremembered the implementation thinking it was more rigid than it is.

So yeah we can rework this but I still wonder if a better solution would be to avoid the duplicate window entirely (via one of the alternative routes I mentioned), even if they display different views it could be confusing for the user.

What do you think @piotrwitek @vladimir-gachkovsky ?

@piotrwitek
Copy link
Collaborator Author

piotrwitek commented Feb 1, 2022

@George-cl I agree that alternative could be better but we don't have any proof such a solution would work as these are rather theories that would need further investigations and much effort. The solution I have proposed looks like is feasible and can be easily estimated and doesn't require a lot of work.

I'd rather implement the solution I know will work than waste time on some uncertain alternatives and I think many stakeholders will agree here considering Signer 2 is in the working. 
cc @mssteuer

@mssteuer
Copy link
Member

mssteuer commented Feb 1, 2022

I agree @piotrwitek - let's implement the low-hanging-fruit improvement you're proposing, which has the benefits you identified and can be done relatively quickly/easily. We will safe the full reworking of the import flow for Signer 2.

@piotrwitek piotrwitek pinned this issue Feb 2, 2022
@piotrwitek piotrwitek unpinned this issue Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature proposal
Projects
None yet
Development

No branches or pull requests

3 participants