Skip to content

[TOOL-4833] Add Manage Contract button in new public contract pages #7434

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 Jun 24, 2025


PR-Codex overview

This PR primarily focuses on adding projectSlug and teamSlug properties to various components, enhancing the functionality related to project and team management within the application.

Detailed summary

  • Added projectSlug and teamSlug props in multiple components, including:
    • cards.tsx
    • DeployedContractsPage.tsx
    • layout.tsx
    • DeployViaCLIOrImportCard.tsx
    • modal.tsx
    • ImportForm.tsx
    • ContractHeader.tsx
    • TeamSelectorCard.tsx
    • ProjectAndTeamSelectorCard.tsx
  • Updated routing logic to include teamSlug and projectSlug in URLs for better navigation.
  • Introduced new API function getContractImportedProjects to fetch projects associated with a specific contract.
  • Added new storybook stories for TeamSelectorCard and ProjectAndTeamSelectorCard.

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

Summary by CodeRabbit

  • New Features

    • Introduced a team and project selector UI, enabling users to easily select teams or projects from visual cards.
    • Added a project and team selector for associating contracts, allowing users to view, select, or import contracts into projects across teams.
    • Enhanced contract management by providing direct navigation to contract pages based on project selection.
    • Improved contract view links to include team and project information in URLs for clearer navigation.
    • Added functionality to fetch projects that have imported specific contracts within teams.
  • UI Improvements

    • Updated button styles with rounded edges for a polished look.
    • Added copy address and manage contract buttons with icons and tooltips for enhanced usability.
  • Storybook/Documentation

    • Added Storybook stories to visually test and demonstrate the new team and project selector components under various scenarios.

Copy link

vercel bot commented Jun 24, 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 Jun 24, 2025 10:13pm
4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Skipped (Inspect) Jun 24, 2025 10:13pm
nebula ⬜️ Skipped (Inspect) Jun 24, 2025 10:13pm
thirdweb_playground ⬜️ Skipped (Inspect) Jun 24, 2025 10:13pm
wallet-ui ⬜️ Skipped (Inspect) Jun 24, 2025 10:13pm

@vercel vercel bot temporarily deployed to Preview – docs-v2 June 24, 2025 21:13 Inactive
@vercel vercel bot temporarily deployed to Preview – nebula June 24, 2025 21:13 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui June 24, 2025 21:13 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground June 24, 2025 21:13 Inactive
Copy link

linear bot commented Jun 24, 2025

Copy link

changeset-bot bot commented Jun 24, 2025

⚠️ No Changeset found

Latest commit: 3c6668b

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 Jun 24, 2025

Walkthrough

This change introduces a new "Manage Contract" user flow. It adds a special route for /team/~/~/contract/[chain]/[contractAddress] that, depending on contract import status, either redirects to the relevant project or presents a UI for selecting or importing the contract into a project. Supporting components, API utilities, and Storybook stories are added or updated.

Changes

Files/Paths Change Summary
.../getProjectContracts.ts Add PartialProject type and getContractImportedProjects API function.
.../components/contracts/import-contract/modal.tsx Add projectSlug and teamSlug props to ImportModal and propagate to ImportForm.
.../primary-dashboard-button.tsx Add rounded styling to button (UI only).
.../erc20/_components/ContractHeader.tsx Add "Manage Contract" button with tooltip; adjust copy address button placement.
.../DeployedContractsPageHeader.tsx Add projectSlug and teamSlug props and propagate to ImportModal.
.../DeployViaCLIOrImportCard.tsx Add projectSlug and teamSlug props and propagate to ImportModal.
.../DeployedContractsPage.tsx Pass projectSlug and teamSlug props to DeployViaCLIOrImportCard.
.../contracts/layout.tsx Pass projectSlug and teamSlug props to DeployedContractsPageHeader.
.../tokens/cards.tsx Pass projectSlug and teamSlug props to ImportModal.
.../team-selector.stories.tsx Add Storybook stories for TeamSelectorCard with various team scenarios.
.../team-selector.tsx Add TeamSelectorCard component and createTeamLink helper for team selection UI.
.../[[...paths]]/page.tsx Refactor to use new TeamSelectorCard component and import createTeamLink.
.../TeamAndProjectSelectorCard.stories.tsx Add Storybook stories for ProjectAndTeamSelectorCard with various team/project scenarios.
.../TeamAndProjectSelectorCard.tsx Add ProjectAndTeamSelectorCard component for selecting a project from a list of teams/projects.
.../contract/[chain]/[contractAddress]/components/project-selector.tsx Add SelectProjectForContract and ImportAndSelectProjectForContract components for contract/project selection and import flows.
.../contract/[chain]/[contractAddress]/page.tsx Add new route/page for contract management: handles fetching, redirects, and rendering selection/import UI as needed.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ContractHeader
    participant Router
    participant ContractManagePage
    participant API
    participant ProjectSelector

    User->>ContractHeader: Click "Manage Contract"
    ContractHeader->>Router: Navigate to /team/~/~/contract/[chain]/[contractAddress]
    Router->>ContractManagePage: Load page
    ContractManagePage->>API: Fetch user, teams, contract import status
    alt Contract imported in 1 project
        ContractManagePage->>Router: Redirect to project/contract page
    else Contract imported in >1 project
        ContractManagePage->>ProjectSelector: Render project selection UI
        User->>ProjectSelector: Select project
        ProjectSelector->>Router: Redirect to selected project/contract page
    else Contract imported in 0 projects
        ContractManagePage->>ProjectSelector: Render import+select UI
        User->>ProjectSelector: Select project to import
        ProjectSelector->>API: Import contract to project
        ProjectSelector->>Router: Redirect to selected project/contract page
    end
Loading

Assessment against linked issues

Objective Addressed Explanation
Implement "Manage Contract" button and user flow: handle login/onboarding, route to special page, fetch contract import status, redirect or show project selection/import UI as specified (TOOL-4833)

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Addition of Storybook stories for TeamSelectorCard and ProjectAndTeamSelectorCard (apps/dashboard/src/app/(app)/team//[[...paths]]/components/team-selector.stories.tsx, apps/dashboard/src/app/(app)/team//components/TeamAndProjectSelectorCard.stories.tsx) These stories are for visual testing and documentation, not directly required for the "Manage Contract" flow.
UI-only change: rounded button styling (apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/_layout/primary-dashboard-button.tsx) This is a cosmetic change unrelated to the contract management flow.

Suggested reviewers

  • MananTank

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

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

📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a880f77 and 3c6668b.

📒 Files selected for processing (16)
  • apps/dashboard/src/@/api/getProjectContracts.ts (2 hunks)
  • apps/dashboard/src/@/components/contracts/import-contract/modal.tsx (4 hunks)
  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/_layout/primary-dashboard-button.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.tsx (3 hunks)
  • apps/dashboard/src/app/(app)/account/contracts/DeployedContractsPageHeader.tsx (2 hunks)
  • apps/dashboard/src/app/(app)/account/contracts/_components/DeployViaCLIOrImportCard.tsx (2 hunks)
  • apps/dashboard/src/app/(app)/account/contracts/_components/DeployedContractsPage.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/contracts/layout.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/cards.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/team/~/[[...paths]]/components/team-selector.stories.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/team/~/[[...paths]]/components/team-selector.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/team/~/[[...paths]]/page.tsx (2 hunks)
  • apps/dashboard/src/app/(app)/team/~/components/TeamAndProjectSelectorCard.stories.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/team/~/components/TeamAndProjectSelectorCard.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/team/~/~/contract/[chain]/[contractAddress]/components/project-selector.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/team/~/~/contract/[chain]/[contractAddress]/page.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • apps/dashboard/src/app/(app)/team/~/[[...paths]]/components/team-selector.stories.tsx
  • apps/dashboard/src/app/(app)/team/~/[[...paths]]/components/team-selector.tsx
🚧 Files skipped from review as they are similar to previous changes (14)
  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/_layout/primary-dashboard-button.tsx
  • apps/dashboard/src/app/(app)/account/contracts/_components/DeployedContractsPage.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/cards.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/contracts/layout.tsx
  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.tsx
  • apps/dashboard/src/app/(app)/account/contracts/_components/DeployViaCLIOrImportCard.tsx
  • apps/dashboard/src/app/(app)/account/contracts/DeployedContractsPageHeader.tsx
  • apps/dashboard/src/app/(app)/team/~/[[...paths]]/page.tsx
  • apps/dashboard/src/app/(app)/team/~/components/TeamAndProjectSelectorCard.stories.tsx
  • apps/dashboard/src/@/components/contracts/import-contract/modal.tsx
  • apps/dashboard/src/@/api/getProjectContracts.ts
  • apps/dashboard/src/app/(app)/team/~/components/TeamAndProjectSelectorCard.tsx
  • apps/dashboard/src/app/(app)/team///contract/[chain]/[contractAddress]/components/project-selector.tsx
  • apps/dashboard/src/app/(app)/team///contract/[chain]/[contractAddress]/page.tsx
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Size
  • GitHub Check: Analyze (javascript)
✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the Dashboard Involves changes to the Dashboard. label Jun 24, 2025
@MananTank MananTank marked this pull request as ready for review June 24, 2025 21:14
@MananTank MananTank requested review from a team as code owners June 24, 2025 21:14
Copy link
Member Author

MananTank commented Jun 24, 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 Jun 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 51.96%. Comparing base (6aa2765) to head (3c6668b).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7434   +/-   ##
=======================================
  Coverage   51.96%   51.96%           
=======================================
  Files         947      947           
  Lines       63809    63809           
  Branches     4216     4216           
=======================================
  Hits        33161    33161           
  Misses      30542    30542           
  Partials      106      106           
Flag Coverage Δ
packages 51.96% <ø> (ø)
🚀 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 Jun 24, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 62.56 KB (0%) 1.3 s (0%) 151 ms (+32.43% 🔺) 1.5 s
thirdweb (cjs) 350.74 KB (0%) 7.1 s (0%) 937 ms (+3.92% 🔺) 8 s
thirdweb (minimal + tree-shaking) 5.72 KB (0%) 115 ms (0%) 45 ms (+407.12% 🔺) 160 ms
thirdweb/chains (tree-shaking) 530 B (0%) 11 ms (0%) 28 ms (+601.3% 🔺) 38 ms
thirdweb/react (minimal + tree-shaking) 19.61 KB (0%) 393 ms (0%) 40 ms (+120.47% 🔺) 432 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: 8

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6aa2765 and 7af3355.

📒 Files selected for processing (16)
  • apps/dashboard/src/@/api/getProjectContracts.ts (1 hunks)
  • apps/dashboard/src/@/components/contracts/import-contract/modal.tsx (4 hunks)
  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/_layout/primary-dashboard-button.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.tsx (3 hunks)
  • apps/dashboard/src/app/(app)/account/contracts/DeployedContractsPageHeader.tsx (2 hunks)
  • apps/dashboard/src/app/(app)/account/contracts/_components/DeployViaCLIOrImportCard.tsx (2 hunks)
  • apps/dashboard/src/app/(app)/account/contracts/_components/DeployedContractsPage.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/contracts/layout.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/cards.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/team/~/[[...paths]]/components/team-selector.stories.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/team/~/[[...paths]]/components/team-selector.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/team/~/[[...paths]]/page.tsx (2 hunks)
  • apps/dashboard/src/app/(app)/team/~/components/TeamAndProjectSelectorCard.stories.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/team/~/components/TeamAndProjectSelectorCard.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/team/~/~/contract/[chain]/[contractAddress]/components/project-selector.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/team/~/~/contract/[chain]/[contractAddress]/page.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
`**/*.@(ts|tsx)`: Accept a typed 'props' object and export a named function (e.g., export function MyComponent()). Combine class names via 'cn', expose 'className' prop if useful. ...

**/*.@(ts|tsx): Accept a typed 'props' object and export a named function (e.g., export function MyComponent()).
Combine class names via 'cn', expose 'className' prop if useful.
Reuse core UI primitives; avoid re-implementing buttons, cards, modals.
Local state or effects live inside; data fetching happens in hooks.
Merge class names with 'cn' from '@/lib/utils' to keep conditional logic readable.
Stick to design-tokens: background ('bg-card'), borders ('border-border'), muted text ('text-muted-foreground') etc.
Use the 'container' class with a 'max-w-7xl' cap for page width consistency.
Spacing utilities ('px-', 'py-', 'gap-*') are preferred over custom margins.
Responsive helpers follow mobile-first ('max-sm', 'md', 'lg', 'xl').
Never hard-code colors – always go through Tailwind variables.
Tailwind CSS is the styling system – avoid inline styles or CSS modules.
Prefix files with 'import "server-only";' so they never end up in the client bundle (for server-only code).

  • apps/dashboard/src/app/(app)/account/contracts/_components/DeployedContractsPage.tsx
  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/_layout/primary-dashboard-button.tsx
  • apps/dashboard/src/app/(app)/account/contracts/DeployedContractsPageHeader.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/cards.tsx
  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.tsx
  • apps/dashboard/src/app/(app)/account/contracts/_components/DeployViaCLIOrImportCard.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/contracts/layout.tsx
  • apps/dashboard/src/app/(app)/team/~/[[...paths]]/page.tsx
  • apps/dashboard/src/app/(app)/team/~/[[...paths]]/components/team-selector.stories.tsx
  • apps/dashboard/src/app/(app)/team/~/components/TeamAndProjectSelectorCard.tsx
  • apps/dashboard/src/app/(app)/team/~/[[...paths]]/components/team-selector.tsx
  • apps/dashboard/src/@/components/contracts/import-contract/modal.tsx
  • apps/dashboard/src/@/api/getProjectContracts.ts
  • apps/dashboard/src/app/(app)/team/~/~/contract/[chain]/[contractAddress]/components/project-selector.tsx
  • apps/dashboard/src/app/(app)/team/~/components/TeamAndProjectSelectorCard.stories.tsx
  • apps/dashboard/src/app/(app)/team/~/~/contract/[chain]/[contractAddress]/page.tsx
`**/components/*`: Add 'className' to the root element of every component for external overrides. Place the file close to its feature: 'feature/components/MyComponent.tsx'.

**/components/*: Add 'className' to the root element of every component for external overrides.
Place the file close to its feature: 'feature/components/MyComponent.tsx'.

  • apps/dashboard/src/app/(app)/team/~/[[...paths]]/components/team-selector.stories.tsx
  • apps/dashboard/src/app/(app)/team/~/components/TeamAndProjectSelectorCard.tsx
  • apps/dashboard/src/app/(app)/team/~/[[...paths]]/components/team-selector.tsx
  • apps/dashboard/src/app/(app)/team/~/~/contract/[chain]/[contractAddress]/components/project-selector.tsx
  • apps/dashboard/src/app/(app)/team/~/components/TeamAndProjectSelectorCard.stories.tsx
`**/components/*.stories.tsx`: Provide a Storybook story ('MyComponent.stories.tsx') or unit test alongside the component.

**/components/*.stories.tsx: Provide a Storybook story ('MyComponent.stories.tsx') or unit test alongside the component.

  • apps/dashboard/src/app/(app)/team/~/[[...paths]]/components/team-selector.stories.tsx
  • apps/dashboard/src/app/(app)/team/~/components/TeamAndProjectSelectorCard.stories.tsx
`**/components/@([A-Z][A-Za-z0-9]*)@(\.tsx|\.client\.tsx)`: Name files after the component in PascalCase; append '.client.tsx' when interactive.

**/components/@([A-Z][A-Za-z0-9]*)@(\.tsx|\.client\.tsx): Name files after the component in PascalCase; append '.client.tsx' when interactive.

  • apps/dashboard/src/app/(app)/team/~/components/TeamAndProjectSelectorCard.tsx
  • apps/dashboard/src/app/(app)/team/~/components/TeamAndProjectSelectorCard.stories.tsx
🧬 Code Graph Analysis (5)
apps/dashboard/src/app/(app)/team/~/[[...paths]]/page.tsx (1)
apps/dashboard/src/app/(app)/team/~/[[...paths]]/components/team-selector.tsx (1)
  • TeamSelectorCard (16-69)
apps/dashboard/src/app/(app)/team/~/[[...paths]]/components/team-selector.stories.tsx (1)
apps/dashboard/src/app/(app)/team/~/[[...paths]]/components/team-selector.tsx (1)
  • TeamSelectorCard (16-69)
apps/dashboard/src/app/(app)/team/~/components/TeamAndProjectSelectorCard.tsx (2)
apps/dashboard/src/@/api/team.ts (1)
  • Team (11-11)
apps/dashboard/src/@/api/getProjectContracts.ts (1)
  • PartialProject (47-52)
apps/dashboard/src/app/(app)/team/~/[[...paths]]/components/team-selector.tsx (1)
apps/dashboard/src/@/api/team.ts (1)
  • Team (11-11)
apps/dashboard/src/app/(app)/team/~/~/contract/[chain]/[contractAddress]/components/project-selector.tsx (4)
apps/dashboard/src/@/api/team.ts (1)
  • Team (11-11)
apps/dashboard/src/@/api/getProjectContracts.ts (1)
  • PartialProject (47-52)
apps/dashboard/src/@/lib/DashboardRouter.tsx (1)
  • useDashboardRouter (22-45)
apps/dashboard/src/app/(app)/team/~/components/TeamAndProjectSelectorCard.tsx (1)
  • ProjectAndTeamSelectorCard (13-109)
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: Size
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: Unit Tests
  • GitHub Check: Lint Packages
  • GitHub Check: Build Packages
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (30)
apps/dashboard/src/app/(app)/team/~/[[...paths]]/components/team-selector.stories.tsx (1)

1-84: Excellent Storybook implementation with comprehensive test coverage.

The stories provide thorough coverage of different scenarios including varying team counts, URL parameters, and path combinations. The decorator and meta configuration are properly set up for Next.js app directory usage.

apps/dashboard/src/app/(app)/team/~/[[...paths]]/page.tsx (2)

3-3: Clean import refactoring.

The import cleanup properly removes unused dependencies and adds the new component imports.

Also applies to: 8-8


69-74: Proper component integration.

The TeamSelectorCard is correctly integrated with all required props passed appropriately.

apps/dashboard/src/app/(app)/team/~/[[...paths]]/components/team-selector.tsx (1)

24-68: Well-structured component implementation.

The component properly uses existing UI primitives, follows design tokens, and implements good accessibility patterns with proper hover states and keyboard navigation through links.

apps/dashboard/src/@/api/getProjectContracts.ts (2)

47-52: LGTM! Well-defined type for partial project data.

The PartialProject type is appropriately structured with essential fields needed for project identification and display purposes.


54-85: LGTM! Solid API function implementation.

The getContractImportedProjects function follows established patterns with proper error handling, typing, and server-only execution. The endpoint URL construction and response handling are consistent with the existing codebase.

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/_layout/primary-dashboard-button.tsx (1)

86-86: LGTM! Appropriate styling enhancement.

The addition of rounded-full className enhances the button's visual appearance and aligns with modern UI design patterns.

apps/dashboard/src/app/(app)/account/contracts/_components/DeployedContractsPage.tsx (1)

26-28: LGTM! Consistent prop forwarding.

The addition of projectSlug and teamSlug props to the DeployViaCLIOrImportCard component ensures proper context propagation throughout the component hierarchy.

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/cards.tsx (1)

36-38: LGTM! Proper context propagation.

Adding projectSlug and teamSlug props to the ImportModal component ensures it has the necessary context for proper routing and URL construction.

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/contracts/layout.tsx (1)

46-48: LGTM! Consistent slug parameter forwarding.

The addition of projectSlug and teamSlug props derived from the URL parameters ensures the DeployedContractsPageHeader component has proper contextual information for routing and display purposes.

apps/dashboard/src/app/(app)/account/contracts/_components/DeployViaCLIOrImportCard.tsx (2)

13-14: LGTM: Props correctly added for slug support.

The addition of projectSlug and teamSlug props aligns with the PR's objective to improve project/team context handling across components.


28-30: LGTM: Props correctly passed to ImportModal.

The slug props are properly forwarded to the ImportModal component, maintaining consistency with the updated component interface.

apps/dashboard/src/app/(app)/account/contracts/DeployedContractsPageHeader.tsx (2)

13-14: LGTM: Consistent prop additions.

The projectSlug and teamSlug props are correctly added, maintaining consistency with other components in the PR.


28-30: LGTM: Props correctly forwarded.

The slug props are properly passed to the ImportModal component, ensuring the updated interface requirements are met.

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.tsx (3)

1-1: LGTM: Import added for new Settings2Icon.

The Settings2Icon import is correctly added to support the new "Manage Contract" button.


114-119: LGTM: Well-designed compact copy button.

The CopyAddressButton is nicely styled as a compact, icon-only button that fits well in the top row layout. The styling ensures good visual balance.


150-172: LGTM: Excellent "Manage Contract" button implementation.

The implementation includes several good practices:

  • Clear tooltip explaining the button's purpose
  • Appropriate icon and styling
  • Correct URL pattern following the team/project routing convention
  • Good accessibility with descriptive text

This successfully implements the core feature mentioned in the PR title.

apps/dashboard/src/@/components/contracts/import-contract/modal.tsx (4)

40-41: LGTM: Props correctly added to interface.

The projectSlug and teamSlug string props are properly added to the ImportModalProps type, maintaining type safety.


74-76: LGTM: Props correctly forwarded to ImportForm.

The slug props are properly passed from ImportModal to ImportForm, ensuring the complete data flow.


103-104: LGTM: ImportForm props updated consistently.

The ImportForm function signature is correctly updated to include the new slug props.


225-225: LGTM: URL pattern updated for team/project context.

The contract view URL is correctly updated to include team and project slugs, providing proper context navigation after contract import. This aligns with the PR's routing improvements.

apps/dashboard/src/app/(app)/team/~/components/TeamAndProjectSelectorCard.stories.tsx (2)

27-37: LGTM: Well-designed helper function.

The createPartialProject helper function correctly converts full project stubs to the PartialProject type, ensuring type safety and consistency with the API interface.


39-133: LGTM: Comprehensive story coverage.

The stories provide excellent test coverage with varied scenarios:

  • Single team with multiple projects
  • Multiple teams with balanced projects
  • Edge case with empty projects
  • Performance testing with large datasets

This supports thorough visual testing and development of the project selector component.

apps/dashboard/src/app/(app)/team/~/components/TeamAndProjectSelectorCard.tsx (2)

22-26: Logic correctly filters teams and determines header visibility.

The filtering logic properly removes teams without projects, and the conditional header display logic is sound for UX clarity.


71-101: Excellent scrollable container implementation with proper boundaries.

The scrollable container with max-height and border styling between projects provides a good user experience for long project lists.

apps/dashboard/src/app/(app)/team/~/~/contract/[chain]/[contractAddress]/page.tsx (3)

30-34: Good parallel data fetching pattern.

Using Promise.all for concurrent data fetching is an excellent performance optimization that reduces total loading time.


52-66: Robust error handling in Promise.all with graceful degradation.

The .catch(() => []) pattern for handling individual team project fetching failures is excellent - it prevents one team's API failure from breaking the entire flow.


83-87: Safe array access with proper conditional check.

The check for projectImports.length === 1 && projectImports[0] properly handles both array length and undefined access, preventing runtime errors.

apps/dashboard/src/app/(app)/team/~/~/contract/[chain]/[contractAddress]/components/project-selector.tsx (2)

10-38: SelectProjectForContract component implements clean navigation flow.

The component correctly handles the selection flow with clear description and direct navigation to the selected project's contract page.


65-65: ```shell
#!/bin/bash

Inspect the useAddContractToProject hook implementation for parameter types

rg --color=never -n 'export function useAddContractToProject' -A20 apps/dashboard/src/@/hooks/project-contracts.ts
rg --color=never -n 'mutate' -A20 apps/dashboard/src/@/hooks/project-contracts.ts


</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

@MananTank MananTank force-pushed the 06-25-_tool-4833_add_manage_contract_button_in_new_public_contract_pages branch from 7af3355 to a880f77 Compare June 24, 2025 21:39
@vercel vercel bot temporarily deployed to Preview – wallet-ui June 24, 2025 21:39 Inactive
@vercel vercel bot temporarily deployed to Preview – nebula June 24, 2025 21:39 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 June 24, 2025 21:39 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground June 24, 2025 21:39 Inactive
@MananTank MananTank force-pushed the 06-25-_tool-4833_add_manage_contract_button_in_new_public_contract_pages branch from a880f77 to a157d3a Compare June 24, 2025 21:57
@vercel vercel bot temporarily deployed to Preview – nebula June 24, 2025 21:57 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground June 24, 2025 21:57 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui June 24, 2025 21:57 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 June 24, 2025 21:57 Inactive
Copy link
Contributor

graphite-app bot commented Jun 24, 2025

Merge activity

…7434)

<!--

## 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 handling of `projectSlug` and `teamSlug` properties across various components in the application, improving navigation and data management related to teams and projects.

### Detailed summary
- Added `projectSlug` and `teamSlug` props in several components including `cards.tsx`, `DeployedContractsPage.tsx`, and `layout.tsx`.
- Updated links to include `teamSlug` and `projectSlug` for better navigation.
- Introduced new API function `getContractImportedProjects` to fetch projects with imported contracts.
- Created `TeamSelectorCard` and `ProjectAndTeamSelectorCard` components for selecting teams and projects.
- Improved UI elements such as buttons and tooltips in `ContractHeaderUI` and `ImportModal`.
- Enhanced type definitions for better type safety and clarity in components.

> ✨ 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**
  - Introduced a team and project selector UI, enabling users to easily select teams or projects from visual cards.
  - Added a project and team selector for associating contracts, allowing users to view, select, or import contracts into projects across teams.
  - Enhanced contract management by providing direct navigation to contract pages based on project selection.
  - Improved contract view links to include team and project information in URLs for clearer navigation.
  - Added functionality to fetch projects that have imported specific contracts within teams.

- **UI Improvements**
  - Updated button styles with rounded edges for a polished look.
  - Added copy address and manage contract buttons with icons and tooltips for enhanced usability.

- **Storybook/Documentation**
  - Added Storybook stories to visually test and demonstrate the new team and project selector components under various scenarios.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@graphite-app graphite-app bot force-pushed the 06-25-_tool-4833_add_manage_contract_button_in_new_public_contract_pages branch from a157d3a to 3c6668b Compare June 24, 2025 21:58
@vercel vercel bot temporarily deployed to Preview – wallet-ui June 24, 2025 21:58 Inactive
@vercel vercel bot temporarily deployed to Preview – nebula June 24, 2025 21:58 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground June 24, 2025 21:58 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 June 24, 2025 21:58 Inactive
@graphite-app graphite-app bot merged commit 3c6668b into main Jun 24, 2025
24 checks passed
@graphite-app graphite-app bot deleted the 06-25-_tool-4833_add_manage_contract_button_in_new_public_contract_pages branch June 24, 2025 22:13
@vercel vercel bot temporarily deployed to Production – thirdweb_playground June 24, 2025 22:13 Inactive
@vercel vercel bot temporarily deployed to Production – wallet-ui June 24, 2025 22:13 Inactive
@vercel vercel bot temporarily deployed to Production – docs-v2 June 24, 2025 22:13 Inactive
@vercel vercel bot temporarily deployed to Production – nebula June 24, 2025 22:13 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