Skip to content

Update history and bridge preview design #24

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

alecande11
Copy link
Contributor

@alecande11 alecande11 commented Jun 24, 2025

Summary by CodeRabbit

  • New Features

    • Wallet icons are now displayed next to addresses in bridge history items, providing clearer identification of the connected wallet or source wallet.
    • Chain logos are overlaid on asset logos in both bridge history and operation items for improved visual context.
    • Explorer names are now shown alongside bridge types in history items.
  • Style

    • Updated layouts and spacing in bridge history and operation items for enhanced readability and alignment.
    • Improved visual presentation of logos and metadata within bridge-related components.

@alecande11 alecande11 requested a review from simcheolhwan as a code owner June 24, 2025 14:49
Copy link

coderabbitai bot commented Jun 24, 2025

Walkthrough

This update introduces UI improvements and code refactoring to the bridge history and operation item components. It adds wallet and chain icon overlays, restructures layout and metadata display, and includes explorer name mapping for bridge types. All changes are limited to CSS and React component rendering, with no changes to core logic or public APIs.

Changes

File(s) Change Summary
BridgeHistoryItem.module.css, OperationItem.module.css Updated layouts, added .logoContainer and .chainLogo classes for icon overlays, adjusted spacing and alignment.
BridgeHistoryItem.tsx Refactored UI: added wallet icon logic, meta info, explorer section, and updated row rendering.
OperationItem.tsx Wrapped asset logo in a container, conditionally rendered chain logo overlay if wallet icon present.
data/tx.ts Added bridgeTypeExplorerName constant mapping bridge types to explorer names.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant BridgeHistoryItem
    participant WalletData
    participant UI

    User->>BridgeHistoryItem: Render component
    BridgeHistoryItem->>WalletData: useAccount(), useCosmosWallets()
    BridgeHistoryItem->>BridgeHistoryItem: getWalletIcon(address, isSource)
    BridgeHistoryItem->>UI: Render row with asset, chain, and wallet icons
    BridgeHistoryItem->>UI: Render meta info and explorer section
    UI-->>User: Display updated bridge history item
Loading

Poem

In the meadow of code, new icons appear,
Wallets and chains now twinkle so clear.
Explorer names guide with a luminous glow,
While logos and layouts in harmony flow.
With every hop, our bridge grows bright—
A rabbit’s delight in the UI’s new light! 🐇✨

✨ 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.

Copy link

Deploying initia-widget-preview-staging with  Cloudflare Pages  Cloudflare Pages

Latest commit: 53e409d
Status: ✅  Deploy successful!
Preview URL: https://caf2526c.initia-widget-preview-staging.pages.dev
Branch Preview URL: https://update-history-design.initia-widget-preview-staging.pages.dev

View logs

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

🔭 Outside diff range comments (1)
packages/widget-react/src/pages/bridge/BridgeHistoryItem.tsx (1)

121-151: Fix potential undefined chain logo issue.

The renderRow function has the same non-null assertion issue as in OperationItem.tsx.

Apply this diff to safely handle undefined chain logo URI:

-        <div className={styles.logoContainer}>
-          <Image src={logo_uri} width={32} height={32} />
-          <Image
-            src={chain_logo_uri || undefined}
-            width={16}
-            height={16}
-            className={styles.chainLogo}
-          />
-        </div>
+        <div className={styles.logoContainer}>
+          <Image src={logo_uri} width={32} height={32} />
+          {chain_logo_uri && (
+            <Image
+              src={chain_logo_uri}
+              width={16}
+              height={16}
+              className={styles.chainLogo}
+            />
+          )}
+        </div>
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8f16f1a and 53e409d.

