Skip to content

refactor: buttons#233

Merged
antoncoding merged 11 commits intomasterfrom
opt/components
Dec 9, 2025
Merged

refactor: buttons#233
antoncoding merged 11 commits intomasterfrom
opt/components

Conversation

@antoncoding
Copy link
Copy Markdown
Owner

@antoncoding antoncoding commented Dec 9, 2025

Summary by CodeRabbit

  • UI/UX Improvements

    • Unified button appearance and interaction across the app (new variant names, consistent disabled/loading behavior and click handling).
    • Added tooltip wrapping for refresh controls and refined spacing/layouts in tables, modals, and detail pages.
  • Chores

    • Removed legacy config and cleaned up dependency entries.
    • Consolidated UI component usage and updated docs to reflect the new button patterns.

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

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Dec 9, 2025

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

Project Deployment Preview Comments Updated (UTC)
monarch Ready Ready Preview Comment Dec 9, 2025 3:48pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Dec 9, 2025

📝 Walkthrough

Walkthrough

Refactors Button usage project-wide: removed the old common Button, introduced a new UI Button at src/components/ui/button.tsx, and migrated call sites to the new import and API (prop renames: onPressonClick, isDisableddisabled; variant name mappings like ctaprimary).

Changes

Cohort / File(s) Summary
Button core
src/components/common/Button.tsx, src/components/ui/button.tsx, src/components/common/index.ts
Removed old src/components/common/Button.tsx and its re-export from the common barrel; added/expanded src/components/ui/button.tsx with new props (radius, fullWidth, isLoading), updated variants and compoundVariants.
App pages & components
app/HomePage.tsx, app/admin/stats/page.tsx, app/error.tsx, app/global-error.tsx, app/tools/page.tsx, app/settings/page.tsx, app/markets/components/markets.tsx, app/markets/components/MarketSettingsModal.tsx, app/markets/components/MarketActionsDropdown.tsx, app/markets/components/BlacklistConfirmationModal.tsx, app/history/components/HistoryTable.tsx, app/market/.../content.tsx, app/market/.../components/*, app/autovault/**, app/positions/**, app/rewards/**
Updated imports to @/components/ui/button and migrated call sites: onPressonClick, isDisableddisabled, variant mappings (e.g., ctaprimary, interactivesurface, secondarydefault); some refresh controls wrapped with Tooltips and minor layout tweaks.
Src components & modals
src/components/*, src/components/common/*, src/components/layout/*, src/components/settings/*
Replaced Button import targets and updated all call-site props/variants accordingly; removed export * from './Button' from src/components/common/index.ts; adjusted Checkbox usages where noted (isDisableddisabled).
UI small edits & layout
app/markets/components/MarketRowDetail.tsx, src/components/Info/info.tsx, app/history/components/HistoryTable.tsx
Layout refinements (MarketRowDetail), improved Info text wrapping and conditional title, Chip variant tweak in HistoryTable.
Docs & config
docs/Styling.md, tailwind.config.ts.deprecated, .claude/settings.local.json, .prettierignore, package.json
Documentation updated to reflect new Button API/imports and variant taxonomy; removed deprecated Tailwind config file; added a Bash allow entry in .claude/settings.local.json; removed three patterns from .prettierignore; package.json dependency edits.
Minor logic change
app/rewards/components/RewardContent.tsx
showLegacy condition made explicit: morphoBalanceLegacy !== undefined && morphoBalanceLegacy !== 0n.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

  • Focus review on:
    • src/components/ui/button.tsx (compoundVariants, isLoading behavior, prop forwarding).
    • Broken imports/re-exports after removal of src/components/common/Button.tsx (barrel usage).
    • A sample of migrated call sites to ensure event wiring and disabled semantics behave as expected.

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 4.35% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'refactor: buttons' directly matches the main change: a comprehensive refactor of button components throughout the codebase, including import paths, props, variants, and event handlers.
✨ 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 opt/components

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.

Copy link
Copy Markdown

@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: 9

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/components/Borrow/WithdrawCollateralAndRepay.tsx (1)

220-226: Fix BigInt comparisons in LTV progress bar

withdrawAmount and repayAssets are bigint, but they’re compared to 0 (a number), which will throw at runtime and/or fail TS type-checking. Use 0n consistently:

-                className={`h-2 rounded-full transition-all duration-500 ease-in-out ${getLTVProgressColor(
-                  withdrawAmount > 0 || repayAssets > 0 ? newLTV : currentLTV,
-                  lltv,
-                )}`}
+                className={`h-2 rounded-full transition-all duration-500 ease-in-out ${getLTVProgressColor(
+                  withdrawAmount > 0n || repayAssets > 0n ? newLTV : currentLTV,
+                  lltv,
+                )}`}
...
-                  width: `${Math.min(100, (Number(withdrawAmount > 0 || repayAssets > 0 ? newLTV : currentLTV) / Number(lltv)) * 100)}%`,
+                  width: `${Math.min(
+                    100,
+                    (Number(withdrawAmount > 0n || repayAssets > 0n ? newLTV : currentLTV) / Number(lltv)) * 100,
+                  )}%`,
app/autovault/[chainId]/[vaultAddress]/components/settings/GeneralTab.tsx (1)

88-136: HeroUI Input props are invalid (variant="ghost" and disabled)

The @heroui/react Input component (v2.4.2) does not support variant="ghost" or the disabled prop. The documented variants are flat | bordered | faded | underlined, and the correct prop is isDisabled (boolean).

There are no custom type augmentations in this repository that would make these props valid.

Fix both Input instances to use:

-          <Input
-            variant="ghost"
+          <Input
+            variant="flat"
-            disabled={!isOwner}
+            isDisabled={!isOwner}

and similarly for the symbol field.

🧹 Nitpick comments (10)
app/markets/components/MarketRowDetail.tsx (1)

12-44: Responsive layout looks good.

The three-panel flex layout with consistent lg:w-1/3 widths is clean. One minor note: with lg:gap-6, each panel will be slightly less than 1/3 width since gaps consume space. If precise widths matter, CSS Grid with grid-cols-3 would maintain exact thirds.

app/autovault/components/VaultListV2.tsx (1)

134-139: Button variant change is fine; consider aligning import with new Button API

Using variant="surface" for the Manage button looks fine; if the broader refactor is standardizing on @/components/ui/button, consider switching this file off @/components/common for consistency.

app/autovault/components/deployment/DeploymentModal.tsx (1)

107-119: Deploy button wiring matches new Button API

Variant, onClick, and disabled conditions all look consistent with the previous behavior; if you want to make the handler a bit clearer, you could write onClick={needSwitchChain ? switchToNetwork : () => { void createVault(); }} instead.

app/rewards/components/RewardTable.tsx (1)

9-10: Reward action buttons correctly migrated and guarded

The switch to @/components/ui/button with variant="surface" plus disabled checks on zero-claimable and missing distribution look correct; the existing async claim flow (network switch + sendTransaction) remains intact, though you could optionally extract that handler out of JSX later for readability.

Also applies to: 188-238

app/positions/components/PositionsSummaryTable.tsx (1)

420-435: Redundant owner check.

The onClick guard (lines 425-428) is unreachable when disabled={!isOwner} prevents the click. Either remove the inline check or remove disabled if you want to show the toast.

                        <Button
                          size="sm"
                          variant="surface"
                          className="text-xs"
                          onClick={() => {
-                           if (!isOwner) {
-                             toast.error('No authorization', 'You can only rebalance your own positions');
-                             return;
-                           }
                            setSelectedGroupedPosition(groupedPosition);
                            setShowRebalanceModal(true);
                          }}
                          disabled={!isOwner}
                        >
src/components/SupplyModalContent.tsx (1)

14-14: Import order is inconsistent.

The Button import is placed after the component-level imports. Consider grouping it with other @/ imports (lines 5-13).

 import { formatBalance } from '@/utils/balance';
 import { getNativeTokenSymbol } from '@/utils/networks';
 import { isWrappedNativeToken } from '@/utils/tokens';
 import type { Market } from '@/utils/types';
+import { Button } from '@/components/ui/button';
 import { SupplyProcessModal } from './SupplyProcessModal';
-import { Button } from '@/components/ui/button';
src/components/ui/button.tsx (1)

27-28: Duplicate size definitions.

md and default have identical styles. Consider removing one to avoid confusion.

        sm: 'h-8 px-1.5 py-1 text-xs min-w-[64px]',
-       md: 'h-10 px-4 py-2 text-sm min-w-[80px]',
        default: 'h-10 px-4 py-2 text-sm min-w-[80px]',
+       md: 'h-10 px-4 py-2 text-sm min-w-[80px]', // alias for default
        lg: 'h-12 px-6 py-3 text-base min-w-[96px]',

Or just use md everywhere and drop default.

app/autovault/[chainId]/[vaultAddress]/components/VaultInitializationModal.tsx (1)

6-365: Standardize Button import to @/components/ui/button

The step CTAs and Back/Skip/Complete buttons now use onClick/disabled correctly and keep the previous flow. To stay consistent with the rest of this PR, consider switching the import to the new UI Button module:

-import { Button } from '@/components/common';
+import { Button } from '@/components/ui/button';
app/positions/components/onboarding/AssetSelection.tsx (1)

6-6: Align Button props with the new Button API

Everywhere else the new Button uses variant, but this usage still passes color="primary". To avoid relying on a possibly unused prop and to stay consistent:

-          <Link href="/markets">
-            <Button
-              color="primary"
-              className="rounded"
-            >
+          <Link href="/markets">
+            <Button
+              variant="primary"
+              className="rounded"
+            >

Also applies to: 99-104

app/markets/components/markets.tsx (1)

580-591: Icon toolbar Buttons look good; add an aria-label for Refresh

The switch to variant="ghost" / size="icon" with span-wrapped Buttons under Tooltip is clean and consistent. For accessibility, consider labeling the Refresh button like the others:

-              <span>
-                <Button
-                  disabled={loading || isRefetching}
-                  variant="ghost"
-                  size="icon"
-                  className="text-secondary"
-                  onClick={handleRefresh}
-                >
+              <span>
+                <Button
+                  disabled={loading || isRefetching}
+                  variant="ghost"
+                  size="icon"
+                  className="text-secondary"
+                  aria-label="Refresh"
+                  onClick={handleRefresh}
+                >
                   <ReloadIcon className={isRefetching ? 'animate-spin' : ''} />
                 </Button>
               </span>

Also applies to: 612-623, 638-648

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cc5f9c0 and 567cbf3.

⛔ Files ignored due to path filters (2)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • src/fonts/KodeMono/KodeMono-VariableFont_wght.ttf is excluded by !**/*.ttf
📒 Files selected for processing (63)
  • .claude/settings.local.json (1 hunks)
  • .prettierignore (0 hunks)
  • app/HomePage.tsx (10 hunks)
  • app/admin/stats/page.tsx (5 hunks)
  • app/autovault/[chainId]/[vaultAddress]/components/DepositToVaultModal.tsx (2 hunks)
  • app/autovault/[chainId]/[vaultAddress]/components/VaultInitializationModal.tsx (5 hunks)
  • app/autovault/[chainId]/[vaultAddress]/components/settings/AgentsTab.tsx (5 hunks)
  • app/autovault/[chainId]/[vaultAddress]/components/settings/CurrentCaps.tsx (2 hunks)
  • app/autovault/[chainId]/[vaultAddress]/components/settings/EditCaps.tsx (3 hunks)
  • app/autovault/[chainId]/[vaultAddress]/components/settings/GeneralTab.tsx (4 hunks)
  • app/autovault/[chainId]/[vaultAddress]/content.tsx (6 hunks)
  • app/autovault/components/AutovaultContent.tsx (2 hunks)
  • app/autovault/components/VaultListV2.tsx (1 hunks)
  • app/autovault/components/deployment/DeploymentModal.tsx (1 hunks)
  • app/error.tsx (2 hunks)
  • app/global-error.tsx (2 hunks)
  • app/history/components/HistoryTable.tsx (1 hunks)
  • app/market/[chainId]/[marketid]/components/BorrowsTable.tsx (2 hunks)
  • app/market/[chainId]/[marketid]/components/CampaignModal.tsx (2 hunks)
  • app/market/[chainId]/[marketid]/components/SuppliesTable.tsx (2 hunks)
  • app/market/[chainId]/[marketid]/components/TransactionFiltersModal.tsx (2 hunks)
  • app/market/[chainId]/[marketid]/content.tsx (3 hunks)
  • app/markets/components/BlacklistConfirmationModal.tsx (2 hunks)
  • app/markets/components/MarketActionsDropdown.tsx (2 hunks)
  • app/markets/components/MarketRowDetail.tsx (3 hunks)
  • app/markets/components/MarketSettingsModal.tsx (4 hunks)
  • app/markets/components/markets.tsx (4 hunks)
  • app/positions/components/FromMarketsTable.tsx (2 hunks)
  • app/positions/components/PositionsContent.tsx (3 hunks)
  • app/positions/components/PositionsSummaryTable.tsx (5 hunks)
  • app/positions/components/RebalanceActionRow.tsx (2 hunks)
  • app/positions/components/RebalanceModal.tsx (2 hunks)
  • app/positions/components/SuppliedMarketsDetail.tsx (3 hunks)
  • app/positions/components/onboarding/AssetSelection.tsx (1 hunks)
  • app/positions/components/onboarding/MarketSelectionOnboarding.tsx (3 hunks)
  • app/positions/components/onboarding/SetupPositions.tsx (2 hunks)
  • app/positions/components/onboarding/SuccessPage.tsx (2 hunks)
  • app/positions/report/components/ReportContent.tsx (2 hunks)
  • app/rewards/components/RewardContent.tsx (1 hunks)
  • app/rewards/components/RewardTable.tsx (2 hunks)
  • app/settings/page.tsx (3 hunks)
  • app/tools/page.tsx (2 hunks)
  • docs/Styling.md (7 hunks)
  • package.json (2 hunks)
  • src/components/Borrow/AddCollateralAndBorrow.tsx (3 hunks)
  • src/components/Borrow/WithdrawCollateralAndRepay.tsx (3 hunks)
  • src/components/BorrowModal.tsx (2 hunks)
  • src/components/Info/info.tsx (1 hunks)
  • src/components/Input/Input.tsx (2 hunks)
  • src/components/RiskNotificationModal.tsx (2 hunks)
  • src/components/SupplyModalContent.tsx (2 hunks)
  • src/components/WithdrawModalContent.tsx (2 hunks)
  • src/components/common/Button.tsx (0 hunks)
  • src/components/common/MarketSelectionModal.tsx (3 hunks)
  • src/components/common/MarketsTableWithSameLoanAsset.tsx (3 hunks)
  • src/components/common/SuppliedAssetFilterCompactSwitch.tsx (3 hunks)
  • src/components/common/index.ts (0 hunks)
  • src/components/layout/header/AccountConnect.tsx (2 hunks)
  • src/components/settings/BlacklistedMarketsModal.tsx (6 hunks)
  • src/components/settings/CustomRpcSettings.tsx (5 hunks)
  • src/components/settings/TrustedVaultsModal.tsx (3 hunks)
  • src/components/ui/button.tsx (2 hunks)
  • tailwind.config.ts.deprecated (0 hunks)
💤 Files with no reviewable changes (4)
  • .prettierignore
  • src/components/common/index.ts
  • src/components/common/Button.tsx
  • tailwind.config.ts.deprecated
🧰 Additional context used
🧠 Learnings (9)
📓 Common learnings
Learnt from: antoncoding
Repo: antoncoding/monarch PR: 94
File: src/components/supplyModal.tsx:449-452
Timestamp: 2024-12-08T12:10:17.127Z
Learning: The 'solid' variant is defined in the new `Button` component and is a valid variant.
Learnt from: antoncoding
Repo: antoncoding/monarch PR: 97
File: app/positions/components/onboarding/OnboardingContext.tsx:36-43
Timestamp: 2024-12-16T02:01:51.219Z
Learning: In `app/positions/components/onboarding/OnboardingContext.tsx`, the `defaultStep` variable is no longer needed and can be removed.
📚 Learning: 2024-12-08T12:10:17.127Z
Learnt from: antoncoding
Repo: antoncoding/monarch PR: 94
File: src/components/supplyModal.tsx:449-452
Timestamp: 2024-12-08T12:10:17.127Z
Learning: The 'solid' variant is defined in the new `Button` component and is a valid variant.

Applied to files:

  • app/history/components/HistoryTable.tsx
  • app/tools/page.tsx
  • app/markets/components/MarketActionsDropdown.tsx
  • app/HomePage.tsx
  • src/components/common/SuppliedAssetFilterCompactSwitch.tsx
  • src/components/settings/CustomRpcSettings.tsx
  • src/components/ui/button.tsx
  • app/positions/components/SuppliedMarketsDetail.tsx
  • app/market/[chainId]/[marketid]/components/CampaignModal.tsx
  • docs/Styling.md
📚 Learning: 2024-12-17T10:51:07.277Z
Learnt from: antoncoding
Repo: antoncoding/monarch PR: 99
File: src/components/AgentSetupProcessModal.tsx:38-51
Timestamp: 2024-12-17T10:51:07.277Z
Learning: In `src/components/AgentSetupProcessModal.tsx`, the modal is intentionally designed without a close button.

Applied to files:

  • src/components/BorrowModal.tsx
  • app/autovault/[chainId]/[vaultAddress]/components/VaultInitializationModal.tsx
  • src/components/common/MarketSelectionModal.tsx
  • app/autovault/components/deployment/DeploymentModal.tsx
  • src/components/settings/BlacklistedMarketsModal.tsx
  • src/components/common/SuppliedAssetFilterCompactSwitch.tsx
  • app/market/[chainId]/[marketid]/components/TransactionFiltersModal.tsx
  • src/components/WithdrawModalContent.tsx
  • app/autovault/[chainId]/[vaultAddress]/components/settings/AgentsTab.tsx
  • app/positions/components/onboarding/SuccessPage.tsx
  • app/autovault/[chainId]/[vaultAddress]/content.tsx
  • app/markets/components/BlacklistConfirmationModal.tsx
  • src/components/settings/TrustedVaultsModal.tsx
  • app/market/[chainId]/[marketid]/components/CampaignModal.tsx
  • app/markets/components/MarketSettingsModal.tsx
  • docs/Styling.md
  • app/positions/components/RebalanceModal.tsx
📚 Learning: 2024-12-16T02:01:51.219Z
Learnt from: antoncoding
Repo: antoncoding/monarch PR: 97
File: app/positions/components/onboarding/OnboardingContext.tsx:36-43
Timestamp: 2024-12-16T02:01:51.219Z
Learning: In `app/positions/components/onboarding/OnboardingContext.tsx`, the `defaultStep` variable is no longer needed and can be removed.

Applied to files:

  • src/components/BorrowModal.tsx
  • app/autovault/[chainId]/[vaultAddress]/components/VaultInitializationModal.tsx
  • app/tools/page.tsx
  • app/HomePage.tsx
  • app/positions/components/onboarding/SetupPositions.tsx
  • app/positions/components/onboarding/AssetSelection.tsx
  • src/components/WithdrawModalContent.tsx
  • app/positions/components/onboarding/MarketSelectionOnboarding.tsx
  • app/positions/components/onboarding/SuccessPage.tsx
  • app/positions/components/FromMarketsTable.tsx
  • app/settings/page.tsx
  • app/positions/components/PositionsContent.tsx
📚 Learning: 2025-12-09T10:06:39.848Z
Learnt from: antoncoding
Repo: antoncoding/monarch PR: 231
File: src/hooks/useDeployMorphoMarketV1Adapter.ts:3-3
Timestamp: 2025-12-09T10:06:39.848Z
Learning: In Wagmi v3, useConnection is the correct hook to obtain the connected wallet address, chainId, and connection status (isConnected). This replaces the useAccount hook from Wagmi v2. Usage: const { address, chainId, isConnected } = useConnection() from 'wagmi'.

Applied to files:

  • app/autovault/[chainId]/[vaultAddress]/components/DepositToVaultModal.tsx
  • app/tools/page.tsx
  • app/positions/components/PositionsSummaryTable.tsx
  • app/autovault/components/AutovaultContent.tsx
  • src/components/Borrow/WithdrawCollateralAndRepay.tsx
  • app/autovault/[chainId]/[vaultAddress]/components/settings/AgentsTab.tsx
  • app/rewards/components/RewardTable.tsx
  • app/autovault/[chainId]/[vaultAddress]/content.tsx
  • src/components/layout/header/AccountConnect.tsx
📚 Learning: 2024-10-12T09:23:16.495Z
Learnt from: antoncoding
Repo: antoncoding/monarch PR: 63
File: app/markets/components/MarketRowDetail.tsx:49-52
Timestamp: 2024-10-12T09:23:16.495Z
Learning: When rendering oracle feeds in `ExpandedMarketDetail` (`app/markets/components/MarketRowDetail.tsx`), prefer explicit rendering over iterating keys when dealing with a small number of feeds.

Applied to files:

  • app/markets/components/MarketRowDetail.tsx
  • app/markets/components/markets.tsx
📚 Learning: 2024-11-25T09:39:42.148Z
Learnt from: antoncoding
Repo: antoncoding/monarch PR: 87
File: app/home/HomePage.tsx:17-39
Timestamp: 2024-11-25T09:39:42.148Z
Learning: In `app/home/HomePage.tsx`, the `useEffect` hook depends on `[showCustomized]` because changing `showCustomized` triggers updates to the yield and risk terms.

Applied to files:

  • app/market/[chainId]/[marketid]/content.tsx
  • app/rewards/components/RewardContent.tsx
  • src/components/RiskNotificationModal.tsx
  • app/positions/components/PositionsSummaryTable.tsx
  • src/components/Borrow/WithdrawCollateralAndRepay.tsx
  • app/positions/components/FromMarketsTable.tsx
  • app/positions/components/PositionsContent.tsx
📚 Learning: 2025-11-13T20:32:48.908Z
Learnt from: antoncoding
Repo: antoncoding/monarch PR: 183
File: app/positions/components/RebalanceModal.tsx:301-308
Timestamp: 2025-11-13T20:32:48.908Z
Learning: The TokenIcon component in the codebase accepts a `symbol` prop as part of its valid interface, in addition to `address`, `chainId`, `width`, `height`, and other props.

Applied to files:

  • app/autovault/[chainId]/[vaultAddress]/components/settings/CurrentCaps.tsx
  • app/autovault/[chainId]/[vaultAddress]/components/settings/EditCaps.tsx
  • app/autovault/[chainId]/[vaultAddress]/components/settings/GeneralTab.tsx
  • src/components/SupplyModalContent.tsx
📚 Learning: 2024-10-23T16:17:02.841Z
Learnt from: antoncoding
Repo: antoncoding/monarch PR: 77
File: src/graphql/queries.ts:168-193
Timestamp: 2024-10-23T16:17:02.841Z
Learning: In `src/graphql/queries.ts`, handling only `MarketTransferTransactionData` is intentional at this time.

Applied to files:

  • app/positions/components/FromMarketsTable.tsx
🧬 Code graph analysis (14)
app/autovault/[chainId]/[vaultAddress]/components/DepositToVaultModal.tsx (1)
src/components/ui/button.tsx (1)
  • Button (102-102)
app/tools/page.tsx (1)
src/components/ui/button.tsx (1)
  • Button (102-102)
src/components/common/MarketSelectionModal.tsx (1)
src/components/ui/button.tsx (1)
  • Button (102-102)
src/components/Borrow/AddCollateralAndBorrow.tsx (1)
src/components/ui/button.tsx (1)
  • Button (102-102)
app/autovault/[chainId]/[vaultAddress]/components/settings/EditCaps.tsx (1)
src/components/ui/button.tsx (1)
  • Button (102-102)
src/components/common/SuppliedAssetFilterCompactSwitch.tsx (1)
src/components/ui/button.tsx (1)
  • Button (102-102)
app/positions/components/onboarding/SetupPositions.tsx (1)
src/components/ui/button.tsx (1)
  • Button (102-102)
src/components/SupplyModalContent.tsx (1)
src/components/ui/button.tsx (1)
  • Button (102-102)
app/positions/components/PositionsSummaryTable.tsx (2)
src/components/TooltipContent.tsx (1)
  • TooltipContent (16-71)
src/components/ui/button.tsx (1)
  • Button (102-102)
app/markets/components/BlacklistConfirmationModal.tsx (1)
src/components/ui/button.tsx (1)
  • Button (102-102)
src/components/ui/button.tsx (1)
src/lib/utils.ts (1)
  • cn (4-6)
app/admin/stats/page.tsx (2)
src/components/ui/button.tsx (1)
  • Button (102-102)
src/utils/networks.ts (1)
  • getNetworkName (200-203)
app/positions/components/RebalanceModal.tsx (1)
src/components/ui/button.tsx (1)
  • Button (102-102)
app/positions/components/PositionsContent.tsx (2)
src/components/TooltipContent.tsx (1)
  • TooltipContent (16-71)
src/components/ui/button.tsx (1)
  • Button (102-102)
🔇 Additional comments (55)
src/components/layout/header/AccountConnect.tsx (1)

4-4: Button refactor wiring looks correct

New Button import, onClick={handleConnect}, and variant="primary" all line up with the new UI Button API and the intended “Connect” CTA. useConnection is already in place and consistent with the Wagmi v3 migration noted elsewhere. Based on learnings, ...

Also applies to: 43-47

app/positions/components/SuppliedMarketsDetail.tsx (2)

2-2: Import path updated correctly.

The Button import now points to the new component location.


107-126: Button migration applied correctly.

Both action buttons updated with the new API: onClick replaces onPress, and surface variant is consistent with the migration pattern.

app/autovault/[chainId]/[vaultAddress]/components/settings/AgentsTab.tsx (5)

4-4: Button import update looks fine

Importing Button from @/components/ui/button matches the new shared Button location and keeps the named import form.


101-107: Allocator edit toggle Button wiring is correct

onClick now toggles isEditingAllocators and disabled={!isOwner} keeps the owner-only guard; variant="surface" and size="sm" are just styling.


125-130: Remove allocator Button props match previous behavior

Switch to variant="default", onClick={() => void handleRemoveAllocator(...)} and disabled={isUpdatingAllocator && allocatorToRemove === ...} preserves the old logic while aligning with the new Button API.


158-163: Add allocator Button correctly uses new API

variant="surface", the async onClick={() => void handleAddAllocator(...)}, and the disabled condition tied to isUpdatingAllocator + address maintain the intended UX.


179-184: Done Button handler swap is consistent

Changing to onClick={() => setIsEditingAllocators(false)} cleanly closes edit mode with no behavior change.

app/markets/components/MarketRowDetail.tsx (1)

49-49: Good spacing improvement.

Using flex flex-col gap-2 ensures consistent vertical spacing between warnings.

app/market/[chainId]/[marketid]/components/CampaignModal.tsx (1)

6-7: Campaign CTA migration to new Button API looks good

Importing from @/components/ui/button and using variant="ghost" for the Merkl link keeps behavior intact and matches the new Button API.

Also applies to: 62-69

src/components/BorrowModal.tsx (1)

5-6: Header toggle button migration is correct

Switching to @/components/ui/button with variant="ghost" and using onClick to flip between borrow/repay preserves the existing behavior.

Also applies to: 93-102

app/positions/components/onboarding/SetupPositions.tsx (1)

6-7: Onboarding navigation buttons correctly migrated

Back/Execute buttons now use the new Button component, with sensible ghost/primary variants and a clear disabled condition tied to error, totalAmountBigInt, and supplies.length; the async handleSupply call is wired correctly.

Also applies to: 373-390

app/rewards/components/RewardContent.tsx (1)

135-135: Explicit showLegacy boolean is cleaner

Using morphoBalanceLegacy !== undefined && morphoBalanceLegacy !== 0n makes showLegacy explicitly boolean while keeping the same display conditions for the Legacy MORPHO card.

app/markets/components/MarketSettingsModal.tsx (1)

4-4: LGTM on the Button migration.

Import path and prop updates are consistent with the new Button API. Variant mappings (flatghost, lightghost) are correct.

Also applies to: 218-223, 252-257, 263-268

app/positions/components/FromMarketsTable.tsx (1)

147-161: LGTM on the Max button refactor.

The consolidated onClick handler with stopPropagation is cleaner than a separate no-op. Variant and prop updates align with the new API.

app/positions/components/PositionsSummaryTable.tsx (2)

207-230: Nice addition of tooltip on refresh.

The <span> wrapper is necessary for tooltips on disabled buttons. Implementation is correct.


186-205: Dropdown trigger buttons look good.

Variant and event handler updates are consistent with the new API.

Also applies to: 231-239

src/components/Info/info.tsx (1)

63-73: Layout improvements are solid.

The min-w-0 flex-1 pattern fixes common flex overflow issues. The conditional title render is a nice touch.

Minor: Tailwind has break-words class, but inline styles work fine too.

src/components/SupplyModalContent.tsx (1)

148-174: Button migrations are correct.

Variant mappings (secondarydefault, ctaprimary) and onPressonClick changes are properly applied.

src/components/ui/button.tsx (1)

7-23: Overall structure is clean.

Good use of cva for variant composition. The asChild pattern with Radix Slot is correctly implemented.

Also applies to: 87-99

app/global-error.tsx (1)

3-18: GlobalError Button wiring matches new API

Import path and onClick={reset} look consistent with the new Button component; behavior should be unchanged from the old onPress version.

app/positions/components/onboarding/SuccessPage.tsx (1)

2-28: SuccessPage Button refactor looks consistent

New import, variant="primary", and onClick={handleFinished} align with the updated Button API; flow (close then reset) is preserved.

app/market/[chainId]/[marketid]/components/TransactionFiltersModal.tsx (1)

4-115: TransactionFiltersModal close Button migrated correctly

Using the new Button import with variant="ghost" and onClick={onClose} keeps the modal footer behavior intact.

src/components/RiskNotificationModal.tsx (1)

4-78: RiskNotificationModal Button/Checkbox wiring is coherent

Local Button import, onClick={handleConfirm}, and disabled={!isChecked} line up with the modal logic and existing isChecked guard in handleConfirm.

app/error.tsx (1)

4-16: AppError retry Button updated cleanly

Button now comes from the new module and uses onClick={reset}; error boundary behavior should be unchanged.

src/components/WithdrawModalContent.tsx (1)

15-162: Withdraw buttons respect new API and state guards

Both Buttons use the new import, appropriate variants, and disabled logic (!isConnected || isConfirming || !withdrawAmount) mirrors the prior behavior; onClick={() => void withdraw()} is a safe async pattern.

src/components/common/SuppliedAssetFilterCompactSwitch.tsx (1)

6-225: Filter compact switch Buttons aligned with new Button component

All three Buttons now use the shared Button component; trigger and “Customize Filters” use variant="ghost" while “Done” keeps color="primary" with onClick={close}, preserving existing UX.

app/autovault/[chainId]/[vaultAddress]/components/DepositToVaultModal.tsx (1)

5-127: Deposit buttons correctly migrated and guarded

New Button import, variant="primary", and the disabled predicates around connection, pending state, input error, and amount all look consistent with the original intent.

src/components/Borrow/WithdrawCollateralAndRepay.tsx (1)

304-342: Button migration here looks good

New Button usage (onClick, disabled, variant="surface"/"primary") preserves the previous conditions and async flows; nothing concerning from the refactor itself.

app/autovault/[chainId]/[vaultAddress]/components/settings/CurrentCaps.tsx (1)

4-146: Edit caps button refactor looks correct

Import path, variant="default", and onClick={onStartEdit} all align with the new Button API; existing owner gating remains intact.

src/components/Input/Input.tsx (1)

5-119: Ignore button migration is fine

Using the new Button import with variant="default" and the existing handleDismissError click handler preserves prior behavior.

app/autovault/[chainId]/[vaultAddress]/components/settings/EditCaps.tsx (1)

5-565: Edit caps buttons refactored cleanly

New Button import plus onClick/disabled/variant updates for “Add Market Cap”, “Cancel”, and “Save Changes” all keep the existing behavior and gating logic.

app/positions/components/RebalanceActionRow.tsx (1)

4-236: Rebalance “Add” button migration looks good

Swapping to the new Button import with onClick={onAddAction}, variant="primary", and disabled={isAddDisabled} matches the previous intent; nothing else to tweak here.

package.json (1)

39-57: Dependency tweaks look reasonable; just re-run checks

The added @reown/appkit* entries and the pino-pretty bump are syntactically fine and align with the rest of the stack. Make sure your usual test/build pipeline passes after these version changes.

src/components/Borrow/AddCollateralAndBorrow.tsx (1)

5-5: LGTM - Button API migration consistent.

Import path, event handlers (onClick), disabled prop, and variant mappings all correct.

Also applies to: 318-357

src/components/common/MarketsTableWithSameLoanAsset.tsx (1)

9-9: LGTM - Button and Checkbox API updates consistent.

Import, event handlers, and variant mapping all updated correctly.

Also applies to: 494-494, 1007-1014

src/components/common/MarketSelectionModal.tsx (1)

4-4: LGTM - Button API migration complete.

Import, event handlers, disabled prop, and variant mappings all correct for both multi-select and single-select modes.

Also applies to: 143-168

app/positions/components/RebalanceModal.tsx (1)

4-4: LGTM - Button API migration correct.

Import, event handlers, disabled prop, and variant mappings all updated. The isLoading prop on line 326 is supported by the new Button API.

Also applies to: 315-330

src/components/settings/CustomRpcSettings.tsx (1)

5-5: LGTM - All Button instances migrated correctly.

Import, event handlers, disabled props, and variant mappings consistent across Reset All, Save, Reset to Default, and Edit buttons.

Also applies to: 185-192, 263-292, 331-337

app/positions/report/components/ReportContent.tsx (1)

8-8: LGTM - Button API migration complete.

Import, disabled prop, and variant mapping all correct.

Also applies to: 212-228

src/components/settings/BlacklistedMarketsModal.tsx (1)

7-7: LGTM - All Button instances updated correctly.

Import, event handlers, disabled props, and variant mappings consistent across Remove, Add, pagination, and Close buttons.

Also applies to: 125-133, 193-200, 209-241

src/components/settings/TrustedVaultsModal.tsx (1)

8-8: LGTM - Button API migration complete.

Import, event handlers, and variant mappings all correct for Select All, Deselect All, and Close buttons.

Also applies to: 164-177, 288-294

app/positions/components/PositionsContent.tsx (1)

114-127: Owner “New Position” button migration looks correct

Swapping to variant="primary" and onClick={() => setShowOnboardingModal(true)} matches the new Button API and keeps behavior.

app/market/[chainId]/[marketid]/components/BorrowsTable.tsx (1)

7-7: Filter button migration is consistent and safe

Using the new ui Button with variant="ghost", size="sm", and onClick={onOpenFiltersModal} keeps behavior and accessibility (aria-label still present).

Also applies to: 71-77

app/history/components/HistoryTable.tsx (1)

349-356: Chip variant change is a harmless visual tweak

Switching the LLTV Chip to variant="ghost" with the same classes only affects styling; data and behavior are unchanged.

app/markets/components/MarketActionsDropdown.tsx (1)

10-10: Dropdown trigger Button migration looks fine

Using the new ui Button with size="xs" and variant="surface" for the ellipsis trigger keeps the interaction the same and matches the new design tokens.

Also applies to: 69-75

app/markets/components/BlacklistConfirmationModal.tsx (1)

4-4: Modal action buttons correctly migrated to new Button API

Cancel and Blacklist Market now use variant="default" and variant="primary" with onClick handlers; this keeps the flow and clarifies primary vs secondary action.

Also applies to: 62-75

app/market/[chainId]/[marketid]/content.tsx (1)

14-14: Market header buttons correctly switched to onClick

All header actions (handleBackToMarkets, supply/borrow modal toggles, external Morpho link) now use onClick with the new ui Button, preserving behavior under the updated API.

Also applies to: 219-259

app/positions/components/onboarding/MarketSelectionOnboarding.tsx (1)

2-2: Onboarding navigation Buttons are correctly updated

Back/Continue now use the new Button with variant="ghost" / variant="primary", onClick handlers, and disabled={!canGoNext} for gating. Flow and intent are preserved.

Also applies to: 41-47, 87-101

app/settings/page.tsx (1)

5-5: Settings “Edit” Buttons migration looks good

New Button import, variant="default", and onClick handlers for both “Edit” Buttons are consistent with the updated Button API; behavior is preserved.

Also applies to: 186-193, 244-250

app/tools/page.tsx (1)

6-6: Authorization Buttons correctly migrated to new Button API

Button import, variant="default"/"primary", onClick, and disabled logic are all wired as before; the refactor doesn’t change behavior.

Also applies to: 153-172

app/HomePage.tsx (1)

10-10: HomePage CTA Buttons are consistently updated

All HomePage Buttons now use the new Button component with variant="default"/"primary", onClick handlers for scrolling, and disabled where appropriate; behavior and layout are preserved.

Also applies to: 226-235, 239-246, 295-303, 304-312, 358-366, 367-375, 442-449, 454-460, 523-525

app/admin/stats/page.tsx (1)

4-4: Dropdown trigger Buttons refactor looks correct

Using the shared Button as DropdownTrigger content (with custom classes and no explicit variant) keeps the existing behavior while aligning with the new Button implementation.

Also applies to: 183-199, 269-279, 318-325

app/autovault/[chainId]/[vaultAddress]/content.tsx (1)

11-11: Vault page Buttons are properly migrated

All Buttons now come from @/components/ui/button with appropriate variant, onClick, and disabled props; the flows for refresh, settings, and setup banners are preserved.

Also applies to: 128-129, 153-162, 164-176, 189-197, 207-217, 229-239

app/market/[chainId]/[marketid]/components/SuppliesTable.tsx (1)

7-7: Supplies filter Button migration is consistent

The filter Button now uses the shared Button with variant="ghost", size="sm", onClick, and an aria-label; behavior and styling stay intact.

Also applies to: 66-77

Comment thread .claude/settings.local.json
Comment thread app/autovault/components/AutovaultContent.tsx
Comment thread app/positions/components/PositionsContent.tsx
Comment thread docs/Styling.md
Comment thread docs/Styling.md
Comment thread docs/Styling.md
Comment thread docs/Styling.md
Comment thread src/components/ui/button.tsx
Comment thread src/components/ui/button.tsx
Copy link
Copy Markdown

@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: 0

♻️ Duplicate comments (4)
docs/Styling.md (4)

82-83: Update example variant names to match new Button API.

These examples still use outdated variant names. Should be 'default' and 'primary'.

  <ModalFooter>
-   <Button variant="secondary" onClick={onClose}>Cancel</Button>
-   <Button variant="cta" onClick={handleConfirm}>Confirm</Button>
+   <Button variant="default" onClick={onClose}>Cancel</Button>
+   <Button variant="primary" onClick={handleConfirm}>Confirm</Button>
  </ModalFooter>

118-119: Update example variant name from 'light' to 'ghost'.

The 'light' variant no longer exists. Use 'ghost' for icon buttons.

  actions={
-   <Button variant="light" size="sm" onClick={handleRefresh}>
+   <Button variant="ghost" size="sm" onClick={handleRefresh}>
      <RefreshIcon /> Refresh
    </Button>
  }

156-157: Update compact modal example variant names.

Same issue—should be 'default' and 'primary'.

  <ModalFooter>
-   <Button variant="secondary" size="sm" onClick={onClose}>Cancel</Button>
-   <Button variant="cta" size="sm" onClick={handleApply}>Apply</Button>
+   <Button variant="default" size="sm" onClick={onClose}>Cancel</Button>
+   <Button variant="primary" size="sm" onClick={handleApply}>Apply</Button>
  </ModalFooter>

848-850: Update input example button variant.

Should be 'primary' instead of 'cta'.

  <Button
-   variant="cta"
+   variant="primary"
    size="sm"
    onClick={handleAction}
🧹 Nitpick comments (1)
app/autovault/components/AutovaultContent.tsx (1)

63-63: Consider using 'default' variant instead of 'surface'.

Based on the documented variant guidelines (lines 295-296, 308 in Styling.md), 'surface' is for "Actions in cards, modals, table rows", while 'default' is for "Navigation buttons, actions on main background". This button is on the main background, not in a card or modal.

-              variant={hasExistingVaults ? 'surface' : 'primary'}
+              variant={hasExistingVaults ? 'default' : 'primary'}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d14fd08 and 7388f66.

📒 Files selected for processing (5)
  • app/autovault/[chainId]/[vaultAddress]/components/settings/GeneralTab.tsx (4 hunks)
  • app/autovault/components/AutovaultContent.tsx (2 hunks)
  • app/history/components/HistoryTable.tsx (1 hunks)
  • docs/Styling.md (7 hunks)
  • src/components/ui/pagination.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • app/autovault/[chainId]/[vaultAddress]/components/settings/GeneralTab.tsx
  • app/history/components/HistoryTable.tsx
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: antoncoding
Repo: antoncoding/monarch PR: 94
File: src/components/supplyModal.tsx:449-452
Timestamp: 2024-12-08T12:10:17.127Z
Learning: The 'solid' variant is defined in the new `Button` component and is a valid variant.
Learnt from: antoncoding
Repo: antoncoding/monarch PR: 97
File: app/positions/components/onboarding/OnboardingContext.tsx:36-43
Timestamp: 2024-12-16T02:01:51.219Z
Learning: In `app/positions/components/onboarding/OnboardingContext.tsx`, the `defaultStep` variable is no longer needed and can be removed.
📚 Learning: 2024-12-08T12:10:17.127Z
Learnt from: antoncoding
Repo: antoncoding/monarch PR: 94
File: src/components/supplyModal.tsx:449-452
Timestamp: 2024-12-08T12:10:17.127Z
Learning: The 'solid' variant is defined in the new `Button` component and is a valid variant.

Applied to files:

  • app/autovault/components/AutovaultContent.tsx
  • docs/Styling.md
  • src/components/ui/pagination.tsx
📚 Learning: 2025-12-09T10:06:39.848Z
Learnt from: antoncoding
Repo: antoncoding/monarch PR: 231
File: src/hooks/useDeployMorphoMarketV1Adapter.ts:3-3
Timestamp: 2025-12-09T10:06:39.848Z
Learning: In Wagmi v3, useConnection is the correct hook to obtain the connected wallet address, chainId, and connection status (isConnected). This replaces the useAccount hook from Wagmi v2. Usage: const { address, chainId, isConnected } = useConnection() from 'wagmi'.

Applied to files:

  • app/autovault/components/AutovaultContent.tsx
📚 Learning: 2024-12-17T10:51:07.277Z
Learnt from: antoncoding
Repo: antoncoding/monarch PR: 99
File: src/components/AgentSetupProcessModal.tsx:38-51
Timestamp: 2024-12-17T10:51:07.277Z
Learning: In `src/components/AgentSetupProcessModal.tsx`, the modal is intentionally designed without a close button.

Applied to files:

  • docs/Styling.md
🪛 LanguageTool
docs/Styling.md

[style] ~354-~354: Consider using an extreme adjective for ‘small’.
Context: ...ooltip> ``` #### Button Sizes - xs: Extra small (h-6, 40px min-width) - Rare use - `sm`...

(EXTREME_ADJECTIVES)

🔇 Additional comments (7)
src/components/ui/pagination.tsx (1)

41-55: Active pagination variant change looks good

Switching the active state to use variant: isActive ? 'surface' : 'ghost' keeps behavior and a11y the same and just refines styling; no issues from this change.

app/autovault/components/AutovaultContent.tsx (2)

6-6: LGTM!

Import path correctly updated to the new Button component.


66-66: LGTM!

Event handler correctly updated from onPress to onClick.

docs/Styling.md (4)

7-7: LGTM!

Import path correctly documented for the new Button component.


34-34: LGTM!

Import path correctly documented in example.


290-315: LGTM!

Variant documentation is clear and well-structured.


320-349: LGTM!

Updated examples correctly demonstrate the new Button API.

@antoncoding antoncoding merged commit 81016e7 into master Dec 9, 2025
4 checks passed
@antoncoding antoncoding deleted the opt/components branch December 9, 2025 15:49
@coderabbitai coderabbitai Bot mentioned this pull request Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ui User interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant