Skip to content

Conversation

@MananTank
Copy link
Member

@MananTank MananTank commented Oct 17, 2025


PR-Codex overview

This PR focuses on enhancing the WalletAddress and WalletAddressUI components by improving their handling of social profiles, updating props, and modifying the UI for better user experience.

Detailed summary

  • Changed retry option in useSocialProfiles from 3 to false.
  • Added new Storybook stories for WalletAddress and WalletAddressUI.
  • Refactored WalletAddress to use useSocialProfiles directly.
  • Updated WalletAddressUI to accept profiles as props.
  • Improved UI structure and styling for displaying social profiles.

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

Summary by CodeRabbit

  • New Features

    • Added Storybook examples showcasing Wallet Address states (loaded, loading, empty, invalid, zero address, ENS)
  • Refactor

    • Split wallet address into a focused UI component and a thin entry wrapper; profile data is now passed in as props
    • Replaced bespoke clipboard handling with a unified copy control and adjusted hover/card layout and profile presentation
  • Bug Fixes / Behavior

    • Disabled automatic retry for profile loading to surface empty/error states sooner

@vercel
Copy link

vercel bot commented Oct 17, 2025

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

Project Deployment Preview Comments Updated (UTC)
docs-v2 Ready Ready Preview Comment Oct 19, 2025 11:12am
nebula Ready Ready Preview Comment Oct 19, 2025 11:12am
thirdweb_playground Ready Ready Preview Comment Oct 19, 2025 11:12am
thirdweb-www Ready Ready Preview Comment Oct 19, 2025 11:12am
wallet-ui Ready Ready Preview Comment Oct 19, 2025 11:12am

💡 Enable Vercel Agent with $100 free credit for automated AI reviews

@linear
Copy link

linear bot commented Oct 17, 2025

@changeset-bot
Copy link

changeset-bot bot commented Oct 17, 2025

⚠️ No Changeset found

Latest commit: 1e7df5a

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

@github-actions github-actions bot added Dashboard Involves changes to the Dashboard. packages SDK Involves changes to the thirdweb SDK labels Oct 17, 2025
@MananTank MananTank marked this pull request as ready for review October 17, 2025 18:20
@MananTank MananTank requested review from a team as code owners October 17, 2025 18:20
Copy link
Member Author

MananTank commented Oct 17, 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.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 17, 2025

Walkthrough

Split WalletAddress into a data-fetching wrapper and a presentation component, moved social-profile fetching into the wrapper, replaced clipboard logic with CopyTextButton, added a Storybook story for multiple states, and disabled React Query retries in useSocialProfiles.

Changes

Cohort / File(s) Change Summary
WalletAddress refactor
apps/dashboard/src/@/components/blocks/wallet-address.tsx
Introduced WalletAddressProps type; split into WalletAddress (fetches social profiles via hook and passes profiles down) and WalletAddressUI (presentation). Removed internal clipboard handling and icons, replaced with CopyTextButton. Profile rendering now driven by profiles.data with loading skeletons and empty state; UI/layout and labels adjusted.
Storybook stories
apps/dashboard/src/@/components/blocks/wallet-address.stories.tsx
Added new Storybook story module exporting meta and Variants story. Demonstrates multiple states (loaded ENS/Farcaster fixture vitalikEth, no profiles, loading, zero/invalid address, and a real example).
Social profiles hook
packages/thirdweb/src/react/core/social/useSocialProfiles.ts
Changed React Query retry policy from 3 to false, disabling automatic retries on failure.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant WalletAddress
    participant useSocialProfiles
    participant WalletAddressUI
    participant Browser

    User->>WalletAddress: provide address & client
    WalletAddress->>useSocialProfiles: request profiles
    useSocialProfiles-->>WalletAddress: return { data, isPending }

    WalletAddress->>WalletAddressUI: pass address, client, profiles

    alt profiles.isPending
        WalletAddressUI->>Browser: render loading skeletons
    else profiles.data.length > 0
        WalletAddressUI->>Browser: render profiles (avatar, name, type)
    else
        WalletAddressUI->>Browser: render "No profiles found"
    end

    Browser->>User: display WalletAddress UI
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Pre-merge checks and finishing touches

❌ Failed checks (3 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Linked Issues Check ⚠️ Warning The pull request does not meet the primary objective from linked issue MNY-252. The requirement explicitly states "never truncate" and to "show full address," but the change summary indicates "Address display shortened form logic remains, using shortenedAddress derived from address prop." This means the component still supports truncated/shortened address display, directly contradicting the stated requirement from the issue. The refactoring improves the component's UI structure and prop handling but fails to implement the core requirement of removing truncation. Modify the WalletAddress and WalletAddressUI components to always display the full address and remove or disable the shortened address logic. Either remove the shortenAddress parameter from the component props if it should no longer be used, or ensure that when the component is rendered, it defaults to and only shows the full address format. Verify that the Storybook stories accurately demonstrate this behavior with full addresses displayed in all variants.
Description Check ⚠️ Warning The pull request description does not follow the required template structure from the repository. While it includes a helpful PR-Codex auto-generated summary of changes, the description lacks the explicit sections specified in the template: there is no dedicated "Notes for the reviewer" section, no "How to test" section, and the issue tag is in the title but not explicitly restated in the description body as requested. The template's structural guidance is not adhered to. Update the PR description to follow the repository's template. Explicitly include a "Notes for the reviewer" section highlighting any important considerations or potential concerns, and add a "How to test" section with specific testing instructions (e.g., unit tests, Storybook verification, or manual testing steps). This will ensure reviewers have clear guidance on what to validate and how to test the changes.
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Out of Scope Changes Check ❓ Inconclusive The pull request includes a change to the retry behavior in useSocialProfiles that appears to be out of scope from the linked objective. The modification changes the retry policy from 3 retries to disabled retries (retry: false), which is not directly related to the requirement to show full addresses in the WalletAddress component. While the Storybook stories and component refactoring are clearly within scope for a UI component update, the retry behavior change lacks clear justification in the context of the stated objective and may represent an unrelated fix. Clarify the intent behind the retry behavior change in useSocialProfiles. If this change is necessary to support the WalletAddress refactoring or improves component reliability, include an explanation in the PR description or code comments. If it is an unrelated improvement, consider moving it to a separate PR to keep the changeset focused on the primary objective. Ensure all changes are intentional and justified within the scope of MNY-252.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title "[MNY-252] Dashboard: Update WalletAddress component UI" is partially related to the changeset. It accurately reflects that the PR refactors the WalletAddress component's UI, but it does not capture the specific and primary objective from the linked issue MNY-252, which explicitly states "never truncate" and requires showing the full address. The title is generic and could apply to many UI updates without conveying the main requirement the developer was addressing.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch mny-252

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.

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 17, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 64.51 KB (0%) 1.3 s (0%) 341 ms (+139.41% 🔺) 1.7 s
thirdweb (cjs) 365.68 KB (0%) 7.4 s (0%) 1.6 s (+5.26% 🔺) 8.9 s
thirdweb (minimal + tree-shaking) 5.73 KB (0%) 115 ms (0%) 85 ms (+940.65% 🔺) 200 ms
thirdweb/chains (tree-shaking) 526 B (0%) 11 ms (0%) 66 ms (+1839.06% 🔺) 76 ms
thirdweb/react (minimal + tree-shaking) 19.13 KB (0%) 383 ms (0%) 145 ms (+1601.18% 🔺) 528 ms

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/dashboard/src/@/components/blocks/wallet-address.tsx (1)

57-64: Requirement mismatch: “never truncate” — stop shortening and remove CSS ellipsis.

Address is still sliced and visually truncated. Show the full address everywhere (including zero address), and allow wrapping instead of ellipsis.

-  const [shortenedAddress, _lessShortenedAddress] = useMemo(() => {
-    return [
-      props.shortenAddress !== false
-        ? `${address.slice(0, 6)}...${address.slice(-4)}`
-        : address,
-      `${address.slice(0, 14)}...${address.slice(-12)}`,
-    ];
-  }, [address, props.shortenAddress]);
+  // Dashboard requirement: always show full address (no truncation)
+  const displayAddress = address;
@@
   if (address === ZERO_ADDRESS) {
     return (
       <div className="flex items-center gap-2 py-2">
         <CircleSlashIcon
           className={cn("size-5 text-muted-foreground/70", props.iconClassName)}
         />
         <span
-          className={cn("cursor-pointer font-mono text-sm", props.className)}
+          className={cn("cursor-pointer font-mono text-sm break-all", props.className)}
         >
-          {shortenedAddress}
+          {displayAddress}
         </span>
       </div>
     );
   }
@@
-        <Button
+        <Button
           className={cn(
-            "flex flex-row items-center gap-2 px-0 max-w-full truncate",
+            "flex flex-row items-center gap-2 px-0 max-w-full",
             props.className,
           )}
           onClick={(e) => e.stopPropagation()}
           variant="link"
         >
@@
-          <span className="cursor-pointer font-mono max-w-full truncate">
-            {props.profiles.data?.[0]?.name || shortenedAddress}
+          <span className="cursor-pointer font-mono break-all">
+            {displayAddress}
           </span>

Based on objectives.

Also applies to: 82-91, 100-106, 115-117

🧹 Nitpick comments (2)
apps/dashboard/src/@/components/blocks/wallet-address.stories.tsx (1)

7-16: Meta.component is set to the Story wrapper; consider pointing to WalletAddressUI for better autodocs/controls.

Non-blocking, but using the component improves args tables and controls.

-const meta = {
-  component: Story,
+const meta = {
+  component: WalletAddressUI,
   parameters: {
     nextjs: { appDirectory: true },
   },
   title: "blocks/WalletAddress",
 } satisfies Meta<typeof Story>;
apps/dashboard/src/@/components/blocks/wallet-address.tsx (1)

156-163: Key stability for mapped profiles.

key={profile.type + profile.name} can collide when name is undefined or repeated. Prefer a more stable key.

-                    <div
-                      className="flex flex-row items-center gap-3 py-2"
-                      key={profile.type + profile.name}
-                    >
+                    <div
+                      className="flex flex-row items-center gap-3 py-2"
+                      key={`${profile.type}:${profile.name ?? profile.avatar ?? profile.bio ?? Math.random()}`}
+                    >

Alternatively, include an index as a suffix if no unique field is guaranteed.

Also applies to: 174-179

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

📥 Commits

Reviewing files that changed from the base of the PR and between db291d2 and 832d5ca.

📒 Files selected for processing (3)
  • apps/dashboard/src/@/components/blocks/wallet-address.stories.tsx (1 hunks)
  • apps/dashboard/src/@/components/blocks/wallet-address.tsx (3 hunks)
  • packages/thirdweb/src/react/core/social/useSocialProfiles.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (8)
**/*.{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 local types.ts barrels
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown 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
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown 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:

  • packages/thirdweb/src/react/core/social/useSocialProfiles.ts
  • apps/dashboard/src/@/components/blocks/wallet-address.tsx
  • apps/dashboard/src/@/components/blocks/wallet-address.stories.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)

Files:

  • packages/thirdweb/src/react/core/social/useSocialProfiles.ts
  • apps/dashboard/src/@/components/blocks/wallet-address.tsx
  • apps/dashboard/src/@/components/blocks/wallet-address.stories.tsx
packages/thirdweb/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

packages/thirdweb/**/*.{ts,tsx}: Every public symbol must have comprehensive TSDoc with at least one compiling @example and a custom tag (@beta, @internal, @experimental, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose
Lazy‑load heavy dependencies inside async paths (e.g., const { jsPDF } = await import("jspdf"))

Files:

  • packages/thirdweb/src/react/core/social/useSocialProfiles.ts
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
Use NavLink for internal navigation with automatic active states in dashboard and playground apps
Use Tailwind CSS only – no inline styles or CSS modules
Use cn() 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 with import "server-only";
Client Components (browser): Begin files with 'use client';
Always call getAuthToken() to retrieve JWT from cookies on server side
Use Authorization: Bearer header – never embed tokens in URLs
Return typed results (e.g., Project[], User[]) – avoid any
Wrap client-side data fetching calls in React Query (@tanstack/react-query)
Use descriptive, stable queryKeys for React Query cache hits
Configure staleTime/cacheTime in React Query based on freshness (default ≥ 60s)
Keep tokens secret via internal API routes or server actions
Never import posthog-js in server components

Files:

  • apps/dashboard/src/@/components/blocks/wallet-address.tsx
  • apps/dashboard/src/@/components/blocks/wallet-address.stories.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)
Use NavLink for internal navigation to get active state handling
Use Tailwind CSS for styling; no inline styles
Merge class names with cn() from @/lib/utils for conditional classes
Stick to design tokens (e.g., bg-card, border-border, text-muted-foreground)
Server Components must start with import "server-only"; use next/headers, server‑only env, heavy data fetching, and redirect() where appropriate
Client Components must start with 'use client'; handle interactivity with hooks and browser APIs
Server-side data fetching: call getAuthToken() from cookies, send Authorization: Bearer <token> header, and return typed results (avoid any)
Client-side data fetching: wrap calls in React Query with descriptive, stable queryKeys and set sensible staleTime/cacheTime (≥ 60s default); keep tokens secret via internal routes or server actions
Do not import posthog-js in server components (client-side only)

Files:

  • apps/dashboard/src/@/components/blocks/wallet-address.tsx
  • apps/dashboard/src/@/components/blocks/wallet-address.stories.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/blocks/wallet-address.tsx
  • apps/dashboard/src/@/components/blocks/wallet-address.stories.tsx
**/*.stories.tsx

📄 CodeRabbit inference engine (CLAUDE.md)

For new UI components, add Storybook stories (*.stories.tsx) alongside the code

Files:

  • apps/dashboard/src/@/components/blocks/wallet-address.stories.tsx
apps/{dashboard,playground}/**/*.stories.tsx

📄 CodeRabbit inference engine (AGENTS.md)

Add Storybook stories (*.stories.tsx) alongside new UI components

Files:

  • apps/dashboard/src/@/components/blocks/wallet-address.stories.tsx
🧠 Learnings (2)
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to apps/{dashboard,playground}/**/*.stories.tsx : Add Storybook stories (`*.stories.tsx`) alongside new UI components

Applied to files:

  • apps/dashboard/src/@/components/blocks/wallet-address.stories.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/components/*.{stories,test}.{tsx,ts} : Provide a Storybook story (`MyComponent.stories.tsx`) or unit test alongside the component.

Applied to files:

  • apps/dashboard/src/@/components/blocks/wallet-address.stories.tsx
🧬 Code graph analysis (2)
apps/dashboard/src/@/components/blocks/wallet-address.tsx (4)
apps/nebula/src/@/components/blocks/wallet-address.tsx (1)
  • WalletAddress (20-173)
packages/thirdweb/src/react/core/social/useSocialProfiles.ts (1)
  • useSocialProfiles (24-42)
apps/dashboard/src/@/components/ui/CopyTextButton.tsx (1)
  • CopyTextButton (9-68)
apps/playground-web/src/app/ai/components/resolveSchemeWithErrorHandler.ts (1)
  • resolveSchemeWithErrorHandler (4-21)
apps/dashboard/src/@/components/blocks/wallet-address.stories.tsx (2)
packages/ui/src/storybook/utils.tsx (1)
  • BadgeContainer (14-24)
apps/dashboard/src/@/components/blocks/wallet-address.tsx (2)
  • WalletAddressUI (46-190)
  • WalletAddress (29-44)
⏰ 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). (2)
  • GitHub Check: Unit Tests
  • GitHub Check: Size
🔇 Additional comments (1)
apps/dashboard/src/@/components/blocks/wallet-address.tsx (1)

17-19: UI polish: Skeleton import is local; ensure consistent UI primitive usage.

Looks good—using our shared Skeleton in Dashboard meets the design system guidance.

@codecov
Copy link

codecov bot commented Oct 19, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 54.90%. Comparing base (ca16ec7) to head (1e7df5a).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...hirdweb/src/react/core/social/useSocialProfiles.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8276   +/-   ##
=======================================
  Coverage   54.90%   54.90%           
=======================================
  Files         919      919           
  Lines       60622    60622           
  Branches     4116     4118    +2     
=======================================
  Hits        33282    33282           
- Misses      27239    27240    +1     
+ Partials      101      100    -1     
Flag Coverage Δ
packages 54.90% <0.00%> (ø)
Files with missing lines Coverage Δ
...hirdweb/src/react/core/social/useSocialProfiles.ts 15.78% <0.00%> (ø)

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

<!--

## 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 focuses on enhancing the `WalletAddress` component and its UI by improving the handling of social profiles, adding new story variants, and refining the UI elements for better user experience.

### Detailed summary
- Changed `retry` in `useSocialProfiles` from `3` to `false`.
- Added new Storybook stories for `WalletAddress` and `WalletAddressUI`.
- Introduced a `Skeleton` component for loading states.
- Refactored `WalletAddress` to use `useSocialProfiles` directly.
- Updated UI structure and styling for displaying social profiles.
- Improved the handling of address display and copy functionality.

> ✨ 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**
  * Added Storybook examples showcasing Wallet Address states (loaded, loading, empty, invalid, zero address, ENS)

* **Refactor**
  * Split wallet address UI for clearer rendering and moved profile-driven rendering to a dedicated UI component
  * Updated copy button styling to use a unified copy control
  * Improved social profiles panel layout and presentation

* **Bug Fixes / Behavior**
  * Adjusted profile loading behavior to avoid automatic retry on failure, surfacing empty/error states sooner
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@graphite-app
Copy link
Contributor

graphite-app bot commented Oct 19, 2025

Merge activity

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/dashboard/src/@/components/blocks/wallet-address.tsx (1)

57-64: Address truncation contradicts PR objective.

The PR objective explicitly states: "show full address (do not truncate)" with a directive from @jake: "never truncate." However, the code still truncates by default when shortenAddress is undefined or true.

If the objective is to never truncate, consider either:

  1. Changing the default to shortenAddress === true (opt-in truncation), or
  2. Removing the shortenAddress prop entirely and always showing the full address

Apply this diff to default to showing the full address:

     return [
-      props.shortenAddress !== false
+      props.shortenAddress === true
         ? `${address.slice(0, 6)}...${address.slice(-4)}`
         : address,
       `${address.slice(0, 14)}...${address.slice(-12)}`,
     ];
♻️ Duplicate comments (4)
apps/dashboard/src/@/components/blocks/wallet-address.tsx (3)

97-97: Keyboard accessibility: button is unfocusable.

This issue was already flagged in a previous review. tabIndex={-1} on the HoverCardTrigger makes the button unfocusable for keyboard users, preventing them from opening the HoverCard via keyboard navigation.


36-43: Error state not surfaced to UI.

This issue was already flagged in a previous review. The wrapper only passes data and isPending to WalletAddressUI, dropping isError and error. With retries now disabled in useSocialProfiles, transient failures will appear as "No profiles found" instead of showing an error state.


144-148: Error state indistinguishable from empty state.

This issue was already flagged in a previous review. The UI only checks isPending and empty data, but doesn't render an error state when profile fetching fails. Users will see "No profiles found" for both actual empty results and network failures.

packages/thirdweb/src/react/core/social/useSocialProfiles.ts (1)

40-40: Disabling retries violates coding guidelines and degrades UX.

This change is already flagged in a previous review. Setting retry: false causes transient network failures to immediately surface as empty data, and with error state not being surfaced in the UI (see wallet-address.tsx), users will see "No profiles found" on temporary network issues.

Additionally, this violates the coding guidelines which require configuring staleTime/cacheTime in React Query (default ≥ 60s).

As per coding guidelines.

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

📥 Commits

Reviewing files that changed from the base of the PR and between da718f9 and 1e7df5a.

📒 Files selected for processing (3)
  • apps/dashboard/src/@/components/blocks/wallet-address.stories.tsx (1 hunks)
  • apps/dashboard/src/@/components/blocks/wallet-address.tsx (3 hunks)
  • packages/thirdweb/src/react/core/social/useSocialProfiles.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/dashboard/src/@/components/blocks/wallet-address.stories.tsx
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{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 local types.ts barrels
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown 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
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown 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/blocks/wallet-address.tsx
  • packages/thirdweb/src/react/core/social/useSocialProfiles.ts
**/*.{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/blocks/wallet-address.tsx
  • packages/thirdweb/src/react/core/social/useSocialProfiles.ts
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
Use NavLink for internal navigation with automatic active states in dashboard and playground apps
Use Tailwind CSS only – no inline styles or CSS modules
Use cn() 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 with import "server-only";
Client Components (browser): Begin files with 'use client';
Always call getAuthToken() to retrieve JWT from cookies on server side
Use Authorization: Bearer header – never embed tokens in URLs
Return typed results (e.g., Project[], User[]) – avoid any
Wrap client-side data fetching calls in React Query (@tanstack/react-query)
Use descriptive, stable queryKeys for React Query cache hits
Configure staleTime/cacheTime in React Query based on freshness (default ≥ 60s)
Keep tokens secret via internal API routes or server actions
Never import posthog-js in server components

Files:

  • apps/dashboard/src/@/components/blocks/wallet-address.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)
Use NavLink for internal navigation to get active state handling
Use Tailwind CSS for styling; no inline styles
Merge class names with cn() from @/lib/utils for conditional classes
Stick to design tokens (e.g., bg-card, border-border, text-muted-foreground)
Server Components must start with import "server-only"; use next/headers, server‑only env, heavy data fetching, and redirect() where appropriate
Client Components must start with 'use client'; handle interactivity with hooks and browser APIs
Server-side data fetching: call getAuthToken() from cookies, send Authorization: Bearer <token> header, and return typed results (avoid any)
Client-side data fetching: wrap calls in React Query with descriptive, stable queryKeys and set sensible staleTime/cacheTime (≥ 60s default); keep tokens secret via internal routes or server actions
Do not import posthog-js in server components (client-side only)

Files:

  • apps/dashboard/src/@/components/blocks/wallet-address.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/blocks/wallet-address.tsx
packages/thirdweb/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

packages/thirdweb/**/*.{ts,tsx}: Every public symbol must have comprehensive TSDoc with at least one compiling @example and a custom tag (@beta, @internal, @experimental, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose
Lazy‑load heavy dependencies inside async paths (e.g., const { jsPDF } = await import("jspdf"))

Files:

  • packages/thirdweb/src/react/core/social/useSocialProfiles.ts
🧬 Code graph analysis (1)
apps/dashboard/src/@/components/blocks/wallet-address.tsx (3)
packages/thirdweb/src/react/core/social/useSocialProfiles.ts (1)
  • useSocialProfiles (24-42)
apps/dashboard/src/@/components/ui/CopyTextButton.tsx (1)
  • CopyTextButton (9-68)
apps/playground-web/src/app/ai/components/resolveSchemeWithErrorHandler.ts (1)
  • resolveSchemeWithErrorHandler (4-21)
⏰ 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). (8)
  • GitHub Check: Lint Packages
  • GitHub Check: Size
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: Unit Tests
  • GitHub Check: Build Packages
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (2)
apps/dashboard/src/@/components/blocks/wallet-address.tsx (2)

131-138: Good refactor to use shared CopyTextButton.

Replacing inline clipboard logic with the reusable CopyTextButton component improves consistency and maintainability.


150-183: Profile rendering logic is well-structured.

The profile mapping and avatar resolution logic is clean and handles edge cases appropriately with the error handler.

}) {
};

export function WalletAddress(props: WalletAddressProps) {
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Add explicit return types to exported functions.

Both WalletAddress and WalletAddressUI are missing explicit return types. Coding guidelines require explicit return types for all function declarations in TypeScript.

Apply this diff:

-export function WalletAddress(props: WalletAddressProps) {
+export function WalletAddress(props: WalletAddressProps): JSX.Element {
 export function WalletAddressUI(
   props: WalletAddressProps & {
     profiles: {
       data: SocialProfile[];
       isPending: boolean;
     };
   },
-) {
+): JSX.Element {

As per coding guidelines.

Also applies to: 46-46

🤖 Prompt for AI Agents
In apps/dashboard/src/@/components/blocks/wallet-address.tsx around lines 29 and
46, the exported functions WalletAddress and WalletAddressUI lack explicit
return types; add explicit TypeScript return annotations (e.g., : JSX.Element or
: React.ReactElement) to both function declarations so they conform to the
coding guideline for exported functions, ensuring imports for React types exist
if needed.

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. packages SDK Involves changes to the thirdweb SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants