Fix: Add Warnings to Delegation Actions (Issue #194)#524
Open
Roaring30s wants to merge 4 commits intolivepeer:mainfrom
Open
Fix: Add Warnings to Delegation Actions (Issue #194)#524Roaring30s wants to merge 4 commits intolivepeer:mainfrom
Roaring30s wants to merge 4 commits intolivepeer:mainfrom
Conversation
|
@Roaring30s is attempting to deploy a commit to the Livepeer Foundation Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Delegation Warnings for LIP-36 Compliance
Fixes #194
Overview
This PR implements user-facing warnings for delegation actions that may result in forfeited rewards and fees, as specified in LIP-36.
Changes
Core Logic
New Hook: useDelegationReview (hooks/useDelegationReview.tsx)
delegationWarningstring (ornullif no warning needed)lastRewardRound < currentRoundreward()yet this roundreward()is called forfeits rewards/feesAction-Specific Messages:
UI Components
Updated DelegationReview Component (components/DelegationReview/index.tsx)
warnings: string[]towarning?: string | nullTooltip Integration (components/Redelegate/index.tsx, components/RedelegateFromUndelegated/index.tsx)
flexDirection: row-reverseInline Warnings (components/DelegatingView/index.tsx, components/DelegatingWidget/Footer.tsx)
Additional Improvements
Performance Optimization (components/DelegatingWidget/Footer.tsx)
useMemowrappers for simple property access (tokenBalance,transferAllowance)Mobile Layout Fixes (components/StakeTransactions/index.tsx)
This is a first-pass implementation and I'd appreciate feedback on the following:
Warning Display Strategy
Currently, warnings are displayed inline within each component that handles delegation actions. This means:
Potential Issue: On the account page, users may see the same warning component if they have both:
Questions for Reviewers:
Are you comfortable with dedicated warnings in each component?
Would you prefer alternative warning methods?
Any other UX improvements you'd suggest?
We're treating this as a first iteration and welcome any feedback to refine the user experience!
Testing
lastRewardRound < currentRoundreward()this round