Skip to content

DAO-2231: Add Redeem Shares action to BTC Vault page#2108

Merged
Freshenext merged 3 commits intomainfrom
dao-2231
Apr 16, 2026
Merged

DAO-2231: Add Redeem Shares action to BTC Vault page#2108
Freshenext merged 3 commits intomainfrom
dao-2231

Conversation

@TravellerOnTheRun
Copy link
Copy Markdown
Contributor

Why this change

BTC Vault users who hold vault shares can already start a withdrawal (redeem) from the actions area at the bottom of the page. Product asked for the same capability in context: a Redeem Shares control next to Wallet in MY METRICS, so people see the action where they scan balances, not only when they scroll to the bottom.

This PR adds that CTA and wires it to the same redeem path as the existing Withdraw control (modal, allowance, contract action, refetch), so behavior and edge cases stay aligned.

What problem it solves

  • Discoverability: Redeem is visible beside the Wallet metric when the user has shares.
  • Consistency: One mental model for “how do I get my rBTC out?” — both entry points open the same flow.
  • Maintenance: Withdraw logic is not copied; both places share one hook so tooltips, disabled states, and post-tx refetch do not drift.

Behavior (acceptance criteria, plain language)

  1. Redeem Shares appears under the Wallet row in MY METRICS when the user has vault shares (from the same eligibility snapshot as the rest of the vault UI).
  2. Tap / click opens the same withdrawal modal and transaction flow as Withdraw.
  3. If the user has no shares, the CTA is not shown.
  4. If the user has shares but cannot withdraw right now (e.g. active request, pause), the CTA follows the same pattern as bottom Withdraw: disabled with a tooltip explaining why, where applicable.
  5. After a successful redeem request, the UI refetches so metrics and request lists can update (same delayed refetch pattern as the existing withdraw handler, using the shared backend index delay constant where applicable).

Design / UX notes

  • No separate Figma for Redeem; styling matches the Claim Shares primary button in MY METRICS (full-width metric column, primary variant).
  • Claim Shares and Redeem Shares stay separate components: they look similar but claim vs redeem are different domains (deposit claim vs withdraw modal flow), so merging them would create a brittle “mode” switch.

Dependency note

This work is intended to sit on top of the BTC Vault claim shares dashboard layout (DAO-2230): same MY METRICS row structure (metric column + CTA below). If you are reviewing from main before 2230 lands, rebase or merge order may affect the dashboard diff.

How to review (suggested)

  • Confirm Wallet column: BalanceInfo then Redeem Shares; compare to Vault shares + Claim column.
  • Confirm Redeem and Withdraw both use the shared withdraw hook and a single modal instance (no double modals).
  • Skim eligibility: hasVaultShares is derived with the same multicall-backed eligibility as other vault actions, avoiding a second “balance” source for visibility.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 14, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 9945c9b.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

Scanned Files

None

@TravellerOnTheRun TravellerOnTheRun added dao PRs made by DAO team do not merge labels Apr 14, 2026
@TravellerOnTheRun TravellerOnTheRun requested a review from a team April 14, 2026 10:58
@TravellerOnTheRun TravellerOnTheRun changed the base branch from main to dao-2230-claim-shares-part-2 April 14, 2026 10:59
@TravellerOnTheRun TravellerOnTheRun self-assigned this Apr 14, 2026
@Freshenext Freshenext force-pushed the dao-2230-claim-shares-part-2 branch from 6bf2eca to 839bc74 Compare April 14, 2026 17:27
Base automatically changed from dao-2230-claim-shares-part-2 to main April 14, 2026 17:30
DAO-2231 Phases 1-4.

- Add hasVaultShares to ActionEligibility from mapper snapshot
- useBtcVaultWithdrawFlow for modal, allowance, redeem; backend delay on success
- Dashboard wires eligibility + flow once; Actions take withdraw props
- Redeem Shares under Wallet; loading gate; sync busy state with actions row
DAO-2231 Phase 3.

- Spy refetchActiveRequests from useActiveRequests mock
- BtcVaultDashboard mock records props; expect onRequestSubmitted and onAfterClaimRefetch to match refetch
- Add hasVaultShares to ActionEligibility mocks for consistency
Wire dashboard Redeem Shares to claimableRedeemNative via useClaimRequest
and btcVaultClaim, matching transaction history and detail claim flow.
Expose claimableWithdrawRequest from useActiveRequests; keep new withdraw
requests on the Withdraw action.
@Freshenext Freshenext merged commit 15202ad into main Apr 16, 2026
6 checks passed
@Freshenext Freshenext deleted the dao-2231 branch April 16, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dao PRs made by DAO team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants