Skip to content

Display deducted and additional fees in separate fields #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 29, 2025

Conversation

alecande11
Copy link
Contributor

@alecande11 alecande11 commented Jun 27, 2025

Summary by CodeRabbit

  • New Features

    • Estimated fees are now clearly separated into "deducted" and "additional" categories, each with its own display and tooltip for better transparency.
  • Style

    • Updated alignment and icon color styling in the Bridge fields for improved visual consistency.
  • Bug Fixes

    • Fee error messages now more accurately reflect the user's balance and fee type.
  • Documentation

    • UI text updated from "Fee" to "Fees" in transaction history for clarity.

Copy link

coderabbitai bot commented Jun 27, 2025

Walkthrough

The changes introduce a clearer separation and display of transaction fees in the bridge UI, distinguishing between "deducted" and "additional" fees. Supporting updates include a new enum for fee behavior, UI adjustments for improved fee explanation, CSS tweaks for alignment and icon styling, and a minor label change from "Fee" to "Fees" in transaction history.

Changes

File(s) Change Summary
BridgeFields.tsx Refactored fee logic to separate "deducted" and "additional" fees; updated UI to display both with tooltips; revised error and disabled message logic; added new icon and tooltip imports.
data/simulate.ts Added FeeBehaviorJson enum for fee behavior classification.
BridgeFields.module.css Removed vertical alignment from .meta .row; added color styling for icons in .description.
BridgeHistoryItem.tsx Changed UI label from "Fee" to "Fees" in transaction history items.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant BridgeFields
    participant FeeData
    participant UI

    User->>BridgeFields: Enter transaction details
    BridgeFields->>FeeData: Retrieve estimated_fees
    FeeData-->>BridgeFields: Return fees with fee_behavior
    BridgeFields->>BridgeFields: Separate fees into deductedFees and additionalFees
    BridgeFields->>UI: Render deductedFees with tooltip
    BridgeFields->>UI: Render additionalFees with tooltip
    UI-->>User: Display separated fees and info icons
Loading

Poem

In the meadow of code, two fees now appear,
Deducted and additional, both crystal clear.
Tooltips like fireflies, icons shining bright,
No more confusion in the soft moonlight.
With every hop, the bridge grows wise—
Clearer fees for all, a rabbit’s proud prize! 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bdb900b and 96a2c23.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • packages/widget-react/src/pages/bridge/BridgeFields.module.css (1 hunks)
  • packages/widget-react/src/pages/bridge/BridgeFields.tsx (6 hunks)
  • packages/widget-react/src/pages/bridge/BridgeHistoryItem.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/widget-react/src/pages/bridge/BridgeHistoryItem.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/widget-react/src/pages/bridge/BridgeFields.module.css
  • packages/widget-react/src/pages/bridge/BridgeFields.tsx
✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@alecande11 alecande11 marked this pull request as ready for review June 27, 2025 17:29
@alecande11 alecande11 requested a review from simcheolhwan as a code owner June 27, 2025 17:29
Copy link

@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 (1)
packages/widget-react/src/pages/bridge/BridgeFields.tsx (1)

266-267: Standardize icon sizes for consistency.

The IconInfoFilled component uses different sizes: size={12} on line 267 and no size specified on line 280. Consider standardizing the icon size for visual consistency.

                        <WidgetTooltip label="This fee is paid on top of the current amount">
-                          <IconInfoFilled />
+                          <IconInfoFilled size={12} />
                        </WidgetTooltip>

Also applies to: 280-280

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7a2f8df and 90aacdd.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • packages/widget-react/package.json (1 hunks)
  • packages/widget-react/src/pages/bridge/BridgeFields.module.css (1 hunks)
  • packages/widget-react/src/pages/bridge/BridgeFields.tsx (4 hunks)
  • packages/widget-react/src/pages/bridge/data/simulate.ts (1 hunks)
🔇 Additional comments (5)
packages/widget-react/src/pages/bridge/BridgeFields.module.css (1)

66-69: LGTM! Consistent icon styling added.

The new CSS rule properly styles info icons within descriptions using the established color variable pattern.

packages/widget-react/package.json (1)

92-92: Verify the updated package version for availability and security.

The dependency version was narrowed from "^1" to "^1.3.6", which suggests specific features are required from this version. Please ensure this version exists and has no known security vulnerabilities.

What is the latest version of @skip-go/client package and are there any known security advisories for version 1.3.6?
packages/widget-react/src/pages/bridge/data/simulate.ts (1)

99-102: LGTM! Well-structured enum for fee behavior classification.

The enum follows TypeScript best practices with descriptive names and string literal values that match the enum keys.

packages/widget-react/src/pages/bridge/BridgeFields.tsx (2)

5-10: LGTM! Import updates support the new fee display functionality.

The added imports for IconInfoFilled and WidgetTooltip align with the UI enhancements for displaying fee information with explanatory tooltips.


260-284: Excellent implementation of fee separation with clear UX.

The separation of deducted and additional fees with explanatory tooltips significantly improves user understanding of fee structures. The implementation correctly uses the new enum and provides clear messaging about fee behavior.

Copy link

@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

🧹 Nitpick comments (1)
packages/widget-react/src/pages/bridge/BridgeFields.module.css (1)

50-54: Check layout after switching to align-items: flex-start

Changing vertical alignment from center to flex-start will left-align all items within every .row. Verify screens with long fee descriptions or when no description is present—there’s a chance text/icon pairs now hug the top while the right-hand numeric value still sits lower, creating visual imbalance.

If you need left alignment only for the left column, consider:

  .row {
     display: flex;
     justify-content: space-between;
-    align-items: flex-start;
+    align-items: flex-start;          /* keep */
+    /* left column only */
+    & > :first-child {
+      align-self: flex-start;
+    }
+    /* but keep numbers vertically centered */
+    & > :last-child {
+      align-self: center;
+    }
  }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 90aacdd and 5dcbb6f.

📒 Files selected for processing (3)
  • packages/widget-react/src/pages/bridge/BridgeFields.module.css (2 hunks)
  • packages/widget-react/src/pages/bridge/BridgeFields.tsx (4 hunks)
  • packages/widget-react/src/pages/bridge/data/simulate.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/widget-react/src/pages/bridge/data/simulate.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/widget-react/src/pages/bridge/BridgeFields.tsx
🔇 Additional comments (1)
packages/widget-react/src/pages/bridge/BridgeFields.module.css (1)

60-70: Good addition of scoped icon styling

Introducing a nested .icon rule keeps fee-tooltip icons visually consistent and avoids polluting global styles—nice touch.

@simcheolhwan simcheolhwan force-pushed the update-estimated-fees branch from c46638b to bdb900b Compare June 29, 2025 04:20
@simcheolhwan simcheolhwan force-pushed the update-estimated-fees branch from bdb900b to 96a2c23 Compare June 29, 2025 04:22
@simcheolhwan simcheolhwan merged commit dea7178 into main Jun 29, 2025
4 checks passed
@simcheolhwan simcheolhwan deleted the update-estimated-fees branch June 29, 2025 04:25
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