Skip to content

Fix vault chain selection#1123

Merged
rossgalloway merged 1 commit intomainfrom
fix-vaults-chain-selection
Mar 19, 2026
Merged

Fix vault chain selection#1123
rossgalloway merged 1 commit intomainfrom
fix-vaults-chain-selection

Conversation

@rossgalloway
Copy link
Collaborator

Problem

On the main vaults page, selecting a single chain could still show vaults from other chains.

This happened because the V2 and V3 vault filters skipped chain filtering for holdings, so connected-wallet positions on other chains leaked into the list. The page also had two different chain-selection behaviors: the top chain selector behaved like a single-select control, while row-level chain chips could build mixed selections. That mismatch could leave the page feeling stuck in a repeated updating state while switching chains.

Fix

  • apply selected-chain matching uniformly in the V2 and V3 vault filters, including holdings
  • extract a shared single-chain selection helper
  • use that helper for both the top chain selector and row-level chain chips so chain switching follows one rule everywhere
  • add focused tests for selected-chain matching and single-chain selection behavior

How To Review

  1. Open the main vaults page with a wallet that has holdings on multiple chains.
  2. Select a single chain from the top selector and confirm the list only shows vaults from that chain.
  3. Click a row-level chain chip and confirm it switches directly to that chain rather than accumulating mixed chain selections.
  4. Click the same active chain again and confirm it clears back to All Chains.
  5. Spot-check both V2 and V3 views.

Testing

  • bunx vitest run src/components/shared/hooks/useVaultFilterUtils.test.ts src/components/pages/vaults/utils/chainSelection.test.ts
  • bun run tslint
  • bun run lint:fix

Keep the vault list aligned with the selected chain filter and\nmake chain switching behave consistently across the page.\n\n- apply selected-chain filtering to holdings in both V2 and V3\n  vault filters so other-chain rows do not leak into the list\n- reuse a single-chain selection helper for the top selector and\n  row chips so switching chains cannot drift into mixed states\n- add focused tests for selected-chain matching and single-chain\n  selection behavior
@vercel
Copy link

vercel bot commented Mar 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
yearnfi Ready Ready Preview, Comment Mar 18, 2026 9:07pm

Request Review

@github-actions
Copy link

github-actions bot commented Mar 18, 2026

Dependency Review

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

Scanned Files

None

Copy link
Collaborator

@0xeye 0xeye left a comment

Choose a reason for hiding this comment

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

LGTM

@rossgalloway rossgalloway merged commit 75ffa73 into main Mar 19, 2026
15 checks passed
@rossgalloway rossgalloway deleted the fix-vaults-chain-selection branch March 19, 2026 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants