Skip to content

Conversation

@SorinC6
Copy link
Contributor

@SorinC6 SorinC6 commented Nov 28, 2025

Note

Introduces a full governance delegation flow (Yoroi/other DReps, abstain/no-confidence) with a revamped UI and integrated transaction review, plus supporting hooks, context, and i18n updates.

  • Governance UI Revamp:
    • New screens/cards for delegation: GovernanceStatusRevamp, DRepOptions, DrepOptionsCard, and NotAllowedInGovernance.
    • Supports delegating to Yoroi DRep, custom DRep, or choosing abstain/no-confidence; shows statuses, pending states, and copyable DRep IDs.
    • Adds ChooseOtherDrepId flow and integrates it into ReviewTxManager (modalView: 'chooseOtherDrepId').
  • Hooks & State:
    • useGovernanceDelegationToYoroiDrep: creates/signs delegation txs, opens review modal, handles errors (e.g., insufficient funds).
    • useGovernanceStatusState: maps backend status to GOVERNANCE_STATUS and detects pending delegation txs.
    • useIsGovernanceAllowed: checks ADA balance/participation and testnet.
  • Context & Constants:
    • GovernanceContextProvider: exposes isTestnet; fetches and normalizes on-chain governance status.
    • constants.ts: adds FIND_DREPS_LINK(_TESTNET), GOVERNANCE_STATUS enum.
  • Transaction Review:
    • New guidance/strings; ability to input custom DRep ID; quick delegate-to-Yoroi option inside modal.
  • i18n:
    • Adds/updates governance and transaction-review strings; updates en-US.json accordingly.
  • UI/Helpers:
    • YoroiLogo accepts dynamic width/height.
    • New truncateFormatter helper (TS) and export in JS formatters; used in cards.
    • Button outlined hover no longer changes background.
  • Refactors:
    • Moves governance useStrings import paths under common/hooks.

Written by Cursor Bugbot for commit eb147c5. This will update automatically on new commits. Configure here.

@SorinC6 SorinC6 marked this pull request as draft November 28, 2025 13:28
@SorinC6 SorinC6 marked this pull request as ready for review December 1, 2025 16:06
Copy link
Contributor Author

@SorinC6 SorinC6 left a comment

Choose a reason for hiding this comment

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

/check

Copy link
Contributor Author

@SorinC6 SorinC6 left a comment

Choose a reason for hiding this comment

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

/check

Copy link
Contributor Author

@SorinC6 SorinC6 left a comment

Choose a reason for hiding this comment

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

/check

Copy link
Contributor Author

@SorinC6 SorinC6 left a comment

Choose a reason for hiding this comment

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

/check

@SorinC6 SorinC6 requested review from Nebyt and loxator December 2, 2025 08:38
const isDelegatingToYoroiDrep = isDelegated && drepID === YOROI_DREP_ID;
const isDelegationToOtherDrep = isDelegated && drepID !== YOROI_DREP_ID;
const isAbstain = drepID === null || governanceStatus.status === DREP_ALWAYS_ABSTAIN;
const isNoConfidence = drepID === null || governanceStatus.status === DREP_ALWAYS_NO_CONFIDENCE;
Copy link

Choose a reason for hiding this comment

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

Bug: Null check on variable that can never be null

The isAbstain and isNoConfidence flags use drepID === null in their conditions. However, drepID is always assigned a value (falling back to YOROI_DREP_ID), so it can never be null. This prevents correctly identifying "Abstain" or "No Confidence" delegations when the DRep ID is truly null.

Fix in Cursor Fix in Web

@Nebyt Nebyt merged commit a00a4b8 into develop Dec 2, 2025
19 of 20 checks passed
@Nebyt Nebyt deleted the sorin/YOEXT-2371/gov-devegate branch December 2, 2025 16:01
@Nebyt Nebyt added this to the 5.19.0 milestone Dec 2, 2025
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.

3 participants