-
Notifications
You must be signed in to change notification settings - Fork 603
[MNY-270] Remove in-app wallet options from bridge page connect modal #8270
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
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
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. This stack of pull requests is managed by Graphite. Learn more about stacking. |
WalkthroughCentralizes app metadata into a new Changes
Sequence DiagramsequenceDiagram
participant Header as Bridge Header
participant PublicBtn as PublicPageConnectButton
participant BEmbed as BuyAndSwapEmbed
participant CButton as ConnectButton
Header->>PublicBtn: render(props: wallets={bridgeWallets}, connectButtonClassName)
PublicBtn->>CButton: render with wallets={props.wallets}<br/>appMetadata={appMetadata}
PublicBtn->>BEmbed: render with wallets={props.wallets}
BEmbed->>CButton: instantiate BuyWidget/SwapWidget with connectOptions: { wallets, appMetadata }
rect #E8F6FF
note right of BEmbed: bridgeWallets created via createWallet\n(include Coinbase with appMetadata)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Pre-merge checks and finishing touches❌ Failed checks (3 warnings)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (7)
🚧 Files skipped from review as they are similar to previous changes (3)
🧰 Additional context used📓 Path-based instructions (5)**/*.{ts,tsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
apps/{dashboard,playground-web}/**/*.{ts,tsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
apps/{dashboard,playground}/**/*.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
apps/{dashboard,playground}/**/*.tsx📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧬 Code graph analysis (3)apps/dashboard/src/app/bridge/components/header.tsx (2)
apps/dashboard/src/@/components/connect-wallet/index.tsx (1)
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/_components/PublicPageConnectButton.tsx (1)
⏰ 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). (7)
🔇 Additional comments (9)
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
Comment |
0083e3b
to
c934102
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8270 +/- ##
=======================================
Coverage 54.90% 54.90%
=======================================
Files 919 919
Lines 60613 60613
Branches 4115 4115
=======================================
Hits 33278 33278
Misses 27234 27234
Partials 101 101
🚀 New features to boost your workflow:
|
There was a problem hiding this 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)
apps/dashboard/src/@/components/blocks/BuyAndSwapEmbed.tsx (1)
95-99
: Consider extracting the connectOptions object.The
connectOptions
structure is duplicated betweenBuyWidget
andSwapWidget
. While acceptable for just 2 occurrences in the same component, extracting it to a shared constant would improve maintainability if this pattern expands.Apply this diff to extract the common configuration:
+ const connectOptions = useMemo( + () => ({ + autoConnect: false, + wallets: props.wallets, + appMetadata: appMetadata, + }), + [props.wallets], + ); + return ( <div className="bg-card rounded-2xl border overflow-hidden flex flex-col relative z-10 shadow-xl min-w-0"> <div className="flex gap-2.5 p-4 border-b border-dashed">Then use it in both widgets:
<BuyWidget amount={props.buyAmount || "1"} chain={props.chain} className="!rounded-2xl !border-none" title="" client={client} - connectOptions={{ - autoConnect: false, - wallets: props.wallets, - appMetadata: appMetadata, - }} + connectOptions={connectOptions}<SwapWidget client={client} theme={themeObj} className="!rounded-2xl !border-none" - connectOptions={{ - autoConnect: false, - wallets: props.wallets, - appMetadata: appMetadata, - }} + connectOptions={connectOptions}Also applies to: 192-196
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (7)
apps/dashboard/src/@/components/blocks/BuyAndSwapEmbed.tsx
(5 hunks)apps/dashboard/src/@/components/connect-wallet/index.tsx
(3 hunks)apps/dashboard/src/@/constants/connect.ts
(1 hunks)apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/_components/PublicPageConnectButton.tsx
(3 hunks)apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/ai/components/NebulaConnectButton.tsx
(2 hunks)apps/dashboard/src/app/bridge/components/client/UniversalBridgeEmbed.tsx
(2 hunks)apps/dashboard/src/app/bridge/components/header.tsx
(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
- apps/dashboard/src/@/constants/connect.ts
- apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/_components/PublicPageConnectButton.tsx
- apps/dashboard/src/app/bridge/components/header.tsx
- apps/dashboard/src/app/bridge/components/client/UniversalBridgeEmbed.tsx
- apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/ai/components/NebulaConnectButton.tsx
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx}
: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from@/types
or localtypes.ts
barrels
Prefer type aliases over interface except for nominal shapes
Avoidany
andunknown
unless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial
,Pick
, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose
**/*.{ts,tsx}
: Use explicit function declarations and explicit return types in TypeScript
Limit each file to one stateless, single‑responsibility function
Re‑use shared types from@/types
where applicable
Prefertype
aliases overinterface
except for nominal shapes
Avoidany
andunknown
unless unavoidable; narrow generics when possible
Prefer composition over inheritance; use utility types (Partial, Pick, etc.)
Lazy‑import optional features and avoid top‑level side‑effects to reduce bundle size
Files:
apps/dashboard/src/@/components/connect-wallet/index.tsx
apps/dashboard/src/@/components/blocks/BuyAndSwapEmbed.tsx
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)
Files:
apps/dashboard/src/@/components/connect-wallet/index.tsx
apps/dashboard/src/@/components/blocks/BuyAndSwapEmbed.tsx
apps/{dashboard,playground-web}/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
apps/{dashboard,playground-web}/**/*.{ts,tsx}
: Import UI primitives from@/components/ui/*
(Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator) in dashboard and playground apps
UseNavLink
for internal navigation with automatic active states in dashboard and playground apps
Use Tailwind CSS only – no inline styles or CSS modules
Usecn()
from@/lib/utils
for conditional class logic
Use design system tokens (e.g.,bg-card
,border-border
,text-muted-foreground
)
Server Components (Node edge): Start files withimport "server-only";
Client Components (browser): Begin files with'use client';
Always callgetAuthToken()
to retrieve JWT from cookies on server side
UseAuthorization: Bearer
header – never embed tokens in URLs
Return typed results (e.g.,Project[]
,User[]
) – avoidany
Wrap client-side data fetching calls in React Query (@tanstack/react-query
)
Use descriptive, stablequeryKeys
for React Query cache hits
ConfigurestaleTime
/cacheTime
in React Query based on freshness (default ≥ 60s)
Keep tokens secret via internal API routes or server actions
Never importposthog-js
in server components
Files:
apps/dashboard/src/@/components/connect-wallet/index.tsx
apps/dashboard/src/@/components/blocks/BuyAndSwapEmbed.tsx
apps/{dashboard,playground}/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
apps/{dashboard,playground}/**/*.{ts,tsx}
: Import UI primitives from@/components/ui/_
(e.g., Button, Input, Tabs, Card)
UseNavLink
for internal navigation to get active state handling
Use Tailwind CSS for styling; no inline styles
Merge class names withcn()
from@/lib/utils
for conditional classes
Stick to design tokens (e.g., bg-card, border-border, text-muted-foreground)
Server Components must start withimport "server-only"
; usenext/headers
, server‑only env, heavy data fetching, andredirect()
where appropriate
Client Components must start with'use client'
; handle interactivity with hooks and browser APIs
Server-side data fetching: callgetAuthToken()
from cookies, sendAuthorization: Bearer <token>
header, and return typed results (avoidany
)
Client-side data fetching: wrap calls in React Query with descriptive, stablequeryKeys
and set sensiblestaleTime/cacheTime
(≥ 60s default); keep tokens secret via internal routes or server actions
Do not importposthog-js
in server components (client-side only)
Files:
apps/dashboard/src/@/components/connect-wallet/index.tsx
apps/dashboard/src/@/components/blocks/BuyAndSwapEmbed.tsx
apps/{dashboard,playground}/**/*.tsx
📄 CodeRabbit inference engine (AGENTS.md)
Expose a
className
prop on the root element of every component
Files:
apps/dashboard/src/@/components/connect-wallet/index.tsx
apps/dashboard/src/@/components/blocks/BuyAndSwapEmbed.tsx
🧬 Code graph analysis (2)
apps/dashboard/src/@/components/connect-wallet/index.tsx (1)
apps/dashboard/src/@/constants/connect.ts (1)
appMetadata
(1-5)
apps/dashboard/src/@/components/blocks/BuyAndSwapEmbed.tsx (1)
apps/dashboard/src/@/constants/connect.ts (1)
appMetadata
(1-5)
⏰ 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). (3)
- GitHub Check: Size
- GitHub Check: Lint Packages
- GitHub Check: Analyze (javascript)
🔇 Additional comments (2)
apps/dashboard/src/@/components/connect-wallet/index.tsx (1)
20-20
: LGTM! Centralized app metadata improves consistency.The refactor to use a shared
appMetadata
constant eliminates duplication and ensures consistent branding across all wallet connection flows.Also applies to: 142-142, 280-280
apps/dashboard/src/@/components/blocks/BuyAndSwapEmbed.tsx (1)
7-7
: LGTM! Wallet customization support added correctly.The addition of the optional
wallets
prop and centralizedappMetadata
enables proper wallet list customization for the bridge flow, aligning with the PR objectives.Also applies to: 29-29, 40-40
size-limit report 📦
|
Merge activity
|
…#8270) <!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## PR-Codex overview This PR introduces a centralized `appMetadata` constant for consistent branding across various components and refactors the code to utilize this constant, reducing redundancy and improving maintainability. ### Detailed summary - Added `appMetadata` constant in `connect.ts`. - Refactored `NebulaConnectButton` to use `appMetadata`. - Updated `PageHeader` to include `wallets` prop in `PublicPageConnectButton`. - Created `bridgeWallets` array in `UniversalBridgeEmbed` using `createWallet` with `appMetadata`. - Modified multiple components to utilize `appMetadata` instead of hardcoded values. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Wallet selection is now customizable for Buy, Swap, and Bridge flows. * App branding metadata centralized for consistent presentation across all wallet connection points. * Bridge now includes preset wallet options to streamline onboarding and autoconnect behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
37a7820
to
3db3982
Compare
PR-Codex overview
This PR focuses on centralizing the
appMetadata
configuration by exporting it fromconnect.ts
, allowing various components to use a consistent metadata structure for wallet connections.Detailed summary
appMetadata
export inconnect.ts
.appMetadata
objects with the importedappMetadata
in multiple components:NebulaConnectButton.tsx
UniversalBridgeEmbed.tsx
CustomConnectWallet
PublicPageConnectButton
BuyAndSwapEmbed
Summary by CodeRabbit