Skip to content

Feat: tokenAddress and amount bridge params #7176

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 7 commits into from
May 27, 2025
Merged

Conversation

gregfromstl
Copy link
Member

@gregfromstl gregfromstl commented May 27, 2025


PR-Codex overview

This PR updates the webhooks.client.tsx, UniversalBridgeEmbed.tsx, and page.tsx files to enhance the UI and functionality of the webhook management and the Universal Bridge component, including changes to table headers, cell formatting, and the addition of token metadata handling.

Detailed summary

  • Updated webhooks.client.tsx to center-align "Version" and "Delete" table headers and cells.
  • Changed default webhook version display from "v1" to "1".
  • Modified UniversalBridgeEmbed function to accept token and amount as props.
  • Enhanced token metadata fetching in page.tsx, including error handling.
  • Updated UniversalBridgeEmbed invocation to pass token and amount props.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

  • New Features

    • The bridge page now supports specifying a token address and amount via URL parameters, automatically fetching and displaying token details in the bridge interface.
  • Enhancements

    • The bridge embed component now dynamically receives and displays the selected token and amount.
    • Webhook table columns for "Version" and "Delete" are center-aligned, and the default version string is updated from "v1" to "1" for improved clarity.

…perience

- Added `constants.ts` to configure Thirdweb client for the bridge application.
- Created `BridgeLayout` component to structure the bridge page layout.
- Developed `BridgePage` to handle the main functionality of the Universal Bridge, including metadata and dynamic content.
- Introduced `Providers.client.tsx` to wrap the application with necessary context providers.
- Implemented `UniversalBridgeEmbed` component for embedding payment functionalities with theme support.

This commit establishes the foundational components for the Universal Bridge feature, improving the overall user interface and experience.
- Added specific error messages for insufficient native funds in both `SwapConfirmationScreen` and `TransferConfirmationScreen`.
- Improved user feedback by providing clear titles and messages when transactions cannot be approved or confirmed due to lack of funds for gas.
@gregfromstl gregfromstl requested review from a team as code owners May 27, 2025 18:36
Copy link

changeset-bot bot commented May 27, 2025

⚠️ No Changeset found

Latest commit: 68a5475

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented May 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 27, 2025 7:09pm
4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Skipped (Inspect) May 27, 2025 7:09pm
login ⬜️ Skipped (Inspect) May 27, 2025 7:09pm
thirdweb_playground ⬜️ Skipped (Inspect) May 27, 2025 7:09pm
wallet-ui ⬜️ Skipped (Inspect) May 27, 2025 7:09pm

Copy link
Contributor

graphite-app bot commented May 27, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

Copy link
Contributor

coderabbitai bot commented May 27, 2025

"""

Walkthrough

The changes update the bridge page and its embedded component to accept and handle additional query parameters for token address and amount, fetch token metadata, and pass these as props. UI adjustments were also made to the webhook table, centering specific columns and modifying the default version string display.

Changes

Files/Paths Change Summary
.../webhooks/components/webhooks.client.tsx Centered "Version" and "Delete" columns in the webhook table and changed default version string from "v1" to "1".
.../bridge/components/client/UniversalBridgeEmbed.tsx Updated component to accept token and amount props; adjusted internal usage to use these props.
.../bridge/page.tsx Modified to extract tokenAddress and amount from query, fetch token metadata, and pass as props to embed.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant BridgePage
    participant Blockchain
    participant UniversalBridgeEmbed

    User->>BridgePage: Loads page with searchParams (chainId, tokenAddress, amount)
    BridgePage->>Blockchain: Fetch token metadata if chainId and tokenAddress present
    Blockchain-->>BridgePage: Returns token metadata
    BridgePage->>UniversalBridgeEmbed: Passes chainId, token, and amount as props
    UniversalBridgeEmbed->>UniversalBridgeEmbed: Renders PayEmbed with prefilled token and amount
Loading

Possibly related PRs

Suggested labels

Dashboard

Suggested reviewers

  • jnsdls
    """

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • TEAM-0000: Entity not found: Issue - Could not find referenced Issue.

📜 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 0d8523b and 68a5475.

📒 Files selected for processing (1)
  • apps/dashboard/src/app/bridge/page.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/dashboard/src/app/bridge/page.tsx
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: Size
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: Lint Packages
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: Build Packages
  • GitHub Check: Unit Tests
  • GitHub Check: Analyze (javascript)
✨ 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

codecov bot commented May 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.66%. Comparing base (f115b4d) to head (68a5475).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7176      +/-   ##
==========================================
- Coverage   55.67%   55.66%   -0.01%     
==========================================
  Files         904      904              
  Lines       58391    58391              
  Branches     4119     4113       -6     
==========================================
- Hits        32510    32505       -5     
- Misses      25775    25780       +5     
  Partials      106      106              
Flag Coverage Δ
packages 55.66% <ø> (-0.01%) ⬇️

see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gregfromstl gregfromstl added the merge-queue Adds the pull request to Graphite's merge queue. label May 27, 2025
Copy link
Member Author

Merge activity

  • May 27, 6:39 PM UTC: The merge label 'merge-queue' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.

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: 3

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between f115b4d and 4e94610.

📒 Files selected for processing (3)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/connect/universal-bridge/webhooks/components/webhooks.client.tsx (2 hunks)
  • apps/dashboard/src/app/bridge/components/client/UniversalBridgeEmbed.tsx (2 hunks)
  • apps/dashboard/src/app/bridge/page.tsx (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: Unit Tests
  • GitHub Check: Size
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: Build Packages
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: Lint Packages
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (5)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/connect/universal-bridge/webhooks/components/webhooks.client.tsx (1)

114-115: LGTM! Good UI consistency improvements.

The centering of Version and Delete columns improves table readability, and changing the default version display from "v1" to "1" maintains consistency with the form's version selection values.

Also applies to: 126-129

apps/dashboard/src/app/bridge/components/client/UniversalBridgeEmbed.tsx (2)

4-4: Good addition of TokenInfo type import.

The import is properly structured and enables type safety for the new token prop.


9-13: Excellent implementation of dynamic token and amount support.

The component now accepts token metadata and amount as props, making it more flexible than the previous hardcoded approach. The prop types are appropriate and the integration with PayEmbed is clean.

Also applies to: 24-25

apps/dashboard/src/app/bridge/page.tsx (2)

3-8: Good addition of necessary imports for token metadata functionality.

The imports are appropriate for the new token metadata fetching functionality.


46-58: Good integration of dynamic token and amount props.

The conditional token object creation and prop passing to UniversalBridgeEmbed is well structured. The fallback to "0.01" for amount is reasonable.

Copy link
Contributor

github-actions bot commented May 27, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 61.75 KB (0%) 1.3 s (0%) 186 ms (+127.11% 🔺) 1.5 s
thirdweb (cjs) 344.4 KB (0%) 6.9 s (0%) 631 ms (+8.58% 🔺) 7.6 s
thirdweb (minimal + tree-shaking) 5.69 KB (0%) 114 ms (0%) 47 ms (+983.29% 🔺) 161 ms
thirdweb/chains (tree-shaking) 531 B (0%) 11 ms (0%) 31 ms (+1268.17% 🔺) 41 ms
thirdweb/react (minimal + tree-shaking) 19.54 KB (0%) 391 ms (0%) 81 ms (+554.16% 🔺) 472 ms

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: greg <gregfromstl@gmail.com>
@vercel vercel bot temporarily deployed to Preview – login May 27, 2025 18:45 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground May 27, 2025 18:45 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 May 27, 2025 18:45 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui May 27, 2025 18:45 Inactive
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: 0

♻️ Duplicate comments (2)
apps/dashboard/src/app/bridge/page.tsx (2)

26-26: Input validation for URL parameters is still missing.

This is the same issue flagged in previous reviews. The tokenAddress and chainId parameters should be validated before use to prevent runtime errors.


36-37: Remove redundant ESLint disable comment.

This issue was flagged in previous reviews. The no-restricted-syntax disable comment is unnecessary and should be removed.

🧹 Nitpick comments (1)
apps/dashboard/src/app/bridge/page.tsx (1)

28-46: Improve variable declarations for better type safety.

The error handling implementation addresses previous feedback well. However, the variable declarations can be improved based on static analysis feedback.

Apply this diff to improve variable declarations:

- // Replace the existing destructuring block with error‐handled fetch
- let symbol, decimals, tokenName;
+ // Replace the existing destructuring block with error‐handled fetch
+ let symbol: string | undefined;
+ let decimals: number | undefined;
+ let tokenName: string | undefined;
🧰 Tools
🪛 Biome (1.9.4)

[error] 29-30: Declare variables separately

Unsafe fix: Break out into multiple declarations

(lint/style/useSingleVarDeclarator)


[error] 29-29: This variable implicitly has the any type.

Variable declarations without type annotation and initialization implicitly have the any type. Declare a type or initialize the variable with some value.

(lint/suspicious/noImplicitAnyLet)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4e94610 and 0d8523b.

📒 Files selected for processing (1)
  • apps/dashboard/src/app/bridge/page.tsx (2 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
apps/dashboard/src/app/bridge/page.tsx

[error] 29-30: Declare variables separately

Unsafe fix: Break out into multiple declarations

(lint/style/useSingleVarDeclarator)


[error] 29-29: This variable implicitly has the any type.

Variable declarations without type annotation and initialization implicitly have the any type. Declare a type or initialize the variable with some value.

(lint/suspicious/noImplicitAnyLet)

⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: Unit Tests
  • GitHub Check: Build Packages
  • GitHub Check: Lint Packages
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: Size
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (2)
apps/dashboard/src/app/bridge/page.tsx (2)

3-6: Import statements look good.

The new imports are properly utilized for the token metadata fetching functionality.

Also applies to: 8-8


51-63: Component prop implementation looks good.

The conditional token prop creation and amount defaulting logic properly handles both success and failure cases from the metadata fetching.

- Updated variable declarations for symbol, decimals, and tokenName to include explicit types.
- Improved error handling for token metadata fetching with consistent logging format.
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground May 27, 2025 18:54 Inactive
@vercel vercel bot temporarily deployed to Preview – login May 27, 2025 18:54 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui May 27, 2025 18:54 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 May 27, 2025 18:54 Inactive
@gregfromstl gregfromstl merged commit acd8b9e into main May 27, 2025
24 checks passed
@gregfromstl gregfromstl deleted the greg/improved-bridge-ui branch May 27, 2025 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dashboard Involves changes to the Dashboard. merge-queue Adds the pull request to Graphite's merge queue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant