feat: vault headers#327
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughAdds a centralized VaultHeader component and ERC4626-derived userAssets; removes several vault-detail card components and collateral view; makes table description optional; filters out zero-balance vaults in user-vaults-table; wires deposit/withdraw through modal hooks and updates vault-view accordingly. Changes
Sequence Diagram(s)mermaid Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Fix all issues with AI agents
In `@src/features/autovault/components/vault-detail/vault-header.tsx`:
- Around line 105-112: The icon-only buttons in VaultHeader (the copy button
using LuCopy and the overflow/options icon button) lack accessible names; add
descriptive aria-label attributes to each (e.g., aria-label="Copy vault address"
on the button that calls handleCopyVaultAddress, and aria-label="Open vault
options" on the overflow/options button), or use aria-labelledby if you add
visually hidden text, ensuring the buttons remain icon-only but are announced
correctly by screen readers.
- Around line 102-105: The symbol badge is rendered even when `symbol` can be
empty; update the JSX in the vault header component (vault-header.tsx, inside
the element that renders {title} and the span with class "rounded bg-hovered
...") to render the <span> only when `symbol` is non-empty (e.g., check
Boolean(symbol) or symbol?.trim() before rendering) so empty or whitespace-only
symbols do not produce a blank pill.
In `@src/features/autovault/vault-view.tsx`:
- Around line 160-186: Create a single boolean (e.g., isAssetDataAvailable =
!!assetAddress && !!tokenSymbol && tokenDecimals !== undefined) and use it to
disable the Deposit/Withdraw buttons where they are rendered, and also guard the
handlers handleDeposit and handleWithdraw: if you keep the early return, replace
the silent return with a user-visible fallback (e.g., showToast or notification)
so clicking when disabled gives feedback; update references in the file to use
isAssetDataAvailable for button disabled props and call the toast function
inside handleDeposit/handleWithdraw before returning if data is missing.
In `@src/features/positions/components/user-vaults-table.tsx`:
- Around line 54-59: The component currently returns null when activeVaults is
empty, which hides the header/refresh button; instead, update the render logic
in user-vaults-table (e.g., UserVaultsTable) to not early-return on
activeVaults.length === 0. Keep the header and refresh control rendered
unconditionally (or when vaults.length > 0) and render an empty state
message/placeholder when vaults exist but all balances are zero (i.e.,
vaults.length > 0 && activeVaults.length === 0). Locate the activeVaults and
vaults usage and replace the early return with conditional rendering that shows
the table rows for activeVaults when present and an empty-state row/message plus
the existing refresh button when not.
🧹 Nitpick comments (1)
src/features/autovault/vault-view.tsx (1)
116-142: Consider a tiny formatter helper for balance labels.
totalAssetsLabelanduserShareBalanceLabelrepeat the same formatting logic.
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
✏️ Tip: You can customize this high-level summary in your review settings.