-
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: Do not needlessly show the Change Vote button #4149
Conversation
7510287
to
376a186
Compare
b264bd2
to
1651332
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.
Everything seems fine, however, as I detailed below, I get stuck on the Advanced Payment release with reputation step.
Also:
Voting step
I think you're confusing this with the "Staking" step, which made your testing steps a bit hard to follow
Single voter:
Screencast.from.2025-01-24.13-44-44.mp4
Multiple voters:
Screencast from 2025-01-24 13-53-47.webm
Advanced Payment via Staking:
I am getting stuck on releasing via reputation. It might not be related to this, but I'm rejecting until we figure it out
Screencast.from.2025-01-24.13-56-42.mp4
1651332
to
a76c768
Compare
a76c768
to
44686c4
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.
Very nice! Yeah, you were right, after that rebase everything works as expected.
This was a lot of work and it seems to be working pretty well. Nicely done Romeo! 💯
Single motion:
https://github.com/user-attachments/assets/9074cee8-c836-4273-836b-75a177cd7328
Motion with multiple users:
Screencast from 2025-01-29 20-24-13.webm
Advanced payment:
https://github.com/user-attachments/assets/c4e7b6a7-e741-4cc1-956b-236ed9b8b25a
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.
Wooooow, @rumzledz , you did enormous work! ⭐
Thanks for the investigation and refactoring everything!
All test cases working great, except Advanced Payment bug that we discussed today, but it is unrelated to current PR 🙌
Voter scenario:
Change button is Not appear:
44686c4
to
52283d1
Compare
52283d1
to
118f0c4
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.
Retested after rebase and it still works as expected, nice job @rumzledz ✨
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.
Damn @rumzledz really really good stuff here, this is a huge simplification and a great refactor. Big fan of all the choices you made with subscriptions, the context and the name spacing. Stellar stuff! ⭐ 🌚
I've just left one comment with something that confused me, maybe you could address that (not a problem, just something I didn't fully understand).
Tested the flows and everything is working great too, and the original bug is of course fixed. Nice one!
Screen.Recording.2025-01-30.at.18.40.09.mov
Screen.Recording.2025-01-30.at.18.41.40.mov
Uploading Screen Recording 2025-01-30 at 18.42.10.mov…
expenditure, | ||
loadingExpenditure, | ||
startPollingForAction, | ||
stopPollingForAction, |
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.
Well, that's certainly simpler 🤣 🧹
|
||
useOnDeleteMultiSigUserSignatureSubscription({ | ||
onData: updateAction, | ||
}); |
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.
❤️ 🧹
Very clean, I like this a lot
import UninstalledMessage from '~v5/common/UninstalledMessage/index.ts'; | ||
import Stepper from '~v5/shared/Stepper/index.ts'; | ||
|
||
import { MotionStep } from './MotionStep/index.ts'; |
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.
I like this name spacing change a lot too 🐊
description: safeDescription, | ||
walletAddress, | ||
}); | ||
|
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.
Just a little confused as to why the deletions in this file were made - they seem slightly unrelated to the other changes?
Could you maybe give a brief reason why this has been removed? Thanks!
(for reference, I tested saving drafts of agreements, and they still work 👍 ⚡ )
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 so much for reviewing @davecreaser ! I removed this because I found out that it's actually redundant 😅 This code is meant for the Save as draft button for an agreement and it's not meant to be here
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.
Aha okay perfect. Thanks for the explanation!
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-approved
6fff644
118f0c4
to
6fff644
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.
Reapproving after rebase ✅
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 reviewed 🙌 Everything still working ✅
Thank you 👍
Description
It was a bit tricky to fix this because at first, I thought I could synchronise the rendering based on the loading state of the query responsible for this button. As I was debugging it, I thought that it's a perfect time to refactor the way we make UI updates for our motions.
If you think this piece of work needs to be done separately, please let me know.
Risky changes
Minimise the reliance on action query polling and prefer real-time updates
Speaking for myself, it got a bit difficult to understand when polling starts and when they end. This is even made more complex due to the mixture of query polling and refetch. I have zero doubt that everyone here can understand this pattern if you thoroughly investigate it but the whole point of these changes is to super minimise this mystical approach.
This PR introduces subscription-based updates when it comes to keeping track of action updates. You can find these subscriptions being used in the
useGetColonyAction
hook.The only 2 areas left where this polling mechanism is being used in:
Not so risky changes:
ActionContextProvider
We have this pattern where we would first retrieve the transaction hash to render our completed action component. Then we would prop drill the transaction ID down to our motion/multi-sig widgets so that we can retrieve the action again via another call to
useGetColonyActionQuery
. I thought this was redundant as we can just globally have a single source of truth for the current action we're dealing with. An exception to this rule is for Actions that are can have nested motions i.e. Advanced Payments. The MotionBox component for those are still callinguseGetColonyAction
because it is what it is!General cleanup
MotionStep and MultiSigStep
Our motions have steps that share the same name i.e. FinalizeStep. When debugging, of course it's just a matter of CMD + clicking the component or checking where it's being imported from to see which is which. But for the sake of making it easier to know which motion step you're looking at, at a glance, I have introduced namespacing.
Testing
Note
Known motion-related issues that this PR has inherited
1. Voter Scenario (Reputation)
2. Multiple Voters Scenario (Reputation)
The ANNOYING part and I'M SORRY
Resolves #3603