Skip to content

Dashboard: Migrate contract/accounts page from chakra to tailwind #7739

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

MananTank
Copy link
Member

@MananTank MananTank commented Jul 28, 2025


PR-Codex overview

This PR focuses on refactoring and updating components within the accounts section of a dashboard application, enhancing the UI and functionality, and removing deprecated elements.

Detailed summary

  • Deleted accounts-count.tsx and Legacy_CopyButton from chakra/button.
  • Replaced LinkButton with a new structure in AccountsPage.
  • Updated CreateAccountButton to use new imports and props.
  • Refactored AccountsTable to improve pagination and UI elements.
  • Introduced SkeletonRow for loading states in tables.

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

Summary by CodeRabbit

  • Refactor

    • Simplified the Accounts page layout and styling by switching from Chakra UI to Tailwind CSS.
    • Streamlined the AccountsTable with a new table design, fixed page size, and updated pagination controls.
    • Updated Create Account button with unified styling, improved labeling, and a new icon.
    • Removed the accounts count display from the page.
    • Updated external documentation link and link styling for clarity.
    • Removed legacy copy button component and related clipboard functionality.
  • Style

    • Improved visual consistency with updated button and table styles.

@vercel vercel bot temporarily deployed to Preview – nebula July 28, 2025 18:49 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 July 28, 2025 18:49 Inactive
Copy link

vercel bot commented Jul 28, 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 Jul 29, 2025 5:45pm
4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Skipped (Inspect) Jul 29, 2025 5:45pm
nebula ⬜️ Skipped (Inspect) Jul 29, 2025 5:45pm
thirdweb_playground ⬜️ Skipped (Inspect) Jul 29, 2025 5:45pm
wallet-ui ⬜️ Skipped (Inspect) Jul 29, 2025 5:45pm

@vercel vercel bot temporarily deployed to Preview – thirdweb_playground July 28, 2025 18:49 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui July 28, 2025 18:49 Inactive
Copy link

changeset-bot bot commented Jul 28, 2025

⚠️ No Changeset found

Latest commit: 5e883ac

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
Contributor

coderabbitai bot commented Jul 28, 2025

Walkthrough

The Accounts section of the dashboard was refactored to replace Chakra UI components and styles with Tailwind CSS and custom UI elements. The AccountsPage and related components were simplified, with the removal of the accounts count display and a new approach to table rendering and pagination. Button and link styles were unified, and several components were restructured for consistency. Additionally, a legacy copy button component was removed from the Chakra UI button utilities.

Changes

Cohort / File(s) Change Summary
Accounts Page Refactor
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/AccountsPage.tsx
Refactored from Chakra UI and explicit props interface to a plain function using Tailwind CSS. Removed AccountsCount and Chakra UI components. Updated documentation link and header layout. Props are now passed as a single object.
Accounts Count Removal
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/components/accounts-count.tsx
Deleted the AccountsCount component, which previously displayed the total number of accounts using a contract read hook and a stat card.
Accounts Table Refactor
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/components/accounts-table.tsx
Refactored table rendering from Chakra UI and TanStack Table to custom UI components and Tailwind CSS. Pagination simplified to a fixed page size and a single pagination component. Navigation now uses external links. Loading and empty states updated.
Create Account Button Refactor
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/components/create-account-button.tsx
Refactored from a React.FC with explicit props to a function with inline typing. Simplified imports, unified button styling, and updated prop passing. Added an icon and made the button label consistent.
Legacy Copy Button Removal
apps/dashboard/src/chakra/button.tsx
Removed the Legacy_CopyButton component and its props interface, along with related imports for icons and clipboard hook.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

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.
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 07-29-dashboard_migrate_contract_accounts_page_from_chakra_to_tailwind

🪧 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 generate unit tests to generate unit tests for 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.

@github-actions github-actions bot added the Dashboard Involves changes to the Dashboard. label Jul 28, 2025
@MananTank MananTank marked this pull request as ready for review July 28, 2025 18:49
@MananTank MananTank requested review from a team as code owners July 28, 2025 18:49
Copy link
Member Author

MananTank commented Jul 28, 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.

Copy link

codecov bot commented Jul 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.42%. Comparing base (c717eaa) to head (5e883ac).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7739   +/-   ##
=======================================
  Coverage   56.42%   56.42%           
=======================================
  Files         904      904           
  Lines       58665    58665           
  Branches     4135     4135           
=======================================
  Hits        33100    33100           
  Misses      25460    25460           
  Partials      105      105           
Flag Coverage Δ
packages 56.42% <ø> (ø)
🚀 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.

Copy link
Contributor

github-actions bot commented Jul 28, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 63.16 KB (0%) 1.3 s (0%) 145 ms (+93.48% 🔺) 1.5 s
thirdweb (cjs) 352.91 KB (0%) 7.1 s (0%) 626 ms (+2.65% 🔺) 7.7 s
thirdweb (minimal + tree-shaking) 5.7 KB (0%) 114 ms (0%) 42 ms (+975.05% 🔺) 156 ms
thirdweb/chains (tree-shaking) 526 B (0%) 11 ms (0%) 6 ms (+287.9% 🔺) 17 ms
thirdweb/react (minimal + tree-shaking) 19.24 KB (0%) 385 ms (0%) 50 ms (+310.29% 🔺) 435 ms

Base automatically changed from 07-28-dashboard_published_contract_page_ui_improvements_fix_audit_link to main July 28, 2025 18:59
@graphite-app graphite-app bot force-pushed the 07-29-dashboard_migrate_contract_accounts_page_from_chakra_to_tailwind branch from 566daaf to ec03247 Compare July 28, 2025 19:00
@vercel vercel bot temporarily deployed to Preview – docs-v2 July 28, 2025 19:01 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground July 28, 2025 19:01 Inactive
@vercel vercel bot temporarily deployed to Preview – nebula July 28, 2025 19:01 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui July 28, 2025 19:01 Inactive
@MananTank MananTank force-pushed the 07-29-dashboard_migrate_contract_accounts_page_from_chakra_to_tailwind branch from ec03247 to c8b58f6 Compare July 28, 2025 20:19
@vercel vercel bot temporarily deployed to Preview – docs-v2 July 28, 2025 20:19 Inactive
@vercel vercel bot temporarily deployed to Preview – nebula July 28, 2025 20:19 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui July 28, 2025 20:19 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground July 28, 2025 20:19 Inactive
Copy link
Contributor

graphite-app bot commented Jul 29, 2025

Merge activity

)

<!--

## 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 refactoring components in the `accounts` section of the dashboard, enhancing code structure and UI elements while removing deprecated features.

### Detailed summary
- Deleted the `accounts-count.tsx` file.
- Removed `Legacy_CopyButton` and its usage.
- Updated `AccountsPage` to use `UnderlineLink` and improved layout.
- Refactored `CreateAccountButton` to streamline props handling.
- Replaced `TWTable` with custom table components in `AccountsTable`.
- Added pagination functionality and improved loading states.

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

* **Refactor**
  * Simplified the Accounts page layout and styling by switching from Chakra UI to Tailwind CSS.
  * Streamlined the AccountsTable with a new table design, fixed page size, and updated pagination controls.
  * Updated Create Account button with unified styling, improved labeling, and a new icon.
  * Removed the accounts count display from the page.
  * Updated external documentation link and link styling for clarity.
  * Removed legacy copy button component and related clipboard functionality.

* **Style**
  * Improved visual consistency with updated button and table styles.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@graphite-app graphite-app bot force-pushed the 07-29-dashboard_migrate_contract_accounts_page_from_chakra_to_tailwind branch from f119804 to 5e883ac Compare July 29, 2025 17:36
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground July 29, 2025 17:36 Inactive
@vercel vercel bot temporarily deployed to Preview – nebula July 29, 2025 17:36 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 July 29, 2025 17:36 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui July 29, 2025 17:36 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: 1

🧹 Nitpick comments (4)
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/components/accounts-table.tsx (4)

25-25: Consider making page size configurable.

The hardcoded page size of 10 removes flexibility. While this simplifies the implementation, consider whether users might benefit from different page sizes or if this should be a configurable constant.

- const pageSize = 10;
+ const PAGE_SIZE = 10; // or make this configurable via props

32-32: Add explicit return type annotation.

Following TypeScript best practices, add an explicit return type for better type safety and documentation.

- export function AccountsTable({ contract, projectMeta }: AccountsTableProps) {
+ export function AccountsTable({ contract, projectMeta }: AccountsTableProps): JSX.Element {

106-113: Remove redundant z-index styling.

The z-10 relative classes on the CopyTextButton are unnecessary complexity when using the linkBox pattern and may not work as intended with the current structure.

<CopyTextButton
  textToShow={account}
  textToCopy={account}
  variant="ghost"
  tooltip="Copy account address"
  copyIconPosition="right"
- className="z-10 relative"
/>

144-152: Consider making skeleton width responsive.

The hardcoded skeleton width w-[364px] may not work well on all screen sizes. Consider using a responsive approach.

function SkeletonRow() {
  return (
    <TableRow>
      <TableCell className="py-6">
-       <Skeleton className="h-6 w-[364px]" />
+       <Skeleton className="h-6 w-full max-w-[364px]" />
      </TableCell>
    </TableRow>
  );
}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between f119804 and 5e883ac.

📒 Files selected for processing (5)
  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/AccountsPage.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/components/accounts-count.tsx (0 hunks)
  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/components/accounts-table.tsx (3 hunks)
  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/components/create-account-button.tsx (3 hunks)
  • apps/dashboard/src/chakra/button.tsx (1 hunks)
💤 Files with no reviewable changes (1)
  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/components/accounts-count.tsx
🚧 Files skipped from review as they are similar to previous changes (3)
  • apps/dashboard/src/chakra/button.tsx
  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/AccountsPage.tsx
  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/components/create-account-button.tsx
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{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

Files:

  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/components/accounts-table.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/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/components/accounts-table.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
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/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/components/accounts-table.tsx
🧠 Learnings (2)
📓 Common learnings
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/**/*.{tsx,jsx} : Tailwind CSS is the styling system – avoid inline styles or CSS modules.
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/**/*client.tsx : Interactive UI that relies on hooks (`useState`, `useEffect`, React Query, wallet hooks).
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/**/*.{tsx,jsx} : Prefer composable primitives over custom markup: `Button`, `Input`, `Select`, `Tabs`, `Card`, `Sidebar`, `Separator`, `Badge`.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Use Tailwind CSS only – no inline styles or CSS modules
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Surface breaking changes prominently in PR descriptions
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to 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
Learnt from: jnsdls
PR: thirdweb-dev/js#7188
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/components/accounts-count.tsx:15-15
Timestamp: 2025-05-29T00:46:09.063Z
Learning: In the accounts component at apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/components/accounts-count.tsx, the 3-column grid layout (md:grid-cols-3) is intentionally maintained even when rendering only one StatCard, as part of the design structure for this component.
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/**/*.{tsx,jsx} : Reuse core UI primitives; avoid re-implementing buttons, cards, modals.
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/**/*.{tsx,jsx} : Stick to design-tokens: background (`bg-card`), borders (`border-border`), muted text (`text-muted-foreground`) etc.
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/**/*.{tsx,jsx} : Never hard-code colors – always go through Tailwind variables.
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/**/*.{tsx,jsx} : Use `NavLink` (`@/components/ui/NavLink`) for internal navigation so active states are handled automatically.
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/**/*.{tsx,jsx} : Always import from the central UI library under `@/components/ui/*` – e.g. `import { Button } from "@/components/ui/button"`.
Learnt from: MananTank
PR: thirdweb-dev/js#7177
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/settings/shared-settings-page.tsx:29-39
Timestamp: 2025-05-27T20:10:47.245Z
Learning: MananTank prefers adding error handling (try-catch) directly inside utility functions like `shouldRenderNewPublicPage` rather than requiring callers to wrap the function calls in try-catch blocks. This centralizes error handling and benefits all callers automatically.
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/components/accounts-table.tsx (15)

Learnt from: jnsdls
PR: #7188
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/components/accounts-count.tsx:15-15
Timestamp: 2025-05-29T00:46:09.063Z
Learning: In the accounts component at apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/components/accounts-count.tsx, the 3-column grid layout (md:grid-cols-3) is intentionally maintained even when rendering only one StatCard, as part of the design structure for this component.

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/**/*client.tsx : Interactive UI that relies on hooks (useState, useEffect, React Query, wallet hooks).

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/**/*.{tsx,jsx} : Prefer composable primitives over custom markup: Button, Input, Select, Tabs, Card, Sidebar, Separator, Badge.

Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Use NavLink for internal navigation with automatic active states in dashboard and playground apps

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/**/*.{tsx,jsx} : Use NavLink (@/components/ui/NavLink) for internal navigation so active states are handled automatically.

Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to 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

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/**/*.{tsx,jsx} : Merge class names with cn from @/lib/utils to keep conditional logic readable.

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/**/*client.tsx : Pages requiring fast transitions where data is prefetched on the client.

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/**/*.{tsx,jsx} : For notices & skeletons rely on AnnouncementBanner, GenericLoadingPage, EmptyStateCard.

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/**/*.{tsx,jsx} : Reuse core UI primitives; avoid re-implementing buttons, cards, modals.

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/**/*client.tsx : Anything that consumes hooks from @tanstack/react-query or thirdweb SDKs.

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/**/layout.tsx : Building layout shells (layout.tsx) and top-level pages that mainly assemble data.

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/**/*client.tsx : Use React Query (@tanstack/react-query) for all client data fetching.

Learnt from: MananTank
PR: #7152
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/tokens/shared-page.tsx:41-48
Timestamp: 2025-05-26T16:28:50.772Z
Learning: The projectMeta prop is not required for the server-rendered ContractTokensPage component in the tokens shared page, unlike some other shared pages where it's needed for consistency.

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/**/*client.tsx : Components that listen to user events, animations or live updates.

⏰ 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: E2E Tests (pnpm, webpack)
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: Unit Tests
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: Size
  • GitHub Check: Build Packages
  • GitHub Check: Lint Packages
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (3)
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/components/accounts-table.tsx (3)

3-20: LGTM! Clean migration to new UI components.

The import structure follows the coding guidelines correctly, importing UI primitives from @/components/ui/* and using the new Table components. The migration from Chakra UI to custom components aligns with the project's direction.


124-128: LGTM! Good empty state handling.

The empty state is well-implemented with appropriate styling using design tokens (text-muted-foreground) and proper spacing. The conditional rendering logic is correct.


131-139: LGTM! Clean pagination implementation.

The pagination logic is well-structured with proper conditional rendering and uses the centralized PaginationButtons component. The page conversion logic (0-based to 1-based) is handled correctly.

Comment on lines +95 to +103
<TableRow linkBox key={account} className="hover:bg-muted/50">
<TableCell className="py-6">
<Link
href={accountContractPagePath}
target="_blank"
rel="noopener noreferrer"
className="before:absolute before:inset-0"
aria-label="View account"
/>
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

Review accessibility and UX of the linkBox pattern.

The current implementation uses a before:absolute before:inset-0 pseudo-element to make the entire row clickable, but this can create accessibility issues. The linkBox className and pseudo-element approach may interfere with screen readers and keyboard navigation.

Consider using a more accessible approach:

- <TableRow linkBox key={account} className="hover:bg-muted/50">
-   <TableCell className="py-6">
-     <Link
-       href={accountContractPagePath}
-       target="_blank"
-       rel="noopener noreferrer"
-       className="before:absolute before:inset-0"
-       aria-label="View account"
-     />
+ <TableRow key={account} className="hover:bg-muted/50">
+   <TableCell className="py-6">
+     <div className="flex items-center justify-between gap-2">
+       <Link
+         href={accountContractPagePath}
+         target="_blank"
+         rel="noopener noreferrer"
+         aria-label={`View account ${account}`}
+         className="flex-1 min-w-0"
+       >
+         <CopyTextButton
+           textToShow={account}
+           textToCopy={account}
+           variant="ghost"
+           tooltip="Copy account address"
+           copyIconPosition="right"
+         />
+       </Link>
+       <ArrowUpRightIcon className="size-4 text-muted-foreground flex-shrink-0" />
+     </div>

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/components/accounts-table.tsx
around lines 95 to 103, the current use of the linkBox pattern with a
before:absolute before:inset-0 pseudo-element to make the entire TableRow
clickable can cause accessibility issues for screen readers and keyboard users.
To fix this, remove the pseudo-element approach and instead wrap the entire
content of the TableRow in a semantic interactive element like a Link or button,
ensuring proper focus management and keyboard navigation support. Also, avoid
using empty Link components and ensure all interactive elements have accessible
labels and roles.

@graphite-app graphite-app bot merged commit 5e883ac into main Jul 29, 2025
25 checks passed
@graphite-app graphite-app bot deleted the 07-29-dashboard_migrate_contract_accounts_page_from_chakra_to_tailwind branch July 29, 2025 17:46
@vercel vercel bot temporarily deployed to Production – wallet-ui July 29, 2025 17:46 Inactive
@vercel vercel bot temporarily deployed to Production – docs-v2 July 29, 2025 17:46 Inactive
@vercel vercel bot temporarily deployed to Production – nebula July 29, 2025 17:46 Inactive
@vercel vercel bot temporarily deployed to Production – thirdweb_playground July 29, 2025 17:46 Inactive
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants