polkadot-cloud / polkadot-staking-dashboard

Fully Featured Dashboard for Staking and Nomination Pools on Polkadot.
http://staking.polkadot.cloud
GNU General Public License v3.0
158 stars 167 forks source link

feat: Feature stake decentralization: How decentralized is your nomination? #2160

Closed rvalle closed 2 months ago

rvalle commented 3 months ago

This PR provides decentralization analytics for a given nomination, in Kusama and Polkadot chains.

In line with treasury proposal, it answers the question: "How decentralize is your nomination?" in the staking dashboard, the preferred place to stake in the Polkadot Community.

The new section will report most of the data available in Polkawatch, without required to extend the Dashboard codebase, and a link is provided in case the user wants additional information.

The new page has been localized to EN CN and tested against several edge conditions: Unsupported Blockchain, No Staking, No Analytics available, API error. In all cases the User experience is taken care of.

The GeoDonut graphic component has also been enhanced with additional parameters in a backward compatible mode.

The Chinese localization has been performed by Machine provided with historic project context, and needs to be reviewed.

The rendering has been tested on PC and Mobile devices ensuring that it adapts properly to small devices.

Reasonable care has been taken to fit with current UI patters.

Help definitions have also been included as well as link to an external article.

The new page looks like this:

FireShot Capture 006 - Decentralization _ Polkadot Staking Dashboard - localhost

rossbulat commented 3 months ago

Nice work!

One immediate thought comes to mind that your decentralisation statistics should be present inside the Nominate and Pools page, rather than a separate page. A user might be in a pool and nominating, both of which will have a different set of validators backed. It would be intuitive in this case to have the new sections below the nominee lists on the respective pages.

This means that we would lose the stat boxes of the Decentralization page, we could however experiment with placing them elsewhere.

It might be worth introducing an icon next to the percentages in the Geolocation per nomination cards, and then ability to roll over to see what the percentage actually represents. Right now it is difficult to see what they represent.

rossbulat commented 3 months ago

@TingALin Would you be able to check the CN translations please?

TingALin commented 3 months ago

@TingALin Would you be able to check the CN translations please?

They all looking good to me

rvalle commented 3 months ago

thanks @rossbulat

I totally agree that the % next to the share of the nomination can be confusing (i.e. users may think it is a commission). An Icon + A pop up message would definitely help.

The UI structure choice I see as more difficult to make. The benefit is that the decentralization analytics will get more traffic as they are together with the core data, however my concern is, Will the pages become too large? I did not consider 2 big tables in the same page.

Pool decentralization I think it is also important to present when the pool is being selected in the Join Pool tab. And help the user consider this information when selecting the pool.

An alternative to enlarging both nominate and pool sections could be to have decentralization page implement top tabs ( like the one in pools: Overview/All pools/Favorites)... with decentralization of Nomination, Pool1...PoolN (Is it possible to join multiple pools?). But it would be easy to identify the involved pools and put each thing in a tab with the decentralization of the nomination. We could split in tabs when introducing pool decentralization, in a next PR.

Which alternative do you prefer?

rvalle commented 3 months ago

Hi @rossbulat

I have now added the icon and tooltip message. Please review.

rvalle commented 3 months ago

@rossbulat here, I have tested an alternative UI design with the decentralization data inside the nominate are,

https://github.com/rvalle/polkadot-staking-dashboard/tree/feature-statke-decentralization-in-nomination

What do you think?

I think I am going to try a third alternative...

rvalle commented 3 months ago

And here yet another UI design, we moved decentralization into a tabbed version of nomination:

https://github.com/rvalle/polkadot-staking-dashboard/tree/feature-stake-decetralization-in-tabbed-nomination

what do you think?

rossbulat commented 2 months ago

I have taken this PR and made some polishes in https://github.com/polkadot-cloud/polkadot-staking-dashboard/pull/2185 that I will merge now.