📒 Files selected for processing (5)
  • packages/widget-react/src/pages/bridge/BridgeHistoryItem.module.css (4 hunks)
  • packages/widget-react/src/pages/bridge/BridgeHistoryItem.tsx (5 hunks)
  • packages/widget-react/src/pages/bridge/OperationItem.module.css (1 hunks)
  • packages/widget-react/src/pages/bridge/OperationItem.tsx (2 hunks)
  • packages/widget-react/src/pages/bridge/data/tx.ts (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
packages/widget-react/src/pages/bridge/OperationItem.tsx (1)
packages/widget-react/src/pages/bridge/data/chains.ts (1)
  • useSkipChain (60-63)
packages/widget-react/src/pages/bridge/BridgeHistoryItem.tsx (4)
packages/widget-react/src/public/utils/address.ts (1)
  • AddressUtils (4-66)
packages/widget-react/src/pages/bridge/data/chains.ts (1)
  • RouterChainJson (9-13)
packages/widget-react/src/public/utils/format.ts (1)
  • formatAmount (19-26)
packages/widget-react/src/pages/bridge/data/tx.ts (1)
  • bridgeTypeExplorerName (317-321)
🔇 Additional comments (11)
packages/widget-react/src/pages/bridge/data/tx.ts (1)

317-321: LGTM! Well-structured explorer name mapping.

The constant provides a clean mapping from bridge types to their corresponding explorer names, which enhances the UI by showing user-friendly explorer names instead of enum values.

packages/widget-react/src/pages/bridge/OperationItem.module.css (1)

9-21: LGTM! Clean implementation of logo overlay pattern.

The CSS correctly implements a positioned overlay where the chain logo appears as a small badge in the bottom-right corner of the main logo. The styling with border and circular border-radius provides good visual separation.

packages/widget-react/src/pages/bridge/OperationItem.tsx (1)

21-21: LGTM! Good destructuring pattern.

Extracting the chain logo URI from the skip chain data is well-structured and follows the existing pattern.

packages/widget-react/src/pages/bridge/BridgeHistoryItem.module.css (4)

22-27: LGTM! Improved header layout.

The change from grid to flex layout with space-between justification properly separates the meta information and explorer link sections.


52-60: LGTM! Well-styled explorer link section.

The explorer styling provides appropriate visual hierarchy and spacing for the new explorer link display.


87-100: LGTM! Consistent logo overlay implementation.

The logo container and chain logo overlay styling matches the pattern established in OperationItem, providing UI consistency across components.


119-126: LGTM! Proper wallet icon integration.

The flex layout for the chain section and wallet icon styling provide good visual alignment and spacing.

packages/widget-react/src/pages/bridge/BridgeHistoryItem.tsx (4)

3-3: LGTM! Proper wallet integration imports and state.

The imports and wallet state setup correctly integrate wagmi account information and cosmos wallet functionality.

Also applies to: 30-30, 45-46


103-119: LGTM! Well-structured wallet icon helper.

The getWalletIcon function properly handles different wallet scenarios:

  1. Cosmos wallet icons for source addresses
  2. Connected wallet connector icons for matching addresses
  3. Default wallet icon as fallback

The logic is clear and follows the expected priority order.


157-185: LGTM! Improved header with better information architecture.

The restructured header effectively separates:

  • Transaction status and metadata (timestamp, fees, slippage)
  • Explorer link with bridge type name

The conditional rendering for fees and slippage is well-implemented, and the use of bridgeTypeExplorerName provides user-friendly explorer names.


188-188: LGTM! Proper isSource parameter usage.

The renderRow calls correctly pass true for source transactions and false for destination transactions, enabling appropriate wallet icon rendering.

Also applies to: 192-192

Comment on lines +43 to +48
<div className={styles.logoContainer}>
<Image src={logo_uri} width={32} height={32} />
{!!walletIcon && (
<Image src={chain_logo_uri!} width={16} height={16} className={styles.chainLogo} />
)}
</div>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix potential runtime error with non-null assertion.

The non-null assertion operator on chain_logo_uri! could cause a runtime error if the chain logo URI is undefined.

Apply this diff to safely handle undefined chain logo URI:

-          {!!walletIcon && (
-            <Image src={chain_logo_uri!} width={16} height={16} className={styles.chainLogo} />
-          )}
+          {!!walletIcon && chain_logo_uri && (
+            <Image src={chain_logo_uri} width={16} height={16} className={styles.chainLogo} />
+          )}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div className={styles.logoContainer}>
<Image src={logo_uri} width={32} height={32} />
{!!walletIcon && (
<Image src={chain_logo_uri!} width={16} height={16} className={styles.chainLogo} />
)}
</div>
<div className={styles.logoContainer}>
<Image src={logo_uri} width={32} height={32} />
{!!walletIcon && chain_logo_uri && (
<Image src={chain_logo_uri} width={16} height={16} className={styles.chainLogo} />
)}
</div>
🤖 Prompt for AI Agents
In packages/widget-react/src/pages/bridge/OperationItem.tsx around lines 43 to
48, the use of the non-null assertion operator on chain_logo_uri can cause a
runtime error if chain_logo_uri is undefined. To fix this, add a conditional
check to ensure chain_logo_uri is defined before rendering the Image component
with it, preventing potential crashes when the URI is missing.

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.

1 participant