-
Notifications
You must be signed in to change notification settings - Fork 192
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
feat: new mobile wallet create flow #8760
base: develop
Are you sure you want to change the base?
Conversation
src/pages/Dashboard/components/DashboardHeader/DashboardHeaderTop.tsx
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.
It was a legacy component from the initial dialog implementation, not used anymore
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.
Move this file to it's proper folder, this is a feature by itself as we also redirect to this view one level upper in the tree (when backing up already created wallet)
@@ -18,10 +24,12 @@ export const CarouselDots = ({ length, activeIndex, onClick }: CarouselDotsProps | |||
width='7px' | |||
height='7px' | |||
borderRadius='50%' | |||
backgroundColor={i === activeIndex - 1 ? activeDotBackgroundColor : 'text.subtle'} | |||
backgroundColor={ | |||
i === activeIndex - 1 ? activeDotBackgroundColor : inactiveDotBackgroundColor |
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.
Make it more customizable anywhere
useEffect(() => { | ||
try { | ||
if (!vault) setVault(location.state?.vault ?? createWallet()) | ||
} catch (e) { | ||
console.log(e) | ||
} |
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.
My biggest concern:
Should we revoke the wallet and recreate it in every screens? It's a lot of boilerplate/verbose code that I avoided, because I mean, if a not-memoized component is unmounted, it shouldn't stay in memory
But happy to bring it if we feel like we need some extra safety
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.
Think this should be safe indeed since this is a state var.
Revoker basically just revokes whichever secret (seed, master key, isolated mnemonic or whatever the isolation wallet does magic-wise...), but indeed, vault is also nuked from cache on unmount in theory.
With that being said,I'm not sure that it being theoretically safe is a good enough reason not to revoke, especially given how routing works (definitely seen many instances of routes still being mounted), and not super confident with security relying on such assumption.
@NeOMakinG can we keep it non-revoked and assume routes being unmounted means garbage collect kicking in and nuking vault for that PR but do a direct follow-up with revoke()
boilerplate?
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.
What a beast of a PR ser. Functionally looks sane minus a few smolish comments, runtime test incoming.
@@ -2,6 +2,8 @@ import { AnimatePresence } from 'framer-motion' | |||
import { MemoryRouter, Redirect, Route, Switch } from 'react-router' | |||
import { Dialog } from 'components/Modal/components/Dialog' | |||
|
|||
import { CreateRouter } from './routes/CreateWallet/CreateRouter' |
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.
nitpick: CreateWalletRouter
@@ -87,7 +101,7 @@ export const SavedWallets: React.FC<SavedWalletsProps> = ({ onClose }) => { | |||
variant='ghost' | |||
colorScheme='blue' | |||
leftIcon={addIcon} | |||
onClick={handleCreate} | |||
onClick={handleCreateClick} |
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.
💜
setSelectedWordIndex(prev => { | ||
const next = (prev ?? -1) + 1 | ||
if (next >= TEST_COUNT_REQUIRED) { | ||
;(async () => { |
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.
q: should this method be an async callback instead of IIAFE?
useEffect(() => { | ||
try { | ||
if (!vault) setVault(location.state?.vault ?? createWallet()) | ||
} catch (e) { | ||
console.log(e) | ||
} |
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.
Think this should be safe indeed since this is a state var.
Revoker basically just revokes whichever secret (seed, master key, isolated mnemonic or whatever the isolation wallet does magic-wise...), but indeed, vault is also nuked from cache on unmount in theory.
With that being said,I'm not sure that it being theoretically safe is a good enough reason not to revoke, especially given how routing works (definitely seen many instances of routes still being mounted), and not super confident with security relying on such assumption.
@NeOMakinG can we keep it non-revoked and assume routes being unmounted means garbage collect kicking in and nuking vault for that PR but do a direct follow-up with revoke()
boilerplate?
|
||
<Box bg={bgColor} borderRadius='xl' p={4} width='full'> | ||
<SimpleGrid columns={2} spacing={2}> | ||
{words.map((word, index) => ( |
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.
nitpick: can be memoized
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.
Tested locally, confirmed we're still looking good create (in splash and in wallet-connected state) and backup-wise (on new create backup state as well as in wallet-connected state).
Some smallish visual shenanigans to be tackled, though nothing major blocking functionally.
- Manual backup hints that there is a next step, however
showContinueButton
is false when in the context of a connected wallet we're backing up, and this copy should probably be hidden?
![image](https://private-user-images.githubusercontent.com/17035424/411097860-3be6fe74-8934-4a15-92b9-8277792b72e6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMTExMzcsIm5iZiI6MTczOTAxMDgzNywicGF0aCI6Ii8xNzAzNTQyNC80MTEwOTc4NjAtM2JlNmZlNzQtODkzNC00YTE1LTkyYjktODI3Nzc5MmI3MmU2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDEwMzM1N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNmOGJhNmYwMjZlYzJkZjljZjQwNGI2OWI1YmE4ODU5MzI2MzUzOTVlZmFhOWU0OGExYTM0YWVlNTUxZGNlMjMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.NR5iJ45i-Q3J1mMQmO8Bx3J5oFxpy1Esji2YngEdwXQ)
- Similarly re: flow not being adapter to the "backing up a connected wallet" flow and assuming this is the backup step when creating a wallet, there is a stepper which is also confusing and probably shouldn't be here
![image](https://private-user-images.githubusercontent.com/17035424/411098083-00d64560-0be3-462d-a25d-d2528a0cf7fd.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMTExMzcsIm5iZiI6MTczOTAxMDgzNywicGF0aCI6Ii8xNzAzNTQyNC80MTEwOTgwODMtMDBkNjQ1NjAtMGJlMy00NjJkLWEyNWQtZDI1MjhhMGNmN2ZkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDEwMzM1N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNkODFiOTdjOTFhNjE5YzM5YzQzMjA5OGEyMjQzZDFiZDRmMTRkNTYyNTg2ZmRmYTIxMmYyODlhNjQ0MTNhMTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.aq2ISvakU7TFX1BfZUWZl6w-PhjdwHFh9ggzk0USQFc)
-
Seed looks sane above ✅
-
Creating a wallet is sane ✅
One lil weird flash of testing a word at around 51 seconds if we want to tackle this @NeOMakinG https://jam.dev/c/566a5b5a-5320-4057-a362-6750a886a775?startFrom=51.70
![image](https://private-user-images.githubusercontent.com/17035424/411099985-4895408c-ea76-4718-b485-080d9942c0eb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMTExMzcsIm5iZiI6MTczOTAxMDgzNywicGF0aCI6Ii8xNzAzNTQyNC80MTEwOTk5ODUtNDg5NTQwOGMtZWE3Ni00NzE4LWI0ODUtMDgwZDk5NDJjMGViLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDEwMzM1N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWU0NTYyY2E5ZDBjZDg2N2YyOTIzMThkZTUzZWRlMTFkMDQ5Y2UzYjJmNzE1M2RhMzI2MGIxODgxNzQwZTE0ZDkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.o7K9IMtmMXLaLhw-xTfMthBnJiVseB4DdzfsdE0hwJA)
![image](https://private-user-images.githubusercontent.com/17035424/411100027-58fd8577-2677-41f8-b2d3-9794f4ed0516.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMTExMzcsIm5iZiI6MTczOTAxMDgzNywicGF0aCI6Ii8xNzAzNTQyNC80MTExMDAwMjctNThmZDg1NzctMjY3Ny00MWY4LWIyZDMtOTc5NGY0ZWQwNTE2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDEwMzM1N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTZhM2ZjOTZjNGY0OTIwMTZhMmZlODRjMjZiZTMyNGQ2ODQ3ZTJmM2EyZWJmMjAwYTgwZmRmNGYyMThkMzJkZWEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.k9RC_HVa6hqEPED9qcmLAcekN6uOyDqEYBhI8_cHrYc)
- Creating a wallet from splash is still happy ✅
Description
Implement the new mobile flow of creating a wallet, backing up mnemonic
Using the dialog component
As a follow up, we should replace this flow from the splash screen too
Issue (if applicable)
closes #8706
Risk
High (create wallet on mobile, mnemonic memory leaks...)
Testing
Engineering
A small concern on memory clean up that I'll add as a self-review comment
Operations
n.a
Screenshots (if applicable)
https://jam.dev/c/0e88ee55-607f-485a-a705-deb03c002e53
Pushed to gome so we can test!