Skip to content

feat: add warnings to delegation actions#613

Open
ECWireless wants to merge 3 commits intomainfrom
feat/add-warnings-to-delegation-actions
Open

feat: add warnings to delegation actions#613
ECWireless wants to merge 3 commits intomainfrom
feat/add-warnings-to-delegation-actions

Conversation

@ECWireless
Copy link
Copy Markdown
Collaborator

See #524 for all details. Original PR created by @Roaring30s .

Roaring30s and others added 2 commits March 31, 2026 07:48
* feat: add useDelegationReview hook

* feat: add delegation warnings

---------

Co-authored-by: ECWireless <40322776+ECWireless@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 31, 2026 14:01
@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Mar 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
explorer-arbitrum-one Ready Ready Preview, Comment Apr 1, 2026 9:43pm

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds user-facing LIP-36 warnings around delegation actions (delegate/undelegate/move stake/rebond/withdraw fees) to help users avoid forfeiting rewards/fees when acting before an orchestrator calls reward() in the current round.

Changes:

  • Extend the account GraphQL query/types to include lastRewardRound on relevant transcoders/delegates.
  • Introduce useDelegationReview (and getDelegationWarning) to centralize warning logic, plus a DelegationReview UI component for inline alerts.
  • Integrate warning display into delegation/redelegate/withdraw flows (inline alerts + tooltip icons) and adjust StakeTransactions layout.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
queries/account.graphql Fetches lastRewardRound for delegator delegate + unbonding lock delegate to support warning logic.
apollo/subgraph.ts Updates generated AccountQuery types/document to include lastRewardRound.
hooks/useDelegationReview.tsx Adds centralized warning logic based on lastRewardRound vs currentRound.
hooks/useDelegationReview.test.ts Adds initial unit tests for the warning logic (rebond-from-unbonded path).
hooks/index.tsx Re-exports useDelegationReview from the hooks barrel.
components/DelegationReview/index.tsx New inline warning UI (yellow alert styling).
components/DelegatingWidget/Footer.tsx Shows inline warnings for delegate/undelegate/move stake flows.
components/DelegatingView/index.tsx Shows inline warning on “Withdraw Pending Fees” action.
components/Redelegate/index.tsx Adds warning icon tooltip next to “Redelegate” action.
components/RedelegateFromUndelegated/index.tsx Adds warning icon tooltip and wires target orchestrator context for rebond-from-unbonded.
components/StakeTransactions/index.tsx Passes delegator/currentRound into redelegation components and adjusts alignment for responsiveness.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

3 participants