-
Notifications
You must be signed in to change notification settings - Fork 18
[DDW-603] Enable pasting of wallet recovery phrase #168
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
base: develop
Are you sure you want to change the base?
[DDW-603] Enable pasting of wallet recovery phrase #168
Conversation
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.
@aleksandardjordjeviciohk I found a UX issue: when you paste words and one is incorrect it displays it correctly as the editable word + opens the dropdown. But when I choose the word from the dropdown, the incorrect/incomplete word stays editable / is still the last word - I would expect the incomplete word to be replaced by my choice in the dropdown instead
Uploading CleanShot 2021-04-06 at 19.56.47.mp4…
@aleksandardjordjeviciohk I was able to replicate the issue @DominikGuzei mentioned in Storybook, but doesn't reproduce in Daedalus. |
…e' of github.com:input-output-hk/react-polymorph into feature/ddw-603-enable-pasting-of-wallet-recovery-phrase
…iple word selection
Fixed @DominikGuzei |
Can you retest once again now @gabriela-ponce ? |
@aleksandardjordjeviciohk The issue is fixed, but I found another odd behavior: If you enter a word that starts like another word (for example "category" starts "cat") you can only insert the firsts letters that match the shorter word, meaning that you cannot insert the longer word manually, only by pasting it. Also if you paste part of the longer word, then when you start to delete the characters the input automatically selects the shorter word. Here's a video. |
…iple word selection - part 2
@gabriela-ponce i have updated the PR with a fix which covers this behavior. Pls recheck it. |
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.
@aleksandardjordjeviciohk the issue with the words that start with the same letters is only half solved:
https://user-images.githubusercontent.com/172414/114856821-db77cd80-9de7-11eb-9e44-b08d425dfc2a.mp4
- Enter "cat" -> correctly shows "cat" and "category" in the dropdown
- Choose "category" -> correctly enters the words in the input
- Enter "cat" again -> it immediately picks "cat" without even submitting the words from the dropdown
So it wouldn't be possible to pick "category" again in this scenario
@aleksandardjordjeviciohk I was able to replicate the issue that @DominikGuzei mentioned. Check this video. |
…iple word selection - part 2
Fixed |
…f-wallet-recovery-phrase' into feature/ddw-603-enable-pasting-of-wallet-recovery-phrase
…ove word dropdown show/hide
…ove word dropdown show/hide
Regarding this list of issues on #2459:
1 - Fixed on Netlify
2 - Can't test on Netlify, doesn't reproduce on build 17687
3 - Still reproduces on Netlify and build 17687. Check Video.
4 - Can't test on netlify, doesn't reproduce on build 17687 Regarding these issues: # 1
I can still reproduce them, and I found more details that can be relevant: 1 - Insert any word first You'll notice that instead of displaying the list including "cat" and "category", the word "cat" is selected immediately. Check this video. If you type "cat" and there are no other words on the input, the list will be displayed correctly. Check this video. |
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 and works great now 👍
@gabriela-ponce please re-check this, from what i saw the remaining issues have been fixed |
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.
I would like to discuss the changes involving timeouts and boolean flags - let's get rid of these by tackling the underlying issue together 🙏
source/components/Autocomplete.js
Outdated
this.setState((prevState) => ({ isRemoveWordClicked: !prevState.isRemoveWordClicked })); | ||
} | ||
}, 0); | ||
}} |
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.
@aleksandardjordjeviciohk can we improve the isRemoveWordClicked
logic to something cleaner? It looks like a hack to me and in general I would like to keep timeouts to the absolute minimum because they are also hacks in most cases.
@aleksandardjordjeviciohk and I discussed that the Autocomplete component and especially this feature requires refactoring to avoid confusion and bugs in the future. The goals of this refactoring are to clean up the click/input handling to the latest UX we decided on and avoid bolting on more dumps with duck-tape. |
@DominikGuzei but we have merged Daedalus PR which depends on this PR input-output-hk/daedalus#2459 |
@DominikGuzei @aleksandardjordjeviciohk why is this one still open? Is it still relevant? |
@nikolaglumac yes this is still relevant and I think @aleksandardjordjeviciohk is working on it. Unfortunately, we have merged a part of it already into Daedalus and I guess this PR was opened again because of some issues that have been found. When reviewing the changes I saw that the Autocomplete logic was in bad shape and didn't want to approve another quick fix on top of the existing bad code (not @aleksandardjordjeviciohk fault) … hopefully @aleksandardjordjeviciohk can tell us about the current state? In the worst case, I would revert the changes that already went into the 1.0.0 release from the previous PR |
@DominikGuzei please sort it out among the 3 of you. I would like to stay out of this discussion. Thanks! |
This PR enables pasting of wallet recovery phase.
This PR will utilized changes from React Polymorph Autocomplete component from here:
#163
JIRA Ticket: https://jira.iohk.io/browse/DDW-676
Todos
Screenshots

---Testing Checklist
Pending issues:
1 - When deleting already entered words by clicking on the "x" button we should prevent the options dropdown to show (this is reproducible in develop too). Reported here (# 3).
2 - Choose "category" -> correctly enters the words in the input
Enter "cat" again -> it immediately picks "cat" without even submitting the words from the dropdown
So it wouldn't be possible to pick "category" again in this scenario. Reported here and related to this. More information here.
Review Checklist
Basics
feature
/bug
/chore
,release-x.x.x
)yarn test
)yarn dev
)yarn package
/ CI builds)yarn flow:test
)yarn lint
)yarn prettier:check
)yarn manage:translations
produces no changes)yarn storybook
)yarn.lock
file is updatedCode Quality
Testing
After Review
done
column on the YouTrack board