Skip to content

Conversation

@ErwanDecoster
Copy link
Member

No description provided.

@vercel
Copy link

vercel bot commented Nov 26, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
explorer-v2 Ready Ready Preview Comment Dec 5, 2025 10:02am

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the account page to consolidate faucet, iExec account management, and wallet activity into a unified tabbed interface. The standalone faucet route has been removed and integrated as a tab within the account page.

Key Changes:

  • Moved faucet functionality from a separate route to a tab within the account page
  • Created reusable AddressTabsContent component to share address display logic between account and address pages
  • Refactored account management into separate module components (Faucet, ManageIexecAccount)

Reviewed changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
src/routes/$chainSlug/_layout/faucet.tsx Deleted - faucet moved to account page module
src/routes/$chainSlug/_layout/account.tsx Refactored to use tabbed interface with Faucet, Account, and Wallet Activity tabs
src/routes/$chainSlug/_layout/address/$addressAddress.tsx Refactored to use shared AddressTabsContent component
src/modules/addresses/address/AddressTabsContent.tsx New shared component extracting address tab rendering logic
src/modules/account/ManageIexecAccount.tsx New component containing iExec account management (formerly in account.tsx)
src/modules/account/Faucet.tsx New component for faucet functionality with updated UI
src/components/navbar/NavBar.tsx Updated navigation to use dropdown menu and link to account page tabs
src/components/ui/dropdown-menu.tsx New dropdown menu component for navbar user menu
src/utils/truncateAddress.ts Extended type definition to accept any number for truncation lengths
src/index.css Added Clerk themes import and updated card color variables
package.json Added @clerk/themes and @radix-ui/react-dropdown-menu dependencies

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

<div className="min-w-0 flex-1 overflow-x-auto">
{tabs[currentTab].component
? React.createElement(tabs[currentTab].component)
: null}
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

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

The conditional rendering tabs[currentTab].component ? React.createElement(tabs[currentTab].component) : null assumes all tabs have a component property, but the "Log out" tab (index 3) has an action property instead. This means if somehow currentTab becomes 3, nothing will render. Consider adding defensive logic or ensuring action-only tabs can't become the active tab.

Suggested change
: null}
: (
<div className="text-muted-foreground p-4">
Please select a valid tab.
</div>
)}

Copilot uses AI. Check for mistakes.
import {
SignedIn,
SignedOut,
SignIn,
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

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

The import uses SignIn from @clerk/clerk-react, but this component is typically named SignIn for the full component or you should use SignInButton for a button trigger. The usage on line 140 suggests a full SignIn component is intended, but verify this is the correct import name for the Clerk React library version being used.

Copilot uses AI. Check for mistakes.
</ChainLink>
</DropdownMenuItem>
<DropdownMenuItem>
<ChainLink to="/account?accountTab=Manage+iExec+Account">
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

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

The URL parameter accountTab=Manage+iExec+Account doesn't match any tab titleText in the account page. The tabs array in account.tsx (line 132-156) defines tabs with titleText values: 'Faucet', 'Account', 'Wallet Activity', and 'Log out'. The value "Manage+iExec+Account" (or "Manage iExec Account") is not in this list, which means clicking this link will not navigate to the correct tab.

Suggested change
<ChainLink to="/account?accountTab=Manage+iExec+Account">
<ChainLink to="/account?accountTab=Account">

Copilot uses AI. Check for mistakes.
Comment on lines +192 to +193
index === currentTab && 'bg-muted text-foreground'
)}
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

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

The active tab highlighting logic checks index === currentTab, but when a user clicks on a tab with an action (index 3, the "Log out" tab), the visual state will highlight that tab. Since logout is an action that shouldn't be a selectable tab, this creates a poor UX where the logout button appears selected. Consider excluding action-only tabs from the active state logic.

Copilot uses AI. Check for mistakes.
},
enabled: !!userAddress,
const avatarVisualBg = getAvatarVisualNumber({
address: userAddress,
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

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

The getAvatarVisualNumber function is called with userAddress which might be undefined (as seen in line 31 where it's typed as potentially undefined). While this is safe because the avatar display is conditionally rendered only when userAddress exists (line 172), consider adding a null check or default value for clarity and safety.

Suggested change
address: userAddress,
address: userAddress ?? '',

Copilot uses AI. Check for mistakes.
)}
/>
<span className="text-sm">
{truncateAddress(userAddress!, { startLen: 5, endLen: 3 })}
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

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

The truncateAddress is called with explicit options { startLen: 5, endLen: 3 }, but these values aren't part of the predefined union type in the updated truncateAddress function signature. While the function now accepts number as a type (line 4-5 of truncateAddress.ts), this creates inconsistency. Consider using the predefined values or documenting why custom values are needed here.

Suggested change
{truncateAddress(userAddress!, { startLen: 5, endLen: 3 })}
{truncateAddress(userAddress!, { startLen: 4, endLen: 2 })}

Copilot uses AI. Check for mistakes.
if (!bridge && currentTab === 2) {
setCurrentTab(1);
}
}, [chainId]);
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

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

The useEffect has a missing dependency setCurrentTab. The React Hook useEffect has a missing dependency warning will be triggered. Either add setCurrentTab to the dependency array or wrap it in a useCallback if it's coming from props/state.

Suggested change
}, [chainId]);
}, [chainId, setCurrentTab]);

Copilot uses AI. Check for mistakes.
Comment on lines +77 to +78

return response.json();
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

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

The watchAsset call is missing after a successful response. In the original faucet route implementation (lines 83-90 of the deleted file), watchAsset was called immediately after a successful response. This call has been removed in the refactored version, which changes the user experience. The addTokenToWallet mutation now handles this separately, but it's only triggered manually by the user clicking a button.

Copilot uses AI. Check for mistakes.
Comment on lines +163 to +168
if (tab.action) {
tab.action();
} else {
setCurrentTab(tabIndex);
}
}, [chainId]);

if (!userAddress) {
return (
<div className="mt-20 flex flex-col items-center justify-center gap-6 text-center">
<h1 className="text-2xl font-bold">You are not connected</h1>
<p className="text-muted-foreground max-w-sm">
To access the iExec Wallet Manager, please connect your wallet.
</p>
<div className="flex gap-4">
<Button variant="outline">
<ChainLink to="/">Go back home</ChainLink>
</Button>
<Button onClick={login}>Connect wallet</Button>
</div>
</div>
);
}
};
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

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

The tab action execution logic allows clicking on tabs with actions (like "Log out"), but this will cause the tab index to be set to the logout tab index when tab.action exists but before the action runs. This could result in incorrect UI state if the action doesn't immediately remove the component (e.g., logout might have a delay). Consider not calling setCurrentTab when an action exists, or resetting the tab after action completes.

Copilot uses AI. Check for mistakes.
{tabs[currentTab].steps[currentStep]?.content}
</>
)}
{tabs[currentTab]?.content && tabs[currentTab].content}
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

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

Operands tabs[cu ... content and tabs[cu ... content are identical.

Suggested change
{tabs[currentTab]?.content && tabs[currentTab].content}
{tabs[currentTab]?.content}

Copilot uses AI. Check for mistakes.
Copy link

@SeddikBellamine SeddikBellamine left a comment

Choose a reason for hiding this comment

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

LGTM! nicely done

@ErwanDecoster ErwanDecoster merged commit 74e76bf into main Dec 5, 2025
4 checks passed
@ErwanDecoster ErwanDecoster deleted the feature/update-account branch December 5, 2025 10:06
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.

3 participants