-
Notifications
You must be signed in to change notification settings - Fork 15
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
fix: change user overview info #3332
base: master
Are you sure you want to change the base?
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.
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.
Thanks for your PR @adam-strzelec π
Unfortunately, when I voted support as a user who did not stake, I got the failed message despite the motion passing:
@@ -116,6 +119,7 @@ export const useClaimConfig = ( | |||
actionData.motionData.motionStateHistory.hasFailedNotFinalizable; | |||
|
|||
const userStake = usersStakes.find(({ address }) => address === userAddress); | |||
const userVote = voterRecord.some((item) => item.address === userAddress); |
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.
how about hasUserVoted
to indicate it's a boolean and not the vote value?
? 'motion.finalizeStep.failed.statusText' | ||
: 'motion.finalizeStep.statusText', | ||
id: | ||
isMotionFailedNotFinalizable || (!userStake && userVote) |
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.
Not sure I'm following this. Why do we want to show failed status text if user did not stake but has voted?
@jakubcolony done. According to Arren, in the case where "user who did not stake but did vote" and with the outcome passed, it should have the description "Action has passed and can be executed." |
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.
Sorry, I'm still unsure this is correct. When I staked and voted, I saw this when motion was ready to be finalized:
Shouldn't that say "Action has passed and can be executed"? Before finalization, I don't think we can consider the action to be "complete".
Then as a user who staked but not voted, the same motion step had a different label:
And that persisted even past finalization (at which point the action has been executed, so the label seems incorrect):
Do you actually need to take into account whether the user has voted? I would've thought you only need to consider these cases:
- Motion ready to be finalized: Action has passed and can be executed.
- Motion finalized: Action has passed and is now complete.
- Motion failed: Keep existing copy.
@adam-strzelec Just to confirm, Jakub is correct here. Everyone should see the same description in the last steps. |
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.
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.
This is working great for motions which are approved:
User who staked: (It does show a negative reward which I don't think is correct).
User who did not (should a user who did not stake but has a reward because they voted, be able to claim the reward? I think they should but there is no claim button here for them)
After claiming as the other user, the claimed pill shows here.
As a user who did not stake or vote:
However, when a motion is rejected, the text still says it has passed:
And when finalised the rejection:
There is also no claim button but the UserHub implies there should be.
I think the claiming issues are out of scope for this, but the wording should be fixed up here for rejected motions.
|
@adam-strzelec we might need some clarification from @arrenv for all of these:
|
1494d33
to
10456e2
Compare
|
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.
Nice job, thanks for the changes.
The wording is now correct for a failed motion:
Also looks good as a user who voted but did not stake:
This issue I mentioned previously with the transaction showing "Claimable" but no claim button being visible is occurring on master, so can definitely be addressed separately.
@@ -107,6 +108,12 @@ const FinalizeStep: FC<FinalizeStepProps> = ({ | |||
actionData, | |||
refetchColony, | |||
]); | |||
// console.log('action data: ', actionData); |
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.
Leftover comment
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.
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.
Re-approving good to go
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.
Thank you @adam-strzelec, this is good to go. Just a reminder about the leftover console.log.
Failed without staking or voting:
On a side note, there is a bug here (not introduced by this PR): #4004
Also a bug here, again not introduced by this PR. Added to the issue above.
Nice work! πͺ
05b8a7c
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.
Thanks for picking up this issue @adam-strzelec π
The overview as a user who staked and voted
The overview as a user who only voted
After fully supporting the staking step and claiming the reward
After fully opposing the staking step
After opposing the voting step
And after both users opposed the voting step, but only leela
staked
Nice job! π
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.
@adam-strzelec Thank you for your continued work on this PR. All looks mostly resolved on the actions side, but I ran into a couple of issues and noticed there a few issues still with agreements:
-
For a user that voted on the winning side, but did not stake, it shows that they have rewards correctly, however, it is showing a "Claim" button. The reward should auto pay out on the reveal so there shouldn't need to be a claim button in this case. The claim is button should be required if they staked. At the moment, when clicking in this state you get this error in console and nothing else happening in the UI.
-
There is a margin bottom, this should be removed, without impacting the margin for when the button is present.
-
For Agreements, the description for users who DID NOT STAKE is not correct. Given they cannot claim or return stakes for others. The text should be the same format others, with the change from Action to Agreement.
- PASSED: "Agreement has passed and now is complete."
- FAILED: "Agreement has failed and now is complete."
-
For Agreements, the description and button text for users who DID STAKE is not correct. They should be:
-
Unclaimed stakes:
- PASSED: "Agreement has passed, stakes can be claimed."
- FAILED: "Agreement has failed, stakes can be claimed."
-
Claimed stakes:
- PASSED: "Agreement has passed and now is complete."
- FAILED: "Agreement has failed and now is complete."
-
-
When the agreement fails, the staking overview is still not correct. It is showing the stake correctly, but not a total, and the button is not visible, despite there being a stake available to claim.
Hey @adam-strzelec, just a heads up there have been changes requested by Arren that need to be addressed before we can review further. Thanks |
β¦py for opposed action
05b8a7c
to
a8c3454
Compare
@arren done. I was not able to replicate the bugs from points 2 and 6. They work fine for me. |
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.
Thank you for your continued work on this PR, motions are pretty complex so nice work tackling that.
A few UI issues that I noted:
There is some extra padding when finalizing a motion:
Spacing between elements breaks when claim button goes into pending state:
Screen.Recording.2025-01-21.at.22.47.37.mov
Motion failed without staking β
Motion failed after objecting - there should be a claim button here, but it was broken before (#4004)
As a user who staked and voted (support) β
As a user who staked and voted (oppose) - unable to claim, part of the same issue #4004:
As a user who didn't stake but voted (support) β
As a user who didn't stake but voted (oppose) β
As a user who staked but didn't vote (support) β
As a user who staked but didn't vote (oppose) - again, should be able to claim, but the overview itself is correct β
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.
Thank you for your continuous efforts on this issue @adam-strzelec π
1st motion
As a user who staked and voted with Support
2nd motion
As a user who opposed the staking
3rd motion
As a user who staked and voted Support
As the user who only voted Oppose
4th motion
As a user who staked and voted Support
As a user who only voted Support
Seems good from my side, nice work! π
Description
Change appearance of action overview card info
Testing
Diffs
New stuff β¨
Display date of complete action
Changes π
Change text inside cards
Resolves #31415