snapshot-labs / sx-monorepo

Snapshot X monorepo
https://docs.snapshotx.xyz
MIT License
11 stars 10 forks source link

feat: vote modal with reason #427

Open wa0x6e opened 1 week ago

wa0x6e commented 1 week ago

Summary

Closes: #386

This PR moves the vote UI inside a vote modal, similar to v1, and allow attaching a reason to a vote.

Features

How to test

  1. Try to vote from inside a proposal page, or a proposal list (space proposals/home feed)
  2. It should open the vote modal if logged in, else will open the account modal
  3. The vote modal should show your selected choice, as well as your voting power for the current proposal
  4. The CONFIRM button should be disabled if you don't have sufficient voting power to vote
  5. You can attach an optional reason to your vote
  6. Vote is limited to 1000 chars, and should disable the form on error
  7. Clicking on the CONFIRM should vote like before if no reason, and will add a metadataUri (onchain) or reason (offchain) field if set
  8. It should show a warning message and disable the submit button when the vp fetching has failed or on insufficient vp
  9. On the create proposal page and vote modal, it should show a RETRY button to refetch the voting power, in case of fetching error
  10. Voting power should be cached, you should not see the loading indicator when getting the same vp again on same space and block, and should show the vp immediately.
  11. Voting power should refresh on wallet change/logout

TODO

Future

wa0x6e commented 1 week ago

@Sekhmet I got this working on offchain, but will need some help indexing the vote for evm, and also maybe starknet

wa0x6e commented 1 week ago

@bonustrack The vote reason is now working for offchain, and you can start testing the UI and UX.

Main testing area will be the UI/UX on the modal when the user don't have enough voting power, or failing to fetch voting power.