Skip to content
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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

adam-strzelec
Copy link
Contributor

Description

Change appearance of action overview card info
Screenshot 2024-10-15 at 11 26 15
Screenshot 2024-10-15 at 11 26 53

Testing

  • Create action with reputation
  • Finalize action

Diffs

New stuff ✨

Display date of complete action

Changes πŸ—

Change text inside cards

Resolves #31415

@adam-strzelec adam-strzelec self-assigned this Oct 15, 2024
@adam-strzelec adam-strzelec requested review from a team as code owners October 15, 2024 09:28
@CLAassistant
Copy link

CLAassistant commented Oct 15, 2024

CLA assistant check
All committers have signed the CLA.

rdig
rdig previously approved these changes Oct 16, 2024
Copy link
Member

@rdig rdig left a comment

Choose a reason for hiding this comment

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

All good here, tested both with voting and without (just staking)

Screenshot from 2024-10-16 11-25-01
Screenshot from 2024-10-16 11-33-32
Screenshot from 2024-10-16 11-33-41

Also, a "action with reputation" is called a motion

Copy link
Collaborator

@jakubcolony jakubcolony left a 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:
image

@@ -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);
Copy link
Collaborator

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)
Copy link
Collaborator

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?

@adam-strzelec
Copy link
Contributor Author

@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."

Copy link
Collaborator

@jakubcolony jakubcolony left a 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:

image

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:
image

And that persisted even past finalization (at which point the action has been executed, so the label seems incorrect):
image

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.

@arrenv
Copy link
Member

arrenv commented Nov 6, 2024

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.

bassgeta
bassgeta previously approved these changes Nov 11, 2024
Copy link
Contributor

@bassgeta bassgeta left a comment

Choose a reason for hiding this comment

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

Nicely ironed out all the cases and it's looking crisp right now πŸ‘
A completely supported motion βœ”οΈ
image
image

A motion which went through voting βœ”οΈ
image
image

A rejected motion βœ”οΈ
image

Copy link
Contributor

@iamsamgibbs iamsamgibbs left a 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:

Screenshot 2024-11-12 at 10 38 07

User who staked: (It does show a negative reward which I don't think is correct).

Screenshot 2024-11-12 at 10 38 25 Screenshot 2024-11-12 at 10 40 22

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)

Screenshot 2024-11-12 at 10 38 33

After claiming as the other user, the claimed pill shows here.

Screenshot 2024-11-12 at 10 40 28

As a user who did not stake or vote:

Screenshot 2024-11-12 at 10 40 48

However, when a motion is rejected, the text still says it has passed:

Screenshot 2024-11-12 at 10 42 58

And when finalised the rejection:

Screenshot 2024-11-12 at 10 43 20 Screenshot 2024-11-12 at 10 43 13

There is also no claim button but the UserHub implies there should be.

Screenshot 2024-11-12 at 10 43 39

I think the claiming issues are out of scope for this, but the wording should be fixed up here for rejected motions.

@adam-strzelec
Copy link
Contributor Author

@iamsamgibbs

  • The reward for user who staked but not voted should be positive?
  • the claimed pill should be visible for everyone?
  • If oppose wins, what should be the text instead of "Action has passed and can be executed", and what instead of "Action has passed and now is complete"

@iamsamgibbs
Copy link
Contributor

iamsamgibbs commented Nov 12, 2024

@adam-strzelec we might need some clarification from @arrenv for all of these:

  1. Sorry, I didn't make it clear. That user had staked and voted. I believe their reward should be positive. (but I could be mistaken) Actually I think it might be correct that the reward is negative.

  2. I think the claim button should be visible for every who has either a stake to reclaim, or a reward to claim.

  3. I'll let Arren confirm the wording for when a motion has been rejected.

@arrenv
Copy link
Member

arrenv commented Dec 6, 2024

@adam-strzelec @iamsamgibbs

  1. It depends if the staker was on the winning or losing side of the vote. If they were on the winning side, it will be positive, if they were on the losing side it will be negative.

  2. The "Claimed" status should be visible per individual who had staked and/or received a reward. I'm pretty sure that rewards don't need to be claimed though and are transferred automatically, so, perhaps they is where the confusion is in the app. However, we should show to that recipient the same "Claimed" status pill.

  3. The copy should be "Action was opposed and cannot be executed.". Figma link
    image

iamsamgibbs
iamsamgibbs previously approved these changes Dec 12, 2024
Copy link
Contributor

@iamsamgibbs iamsamgibbs left a 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:

Screenshot 2024-12-12 at 10 25 01

Also looks good as a user who voted but did not stake:

Screenshot 2024-12-12 at 10 30 40

Screenshot 2024-12-12 at 10 31 19

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);
Copy link
Contributor

Choose a reason for hiding this comment

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

Leftover comment

bassgeta
bassgeta previously approved these changes Dec 12, 2024
Copy link
Contributor

@bassgeta bassgeta left a comment

Choose a reason for hiding this comment

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

A lot of hard work went into this, thanks for all the on the fly adjustments and following it through πŸ’―
Finalizable βœ”οΈ
image
Finalized βœ”οΈ
image
Rejected βœ”οΈ
image
After voting as user who voted βœ”οΈ
image

rdig
rdig previously approved these changes Dec 12, 2024
Copy link
Member

@rdig rdig left a 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

jakubcolony
jakubcolony previously approved these changes Dec 20, 2024
Copy link
Collaborator

@jakubcolony jakubcolony left a 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.

Passed without voting:
image
image

Passed with voting:
image
image

Failed without staking or voting:
image

Failed with opposing stake:
image

On a side note, there is a bug here (not introduced by this PR): #4004

Failed after voting:
image
image

Also a bug here, again not introduced by this PR. Added to the issue above.

Nice work! πŸ’ͺ

@adam-strzelec adam-strzelec dismissed stale reviews from jakubcolony, rdig, and bassgeta via 05b8a7c December 23, 2024 11:46
mmioana
mmioana previously approved these changes Dec 30, 2024
Copy link
Contributor

@mmioana mmioana left a 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
Screenshot 2024-12-30 at 07 59 45

The overview as a user who only voted
Screenshot 2024-12-30 at 08 00 01

After the reward was claimed
Screenshot 2024-12-30 at 08 00 21
Screenshot 2024-12-30 at 08 01 21

After fully supporting the staking step and claiming the reward
Screenshot 2024-12-30 at 07 49 16
Screenshot 2024-12-30 at 07 49 23
Screenshot 2024-12-30 at 07 49 23

After fully opposing the staking step
Screenshot 2024-12-30 at 07 48 11

After opposing the voting step
Screenshot 2024-12-30 at 08 08 49
Screenshot 2024-12-30 at 08 09 01

And after both users opposed the voting step, but only leela staked
Screenshot 2024-12-30 at 08 10 54
Screenshot 2024-12-30 at 08 10 57

Nice job! πŸ‘

Copy link
Member

@arrenv arrenv left a 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:

  1. 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.
    image

  2. I have a missing translation error showing up in the feed.
    image

  3. There is a margin bottom, this should be removed, without impacting the margin for when the button is present.
    image

  4. 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."

    image

  5. 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."

    image

  6. 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.

    image

    image

@jakubcolony
Copy link
Collaborator

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

@adam-strzelec
Copy link
Contributor Author

@arren done. I was not able to replicate the bugs from points 2 and 6. They work fine for me.
Screenshot 2025-01-21 at 21 42 47
Screenshot 2025-01-21 at 21 42 15

Copy link
Collaborator

@jakubcolony jakubcolony left a 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:
image
image

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 βœ…
image

Motion failed after objecting - there should be a claim button here, but it was broken before (#4004)
image

As a user who staked and voted (support) βœ…
image

As a user who staked and voted (oppose) - unable to claim, part of the same issue #4004:
image

As a user who didn't stake but voted (support) βœ…
image

As a user who didn't stake but voted (oppose) βœ…
image

As a user who staked but didn't vote (support) βœ…
image

As a user who staked but didn't vote (oppose) - again, should be able to claim, but the overview itself is correct βœ…

image

Copy link
Contributor

@mmioana mmioana left a 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
Screenshot 2025-01-23 at 11 04 36
Screenshot 2025-01-23 at 11 04 45
Screenshot 2025-01-23 at 11 04 54

2nd motion
As a user who opposed the staking
Screenshot 2025-01-23 at 11 06 51

3rd motion
As a user who staked and voted Support
Screenshot 2025-01-23 at 11 13 39
Screenshot 2025-01-23 at 11 13 57
Screenshot 2025-01-23 at 11 14 04
As the user who only voted Oppose
Screenshot 2025-01-23 at 11 14 43

4th motion
As a user who staked and voted Support
Screenshot 2025-01-23 at 11 32 50
As a user who only voted Support
Screenshot 2025-01-23 at 11 32 54

Seems good from my side, nice work! πŸ‘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Completed state of Agreement + Motions Finalization addition
8 participants