polkadot-js / extension

Simple browser extension for managing Polkadot and Substrate network accounts in a browser. Allows the signing of extrinsics using these accounts. Also provides a simple interface for compliant extensions for dapps.
Apache License 2.0
971 stars 415 forks source link

Sort accounts #1000

Open xlc opened 2 years ago

xlc commented 2 years ago

Currently the account order is mystery to me, change the chain will have it jump to some unexpected position.

If will be helpful if the order is something more user friendly. e.g. sort by: account hidden, network, the account name.

jacogr commented 2 years ago

It is actually sorted, https://github.com/polkadot-js/extension/blob/master/packages/extension-ui/src/util/buildHierarchy.ts#L65-L76

There is something to be said for defining your own oder, but in reality it will have to wait a long time

xlc commented 2 years ago
Screen Shot 2022-02-14 at 9 08 50 PM

It doesn't seems working for me.

jacogr commented 2 years ago

Weird. That is completely random as depicted. (Not sure what goes weird, since I have not seen that, but pictures don’t lie)

qqqzhch commented 1 year ago

Different networks have different formats of addresses. Use these to sort them, the order is easy to change network name, path, creation If have record the time when creating or importing account, account can be sort by time so that the order does not change easily.

Maybe just sorting by time would be fine, sorting by network and name would be easy to change due to switching networks