Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

New Address Selector Component #3829

Merged
merged 45 commits into from Dec 27, 2016
Merged

New Address Selector Component #3829

merged 45 commits into from Dec 27, 2016

Conversation

ngotchac
Copy link
Contributor

Add a new Address Selector component. This is a full width component that should make searching through addresses easier and nicer.

It is a first try, and I'm sure many things can be improved.
The InputAddressSelect Component is by default using this new component, but the old one is still available by just specifying it from props (we might want to remove this).

Included features:

  • Keyboard navigation: navigate through addresses with tab or left/right/up/down arrows
  • Select addresses without selecting the account
  • Copy the address when focusing on an account
  • Pressing enter when there's only one item selects it
  • More features...

address selector

@ngotchac ngotchac added A0-pleasereview 🤓 Pull request needs code review. M7-ui labels Dec 12, 2016
@jacogr
Copy link
Contributor

jacogr commented Dec 13, 2016

Marking WIP for the changes as discussed.

@jacogr jacogr added A3-inprogress ⏳ Pull request is in progress. No review needed at this stage. and removed A0-pleasereview 🤓 Pull request needs code review. labels Dec 13, 2016
@gavofyork
Copy link
Contributor

maybe get #3871 into this, too?

@jacogr
Copy link
Contributor

jacogr commented Dec 22, 2016

Makes is very confusing when the contracts page swaps to the middle - initially I thought "these aren't contacts" -

parity 2016-12-22 10-01-14

Columns should stay in-place, not jump around in the UI

flex: 1;

.input {
font-size: 36px;
Copy link
Contributor

@jacogr jacogr Dec 22, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we make it 1.5em (my mistake, the headings are 1.5em, not 36px - don't know where I got that number from)

@derhuerst
Copy link
Contributor

aspects i really like:

  • you can tab into the popup and it clearly shows you which item is focused. ❤️
  • it looks nice and structured!
  • the addresses are displayed.

[personal opinion] UX grumbles:

  • I'd like the popup to be less translucent. It's pretty noisy.
  • The address input you click in the beginning should have cursor: text;.
  • The close button should have a subtle, but noticeable hover effect, e.g. opacity.
  • On my screen, tags of accounts are almost invisible. Imagine this on a projector or in direct sunlight. Would prefer to have the accounts/contacts/contracts boxes dark, like in the rest of the UI.
  • Instead of "No account matches this query…", I'd use sth like "Proceed with 0x…". It sounds less like an error, as it's a perfectly valid step to proceed with a (still) unknown address.
  • Putting a custom/unknown address should still validate if it has the correct length. It may allow you proceed with 0x123, but should make it red.
  • The addresses should be shown as font-family: monospace;.
  • On narrow screens, the account names overflow the tags.
  • The "recipient address" input on top doesn't look aligned with the rest.

const range = document.createRange();
range.selectNode(element);
window.getSelection().addRange(range);
document.execCommand('copy');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may want to consider all the quirks involved with the clipboard. Haven't found a focused & well-written module yet though.

<InputAddress
accountsInfo={ accountsInfo }
allowCopy={ false }
disabled
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

return this.items[address];
}
const id = 'addressSelect_' + Math.round(Math.random() * 100).toString();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to have a counter for this, renamed to sth like newId.

let lastId = 0
const newId = () => `id${++lastId}`

@ngotchac
Copy link
Contributor Author

I've taken into account most of your comment @jacogr and @derhuerst

The only quirk left is are the tags merging into the name. This behavior also happens with other Accounts Cards (in Accounts or Contracts, etc.). At least it's a consistent quirk !
I'm not sure what the behavior should be : should some tags be hidden if the name overlays over them ? Should all the tags be hidden with a small icon/popover to show them on hover ?

@jacogr
Copy link
Contributor

jacogr commented Dec 22, 2016

@ngotchac As you said, it is consistent behaviour, would not worry about it too much atm, as ugly as it is. (Once we have moved accounts over to use the same Card, we can re-visit.)

@jacogr
Copy link
Contributor

jacogr commented Dec 22, 2016

Ok, not sure why we moved to monospaced fonts here for the address.

With this we are now wildly inconsistent since there is nowhere in the UI where we actually display addresses with monospaced fonts - not on any of the views, not in any of the drop downs, not in any of the inputs.

Apart from that, looks to be there.

@derhuerst
Copy link
Contributor

derhuerst commented Dec 22, 2016

Ok, not sure why we moved to monospaced fonts here for the address.

Guess @ngotchac followed my suggestion.

With this we are now wildly inconsistent since there is nowhere in the UI where we actually display addresses with monospaced fonts […].

You have a better overview over the UI. But I'm very sure it used to be like this a short time ago.

I'm completely fine with abbreviating the address (using <abbr>) as we have the copy button. But as as long, as we consider the address something important, worth the full length, I'd like it to be properly displayed (which imho means monospaced).

As a side note, while we're talking about the addresses: I'd like them all be either lower/upper case, not a mixture. Or is there a reason behind this?

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.04%) to 85.722% when pulling f814aea on ng-enhanced-address-selector into b444d23 on master.

@jacogr
Copy link
Contributor

jacogr commented Dec 22, 2016

Mixed case is due to us following EIP55 for checksums

@jacogr jacogr added A7-looksgoodcantmerge 🙄 Pull request is reviewed well, but cannot be merged due to conflicts. and removed A0-pleasereview 🤓 Pull request needs code review. labels Dec 23, 2016
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 85.524% when pulling ddc04d3 on ng-enhanced-address-selector into 74efb22 on master.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 61c5b9c on ng-enhanced-address-selector into ** on master**.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 61c5b9c on ng-enhanced-address-selector into ** on master**.

@ngotchac ngotchac added A8-looksgood 🦄 Pull request is reviewed well. and removed A7-looksgoodcantmerge 🙄 Pull request is reviewed well, but cannot be merged due to conflicts. labels Dec 24, 2016
@gavofyork gavofyork merged commit 1ffc6ac into master Dec 27, 2016
@gavofyork gavofyork deleted the ng-enhanced-address-selector branch December 27, 2016 09:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants