Skip to content

[GF-19] [FRONTEND] Notifications & Alerts (lock expiry, transaction toasts, harvest alerts) #51

@wumibals

Description

@wumibals

Overview

⚠️ Depends on: #45 (GF-13 — Deposit & Transaction Flow) and #46 (GF-14 — Portfolio & Positions Page).

Implement the notification and alert system across the app. Users need to know when transactions complete, when their lock expires, when yield is harvested, and when a governance veto window opens.

Problem

No notification system exists anywhere in the app. Specifically:

  • There are no transaction status toasts — after submitting a deposit or withdrawal, the user has no feedback
  • There are no lock expiry alerts — a user with an L12 vault has no reminder that their 12-month lock is expiring
  • There are no harvest event notifications
  • There is no alert mechanism for Guardian Multisig members when a governance proposal is open for veto

Proposed Solution

1. Transaction status toasts (all pages)
Use a lightweight toast library (e.g. sonner or react-hot-toast). Show a toast for every transaction:

  • Submitting... — amber, with a spinner, while awaiting Soroban confirmation
  • Transaction confirmed — green, with a checkmark, on success (include a link to Stellar Expert)
  • Transaction failed: <reason> — red, on failure (show the Soroban error message)

Trigger these from the transaction hooks used in GF-13 and GF-14.

2. Lock expiry browser push notifications (opt-in)
On the /portfolio page, add an Enable notifications toggle. When enabled:

  • Request browser Notification permission
  • Store the lock expiry ledger for each position in localStorage
  • On each page load, check if any lock expires within 7 days
  • If so, show a browser push notification: Your L6 vault unlocks in 5 days. Visit YieldLadder to withdraw.

3. Harvest event notification
After each successful harvest (detected via polling useLastHarvest() or an event), show a toast: Yield harvested — your position has been compounded.

4. Governance proposal alert (Guardian members)
On /governance (GF-16), detect if the connected wallet address matches the Guardian Multisig. If a new proposal enters Pending status, show a persistent amber banner: New governance proposal open for veto — expires in 71 hours.

5. IL threshold alert on /allocations
If any pool's impermanent loss (from GF-16's IL tracker) exceeds 2%, show an amber alert card at the top of the /allocations page: USDC/XLM pool IL at 2.4% — approaching rebalance threshold.

Acceptance Criteria

  • Transaction toasts appear for every deposit, withdrawal, early exit, and harvest action
  • Toast shows Submitting... immediately and updates to confirmed/failed on completion
  • Confirmed toast includes a clickable Stellar Expert link for the transaction
  • Lock expiry notification permission is requested only when the user opts in
  • Push notification fires within one page load of the lock being within 7 days of expiry
  • Harvest event notification appears after a new harvest is detected
  • Governance proposal alert appears for Guardian address with correct veto deadline
  • IL threshold alert appears on /allocations when any pool exceeds 2% IL

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions