Skip to content

Conversation

rodrigopavezi
Copy link
Member

@rodrigopavezi rodrigopavezi commented Sep 24, 2025

Fixes #146

Summary by CodeRabbit

  • New Features

    • Fees now display as USD amounts alongside original values for clearer cost context.
    • Added an info icon that opens a tooltip with a detailed fee breakdown (gas, cross‑chain, platform, provider) when available.
    • Tooltip activation is isolated from row selection to prevent accidental navigation.
  • Changes

    • Platform fee is no longer shown as a separate inline label; fee details are surfaced via the tooltip instead.

@rodrigopavezi rodrigopavezi self-assigned this Sep 24, 2025
Copy link
Contributor

coderabbitai bot commented Sep 24, 2025

Warning

Rate limit exceeded

@rodrigopavezi has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 4 minutes and 47 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 38c2521 and 2219327.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • src/app/globals.css (2 hunks)
  • src/components/payment-route.tsx (3 hunks)

Walkthrough

Adds feeInUSD and optional feeBreakdown to the PaymentRoute type and updates the PaymentRoute component to show fee in USD with an optional Info tooltip showing a formatted fee breakdown (tooltip click stops propagation). platformFee prop/display removed.

Changes

Cohort / File(s) Summary
UI: Fee display & tooltip
src/components/payment-route.tsx
Replaced inline/platform fee text with USD feeInUSD display; imported internal Tooltip and Info icon; added formatFeeBreakdown helper; conditionally renders Tooltip when route.feeBreakdown exists; tooltip trigger calls stopPropagation; removed platformFee usage and nativeToken calc.
Types: PaymentRoute extension
src/lib/types/index.ts
Added feeInUSD: number and optional feeBreakdown?: { type: "gas" | "crosschain" | "platform"; stage: "sending" | "overall"; provider: string; amount: string; amountInUSD: string; amountInGwei?: string | null; currency: string; network: string; rateProvider?: string; receiverAddress?: string; }[] to PaymentRoute.
Minor: formatting / import reorder
src/app/i/[id]/page.tsx, src/components/dashboard/blocks/invoice-row.tsx, src/components/view-recurring-payments/view-recurring-payments.tsx
Non-functional changes: import reorder in page.tsx, JSX formatting adjustments in invoice and recurring payments components (no behavior change).

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant UI as PaymentRoute
  participant TT as Tooltip

  User->>UI: View route row
  UI->>UI: Read route.feeInUSD and route.feeBreakdown
  alt feeBreakdown present
    UI->>TT: Render Tooltip (Info icon) with formatted breakdown
    User->>TT: Click Info icon
    note right of UI #f8f3d4: click handler calls stopPropagation
    TT-->>User: Show breakdown content
  else no feeBreakdown
    UI-->>User: Show USD fee only
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • MantisClone
  • aimensahnoun

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Out of Scope Changes Check ⚠️ Warning The pull request includes unrelated formatting-only changes in invoice-row.tsx and view-recurring-payments.tsx as well as an import reordering in page.tsx that do not pertain to the fee breakdown tooltip feature. Please remove or separate the formatting and import-only changes into a different commit or pull request so that this pull request focuses solely on the fee breakdown tooltip implementation.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly and concisely describes the primary change of adding a fee breakdown tooltip to the payment route component, matching the main feature implemented in the pull request and making its purpose immediately apparent to team members.
Linked Issues Check ✅ Passed The pull request directly implements the objective of issue #146 by adding the feeBreakdown data structure, rendering a tooltip with a structured USD fee breakdown before payment, and updating the PaymentRouteProps accordingly to display fees in USD as required.

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

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

🧹 Nitpick comments (2)
src/components/payment-route.tsx (1)

75-108: Improve key uniqueness and prep for i18n; optional memoization.

  • Keys can collide if two items share type/provider/stage. Append index.
  • Consider externalizing "Fee Breakdown", "Gas Fee", "Bridge Fee", "Platform Fee" for i18n.
  • Optionally memoize the JSX to avoid recompute on each render.

Apply this minimal key fix:

-        {route.feeBreakdown.map((fee) => (
+        {route.feeBreakdown.map((fee, i) => (
           <div
-            key={`${fee.type}-${fee.provider}-${fee.stage}`}
+            key={`${fee.type}-${fee.provider}-${fee.stage}-${i}`}
             className="flex justify-between items-start text-xs"
           >
src/lib/types/index.ts (1)

12-23: Extract FeeBreakdownItem type and reuse for clarity and reuse.

Keeps PaymentRoute concise and improves ergonomics across the codebase.

Apply this change within the interface:

-  feeBreakdown?: {
-    type: "gas" | "crosschain" | "platform";
-    stage: "sending" | "overall";
-    provider: string;
-    amount: string;
-    amountFormatted: string;
-    amountInGwei?: string | null;
-    currency: string;
-    network: string;
-    rateProvider?: string;
-    receiverAddress?: string;
-  }[];
+  feeBreakdown?: FeeBreakdownItem[];

And add this type near the top of the file:

export type FeeBreakdownItem = {
  type: "gas" | "crosschain" | "platform";
  stage: "sending" | "overall";
  provider: string;
  amount: string;
  amountFormatted: string;
  amountInGwei?: string | null;
  currency: string;
  network: string;
  rateProvider?: string;
  receiverAddress?: string;
};
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e18bbf9 and 5231649.

📒 Files selected for processing (2)
  • src/components/payment-route.tsx (3 hunks)
  • src/lib/types/index.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/components/payment-route.tsx (1)
src/components/ui/tooltip.tsx (1)
  • Tooltip (11-26)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build
🔇 Additional comments (2)
src/components/payment-route.tsx (2)

1-1: Tooltip import looks good.

Matches the Radix-based Tooltip API used in the codebase.


3-3: Info icon import is appropriate.

Icon is used as a discrete tooltip trigger.

Copy link
Contributor

@bassgeta bassgeta left a comment

Choose a reason for hiding this comment

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

Looking good 😎
image

@rodrigopavezi
Copy link
Member Author

Screenshot 2025-09-27 at 05 51 30

@rodrigopavezi
Copy link
Member Author

Screenshot 2025-09-29 at 22 48 28 Screenshot 2025-09-29 at 22 48 46 Screenshot 2025-09-29 at 22 48 37

@rodrigopavezi
Copy link
Member Author

Screenshot 2025-09-30 at 16 24 09

Copy link
Contributor

@bassgeta bassgeta left a comment

Choose a reason for hiding this comment

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

Looking good, nice and simple 💯
🚢 before I merge that big ecommerce chonker PR and potentially cause conflicts 😅

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.

EasyInvoice - Fee Breakdown on Payment Page before payment
2 participants