Skip to content

feat(earn/neeru): rich empty state on vault detail with rate hero + how-it-works - #303

Merged
TuCopFi merged 4 commits into
Developmentfrom
feat/neeru-vault-detail-empty-state
Aug 1, 2026
Merged

feat(earn/neeru): rich empty state on vault detail with rate hero + how-it-works#303
TuCopFi merged 4 commits into
Developmentfrom
feat/neeru-vault-detail-empty-state

Conversation

@TuCopFi

@TuCopFi TuCopFi commented Aug 1, 2026

Copy link
Copy Markdown
Member

Summary

The Neeru vault detail screen's empty state ("Tus depositos Flexible" when the user has no positions yet) was a one-liner "Todavia no tienes depositos en esta opcion" below a "Total en Flexible: 0.00 Pesos" row. User feedback: reads as if the page were broken and gives zero context on what would happen if they tap "Depositar".

Change

Replaces the empty layout with a single card that leads the user:

  1. Rate hero in accent color: "XX.XX% al ano" with "Equivale a XX.XX% al mes" subtitle. Source of truth is the backend catalogue (neeruCatalogueCategoryByIdSelector); falls back to monthly->annual conversion (effectiveAnnualPercentFromMonthly) when the catalogue isn't loaded yet.
  2. Como funciona numbered steps:
    • Depositas tus Pesos desde tu wallet
    • Empieza a generar intereses 24 horas despues del deposito (matches the on-chain guard if (nowTs < last + 1 days) return 0 in FondoCOPmMVP.sol:574)
    • Withdraw step branches on tranche: Flexible = withdraw whenever without fee. Fixed (30/60/90d) = withdraw at maturity or early with a fee on the interest.
  3. Trust note: money stays in the wallet, contract runs on Celo. Plain language, no addresses (respects the Neeru zero-exposure policy memory).

When positions.length > 0 the layout is unchanged: aggregate balance + positions list. The redundant "Total: 0.00 Pesos" row is suppressed only on the empty state (it adds noise when the answer is "you have zero").

Files

  • src/earn/neeru/NeeruVaultDetailScreen.tsx: empty-state JSX + styles + rate memos
  • src/earn/neeru/__tests__/NeeruVaultDetailScreen.test.tsx: updated existing "shows empty state" test to assert the rich card, correct withdraw step (mock pool is category 1 = fixed), and suppression of legacy sparse messages
  • locales/es-419/translation.json + locales/base/translation.json: 9 new keys under neeruVaults.detail.emptyState, old noPositions key removed (no callers)

Test plan

  • yarn build:ts (0 errors)
  • yarn lint src/earn/neeru/NeeruVaultDetailScreen.tsx (0 errors)
  • yarn test --testPathPattern="src/earn/neeru/__tests__" (113/113 pass, 7 skipped as before)
  • Visual smoke on emulator: open Earn -> tap any pool (Flexible + a fixed one to see both step 3 variants) -> confirm empty state renders the new card. Then optionally deposit a small amount and reopen to confirm the layout switches to aggregate + positions list.

TuCopFi added 4 commits July 31, 2026 22:07
…ow-it-works

The old empty state was a one-liner 'Todavia no tienes depositos en esta
opcion' below a 'Total en Flexible: 0.00 Pesos' row. It read as if the
page were broken and gave the user zero context on what would happen if
they tapped Depositar. Replaces the empty state (positions.length === 0)
with a single card that:

- Leads with the estimated annual rate (E.A.) in accent color as the
  headline, with the monthly equivalent (M.V.) as subtitle. Source of
  truth is the backend catalogue via neeruCatalogueCategoryByIdSelector
  when loaded, with a monthly->annual conversion fallback so cold boot
  still surfaces a sensible number.
- Numbered 'Como funciona' with 3 steps: deposit, 24h grace before
  interest starts (matches the on-chain guard in FondoCOPmMVP.sol:574),
  withdraw. Step 3 branches on tranche: Flexible = withdraw anytime;
  Fixed (30/60/90d) = withdraw at maturity or early with fee.
- Trust footer noting the money stays in the wallet and the contract
  runs on Celo (short, plain-language, no addresses).

When positions.length > 0 the layout is unchanged: aggregate balance +
positions list. The redundant 'Total: 0.00 Pesos' line is suppressed on
the empty state (it just added noise when the answer is 'you have zero').

Translations added under neeruVaults.detail.emptyState in es-419 and
base. The obsolete neeruVaults.detail.noPositions key is removed
(no callers remain). Test updated to assert the rich card renders,
withdraw step matches the tranche (fixed for the mock pool which is
category 1), and the legacy sparse messages are suppressed.
…wallet

Previous text claimed 'Tu dinero se queda en tu wallet, sin intermediarios'.
Not true: on deposit the tokens are transferred into the Neeru vault
contract; the user gets accounting rights (positionId, later a withdraw
transaction) but the tokens themselves leave the wallet. Saying otherwise
misleads the user about custody.

New copy keeps the two things that ARE true and matter to the user:

- No banks / no intermediary company holds the money.
- Only the user's wallet can withdraw (contract is address-scoped).

ES: 'Sin bancos ni empresas de por medio. Tu deposito va a Neeru, un
contrato publico en la red Celo, y solo tu puedes retirarlo.'
EN: 'No banks or middlemen. Your deposit goes to Neeru, a public contract
on the Celo network, and only you can withdraw it.'
Previous commit accidentally included a local versionName 1.118.7 -> 1.118.8
change that was only there to bypass the Statsig minRequiredVersion floor
while smoke-testing the empty state on the AVD. Not intended for the PR:
the proper version bump happens on the release/1.118.9 branch via
'yarn pre-deploy' per .claude/rules/release-procedure.md.
Previous copy leaked 'contrato publico en la red Celo' / 'a public
contract on the Celo network' into user-facing text. Violates the
long-standing wallet policy of not surfacing onchain concepts to the
user (see feedback_no_onchain_detail_in_user_ui_tucop memory: no
addresses, no source links, no SHA pins, no 'contract' or 'blockchain'
mentions in copy).

Simplified to keep only the two claims that are true AND user-relevant,
without any onchain vocabulary:

ES: 'Sin bancos ni empresas de por medio. Solo tu controlas tu deposito.'
EN: 'No banks or middlemen. Only you control your deposit.'
@TuCopFi
TuCopFi merged commit 4c0dc18 into Development Aug 1, 2026
10 checks passed
@TuCopFi
TuCopFi deleted the feat/neeru-vault-detail-empty-state branch August 1, 2026 03:59
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.

1 participant