feat(earn/neeru): rich empty state on vault detail with rate hero + how-it-works - #303
Merged
Merged
Conversation
…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.'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
neeruCatalogueCategoryByIdSelector); falls back to monthly->annual conversion (effectiveAnnualPercentFromMonthly) when the catalogue isn't loaded yet.if (nowTs < last + 1 days) return 0inFondoCOPmMVP.sol:574)When
positions.length > 0the 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 memossrc/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 messageslocales/es-419/translation.json+locales/base/translation.json: 9 new keys underneeruVaults.detail.emptyState, oldnoPositionskey 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)