Skip to content

Conversation

@gomesalexandre
Copy link
Contributor

@gomesalexandre gomesalexandre commented Jan 27, 2026

Description

Enable /yields route and make yield a first-class route on mobile.

  • Replace History tab in mobile bottom nav with Earn tab (routes to /yields)
  • Add History icon button to mobile header (after search and QR icons)
  • Enable yield feature flags by default (VITE_FEATURE_YIELD_XYZ, VITE_FEATURE_YIELDS_PAGE, VITE_FEATURE_YIELD_MULTI_ACCOUNT)

Issue (if applicable)

N/A

Risk

Low - UI changes only, no transaction logic affected.

What protocols, transaction types, wallets or contract interactions might be affected by this PR?

None - this is purely navigation/discoverability improvements.

Testing

Engineering

  1. Open the app on mobile viewport (or actual mobile device)
  2. Verify the bottom nav shows "Earn" instead of "History"
  3. Tap "Earn" tab and verify it navigates to /yields
  4. Verify the History icon appears in the top header (rightmost icon after search and QR)
  5. Tap History icon and verify it navigates to /history
  6. Verify yield feature flags are enabled by default

Operations

  • Verify mobile navigation changes work correctly
  • Verify yield pages are accessible and functional

Screenshots (if applicable)

image

Summary by CodeRabbit

  • New Features
    • Users can now access yields management features directly from navigation with a dedicated yields section.
    • Multi-account yield management capabilities are now available.
    • Mobile users now have convenient access to transaction history through a new history button in the mobile navigation header.

✏️ Tip: You can customize this high-level summary in your review settings.

gomesalexandre and others added 13 commits January 26, 2026 12:34
…letes

After completing a yield enter transaction and navigating away (e.g., clicking
"View position"), the user could previously go back to /earn/confirm which
shouldn't be accessible anymore.

Fixes:
1. Reorder guards - check for success state BEFORE checking for selectedYield,
   ensuring the success screen renders even if Redux state becomes undefined
2. Clear tradeEarnInput Redux state on unmount when in success state, preventing
   re-access via browser back button or navigation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Links were navigating to /yields/${yieldId} which resulted in 404s.
The correct route is /yield/${yieldId} (singular).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Moved success buttons from YieldSuccess body content to footerContent
prop in EarnConfirm, matching the pattern used by input/confirm steps.

Added showButtons prop to YieldSuccess for backwards compatibility.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When fiat amount is zero, return empty string instead of '0.00' to
trigger placeholder styling (greyed out) matching crypto mode behavior.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
For yields with a default validator (Cosmos ATOM, Solana SOL native staking),
filter out positions from other validators in useAllYieldBalances query.

This ensures only ShapeShift DAO positions show for Cosmos and only Figment
positions show for Solana, hiding positions staked externally with other
validators.

Removed redundant validator-specific filtering from YieldsList.tsx since
filtering now happens at the data layer.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Liquid staking yields (like ETH Lido) were missing the Provider row
because they are classified as staking but have no validators. The
condition now shows the provider when there's no validator metadata.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Document that PRs opened via CLI tools should always use the
PULL_REQUEST_TEMPLATE.md as the base for the PR body.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Shows a loading spinner with tooltip when legacy positions are still
loading, allowing the yield table to render immediately with yield.xyz data.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adds getBestActionableYield utility that filters out disabled yields
(enter disabled, under maintenance, deprecated) before selecting the
highest APY option. Prevents showing CTAs for opportunities users can't act on.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When DeFiEarn is rendered outside a YieldAccountProvider (like in the
wallet drawer), the default accountNumber: 0 was incorrectly filtering
to only Account #0's balances. Now falls through to enabledWalletAccountIds
when no context is present, properly aggregating balances across all accounts.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Wrap DeFiEarn in memo to prevent unnecessary re-renders
- Remove empty useEffect in YieldForm
- Consolidate isStakingYieldType utility (remove redundant wrapper)
- Extract CryptoAmountInput to shared component
- Extract useYieldDisplayInfo hook from YieldsList
- Move static searchIcon outside component
- Fix highestAmountUsdValidator computed after validator filtering
- Remove YIELD_IMPROVEMENTS.md dev notes file

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace History tab in mobile nav with Earn tab routing to /yields
- Add History icon button to mobile header (after search and QR icons)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Enable VITE_FEATURE_YIELD_XYZ, VITE_FEATURE_YIELDS_PAGE, VITE_FEATURE_YIELD_MULTI_ACCOUNT in .env
- Remove redundant overrides from .env.development and .env.production

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 27, 2026

📝 Walkthrough

Walkthrough

Environment feature flags for yield functionality are enabled in .env and consolidated. Yield-related feature flags are removed from .env.development and .env.production files. A new /yields/* route is added to the public route declarations and gated by feature flags. A history navigation button is added to the mobile user header component.

Changes

Cohort / File(s) Summary
Environment Configuration
.env, .env.development, .env.production
Three yield feature flags (VITE_FEATURE_YIELD_XYZ, VITE_FEATURE_YIELDS_PAGE, VITE_FEATURE_YIELD_MULTI_ACCOUNT) are enabled in .env. The same flags are removed from .env.development and two flags from .env.production, consolidating configuration management.
Route Configuration
src/Routes/RoutesCommon.tsx
New yields route added at /yields/* with TbTrendingUp icon, gated by VITE_FEATURE_YIELD_XYZ and VITE_FEATURE_YIELDS_PAGE feature flags. History route updated to use explicit hide: true instead of mobileNav/hideDesktop properties. TbTrendingUp icon imported from react-icons/tb.
Mobile Navigation
src/pages/Dashboard/components/DashboardHeader/MobileUserHeader.tsx
History button added to mobile header with TimeIcon, wired to navigate to /history with haptic feedback via device vibration.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Possibly related PRs

  • feat: partial yield.xyz toggle #11704: Modifies yield feature flags and adds a gated /yield/:yieldId/* route alongside the main route addition, providing complementary yield routing functionality.
  • fix: yields polish one #11742: Implements modifications to Yields page and components that align with the feature flag enablement and route exposure in this change.

Poem

🐰 Yields now sprout from flags so bright,
Routes bloom in mobile light,
History hops a button's way,
Navigation leads the day! 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately reflects the main objective: enabling the /yields route and making it a first-class feature on mobile by updating routes, feature flags, and mobile navigation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat_yield_full_toggle_2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

gomesalexandre and others added 3 commits January 26, 2026 14:53
Match the icon used in desktop Yields menu.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The history page was removed when replacing the mobile nav tab.
Add it back as a hidden route so it remains accessible via URL.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Match the exact icon used in desktop Earn -> Yields menu.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@gomesalexandre gomesalexandre marked this pull request as ready for review January 27, 2026 01:12
@gomesalexandre gomesalexandre requested a review from a team as a code owner January 27, 2026 01:12
Base automatically changed from feat_yield_full_toggle_1 to develop January 27, 2026 22:34
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @.env:
- Around line 310-314: Reorder the yield-related env vars so dotenv-linter
ordering passes by moving VITE_FEATURE_YIELD_XYZ to appear after the other yield
entries; specifically update the block containing VITE_FEATURE_YIELDS_PAGE,
VITE_YIELD_XYZ_API_KEY, and VITE_FEATURE_YIELD_MULTI_ACCOUNT so that
VITE_FEATURE_YIELD_XYZ comes after them (preserve existing values and
formatting).

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.

2 participants