Skip to content

[Dashboard] Add audit log feature for Scale plan teams #7300

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

Merged
merged 1 commit into from
Jun 7, 2025

Conversation

jnsdls
Copy link
Member

@jnsdls jnsdls commented Jun 7, 2025

Add Audit Log Feature for Scale Plan

This PR adds a new Audit Log feature for teams on the Scale plan, allowing them to monitor and review actions performed within their team.

Features

  • Created a new audit log API endpoint to fetch team activity logs
  • Added an Audit Log page in the team dashboard navigation
  • Implemented pagination for audit log entries
  • Added detailed entry display with actor information, action type, and timestamps
  • Created an UpsellWrapper component to gate features behind specific plans

Implementation Details

  • The audit log displays who performed an action, what they did, and when it happened
  • Each log entry shows the actor type (user, API key, or system)
  • Entries include links to relevant resources when available
  • The UpsellWrapper component shows a paywall for teams not on the required plan
  • Pagination controls allow users to navigate through audit history

The feature is accessible via the team navigation sidebar and requires the Scale plan to use.

Summary by CodeRabbit

  • New Features

    • Introduced an Audit Log page for teams, accessible via a new navigation tab, allowing users to view and paginate through audit events.
    • Added detailed audit log entry displays, including actor information, action details, and timestamps.
    • Implemented conditional access to the Audit Log feature, requiring an upgraded plan for full access, with an upsell prompt for locked users.
    • Added a new component to display locked feature upsell prompts with plan details and upgrade options.
    • Enabled pagination controls with URL state synchronization for audit log browsing.
    • Added a server-side API to fetch audit log entries with pagination and error handling.
  • Bug Fixes

    • Removed unnecessary console logging from webhook creation to improve performance and security.
  • Other Changes

    • Updated supported chain services list by removing an obsolete option.

PR-Codex overview

This PR focuses on implementing an Audit Log feature for team management, allowing users to monitor and review actions performed within their teams. It includes new components, API integrations, and layout modifications to support this functionality.

Detailed summary

  • Removed "chainsaw" from the ChainService type in chain.ts.
  • Added an Audit Log entry in the layout.tsx file.
  • Introduced searchParams and searchParamLoader in search-params.ts.
  • Created a new Layout component to handle team verification and display.
  • Implemented a new Page component to fetch and display audit logs.
  • Added error handling for audit log fetching.
  • Developed AuditLogList and AuditLogEntryComponent for rendering logs.
  • Introduced UpsellWrapper component for feature promotion based on billing plans.
  • Created API methods for fetching audit logs in audit-log.ts.

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

Copy link

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

@vercel vercel bot temporarily deployed to Preview – wallet-ui June 7, 2025 07:03 Inactive
@vercel vercel bot temporarily deployed to Preview – login June 7, 2025 07:03 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 June 7, 2025 07:03 Inactive
Copy link

changeset-bot bot commented Jun 7, 2025

⚠️ No Changeset found

Latest commit: 21759c3

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

@vercel vercel bot temporarily deployed to Preview – thirdweb_playground June 7, 2025 07:03 Inactive
Copy link
Contributor

coderabbitai bot commented Jun 7, 2025

"""

Walkthrough

This update introduces a complete "Audit Log" feature to the team dashboard. It adds API integration, React components for listing and displaying audit log entries, pagination, and a conditional upsell wrapper that restricts access based on billing plan. Navigation is updated to include the new audit log tab, and supporting utilities for search parameter handling are added.

Changes

File(s) Change Summary
apps/dashboard/src/@/api/audit-log.ts New API module for fetching audit logs, including types and error handling.
apps/dashboard/src/@/components/blocks/upsell-wrapper.tsx New UpsellWrapper React component for conditional feature gating and upsell UI.
apps/dashboard/src/@/api/universal-bridge/developer.ts Removed a debug console.log statement from the webhook creation function.
apps/dashboard/src/app/(app)/(dashboard)/(chain)/types/chain.ts Removed "chainsaw" from ChainSupportedService type.
apps/dashboard/src/app/(app)/team/[team_slug]/(team)/layout.ts.x Added "Audit Log" tab to team navigation.
apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/audit-log/_components/entry.tsx New component for rendering individual audit log entries.
apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/audit-log/_components/list.tsx New component for paginated rendering of audit log entries with navigation.
apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/audit-log/layout.tsx New layout component for the audit log page, integrating upsell gating and team context.
apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/audit-log/page.tsx New page component for displaying the audit log, handling data fetching and error states.
apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/audit-log/search-params.ts New utility for parsing and handling audit log search parameters (pagination cursor).

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI (AuditLog Page)
    participant API (getAuditLogs)
    participant Server

    User->>UI (AuditLog Page): Navigates to Audit Log tab
    UI (AuditLog Page)->>API (getAuditLogs): Calls getAuditLogs(teamSlug, cursor?)
    API (getAuditLogs)->>Server: Fetch /api/teams/{teamSlug}/audit-log?after={cursor}
    Server-->>API (getAuditLogs): Returns audit log data or error
    API (getAuditLogs)-->>UI (AuditLog Page): Returns parsed data or error
    UI (AuditLog Page)->>UI (AuditLogList): Renders entries and pagination
    User->>UI (AuditLogList): Clicks Next/Previous for pagination
    UI (AuditLogList)->>API (getAuditLogs): Fetches next/previous page using cursor
Loading
sequenceDiagram
    participant UI (AuditLog Page)
    participant UpsellWrapper

    UI (AuditLog Page)->>UpsellWrapper: Render audit log content
    UpsellWrapper-->>UI (AuditLog Page): If currentPlan < requiredPlan, show upsell overlay
    UpsellWrapper-->>UI (AuditLog Page): Else, show children (audit log)
Loading

Suggested reviewers

  • MananTank
  • joaquim-verges
    """

📜 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 ea469c9 and 21759c3.

📒 Files selected for processing (10)
  • apps/dashboard/src/@/api/audit-log.ts (1 hunks)
  • apps/dashboard/src/@/api/universal-bridge/developer.ts (1 hunks)
  • apps/dashboard/src/@/components/blocks/upsell-wrapper.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/types/chain.ts (0 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/(team)/layout.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/audit-log/_components/entry.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/audit-log/_components/list.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/audit-log/layout.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/audit-log/page.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/audit-log/search-params.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/types/chain.ts
✅ Files skipped from review due to trivial changes (2)
  • apps/dashboard/src/@/api/audit-log.ts
  • apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/audit-log/page.tsx
🚧 Files skipped from review as they are similar to previous changes (7)
  • apps/dashboard/src/@/api/universal-bridge/developer.ts
  • apps/dashboard/src/app/(app)/team/[team_slug]/(team)/layout.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/audit-log/search-params.ts
  • apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/audit-log/layout.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/audit-log/_components/list.tsx
  • apps/dashboard/src/@/components/blocks/upsell-wrapper.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/audit-log/_components/entry.tsx
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: Size
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: Lint Packages
  • GitHub Check: Build Packages
  • GitHub Check: Unit Tests
  • 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.

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

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

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.57%. Comparing base (7fa5be5) to head (21759c3).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7300   +/-   ##
=======================================
  Coverage   55.57%   55.57%           
=======================================
  Files         909      909           
  Lines       58673    58673           
  Branches     4158     4158           
=======================================
  Hits        32607    32607           
  Misses      25959    25959           
  Partials      107      107           
Flag Coverage Δ
packages 55.57% <ø> (ø)
🚀 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.

@jnsdls jnsdls force-pushed the _Dashboard_Add_audit_log_feature_for_Scale_plan_teams branch from 09e4663 to 960019a Compare June 7, 2025 07:06
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground June 7, 2025 07:06 Inactive
@vercel vercel bot temporarily deployed to Preview – login June 7, 2025 07:06 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 June 7, 2025 07:06 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui June 7, 2025 07:06 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.

Caution

Inline review comments failed to post. This is likely due to GitHub's limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 6

🧹 Nitpick comments (5)
apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/audit-log/layout.tsx (2)

12-15: Consider more specific redirect path.

While the error handling is good, redirecting to /team might be too generic. Consider redirecting to a more specific path like /team/${params.team_slug} to maintain context, or handle the case where the team slug itself might be invalid.


18-23: Billing plan gating logic is correct, but consider simplifying optional chaining.

The billing plan logic correctly unlocks the feature for both "scale" and "pro" plans. However, since you already verify team exists above, the optional chaining in team?.billingPlan on line 23 is unnecessary.

-      currentPlan={team?.billingPlan}
+      currentPlan={team.billingPlan}
apps/dashboard/src/@/api/audit-log.ts (2)

57-58: Consider making page size configurable.

The page size is hard-coded to 15. Consider making this configurable through environment variables or function parameters for better flexibility.

+const DEFAULT_PAGE_SIZE = process.env.AUDIT_LOG_PAGE_SIZE || "15";
+
 export async function getAuditLogs(teamSlug: string, cursor?: string) {
   // ... existing code ...
-  // artifically limit page size to 15 for now
-  url.searchParams.set("take", "15");
+  url.searchParams.set("take", DEFAULT_PAGE_SIZE);

86-86: Consider adding runtime type validation for API responses.

The response is type-cast without validation. Consider adding runtime validation to ensure data integrity.

-  const data = (await response.json()) as AuditLogApiResponse;
+  const responseData = await response.json();
+  // Add validation here if needed
+  const data = responseData as AuditLogApiResponse;
apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/audit-log/_components/entry.tsx (1)

80-83: Consider making wallet address masking configurable.

The wallet address masking (6 characters + 4 characters) is hardcoded. Consider making this configurable for different address formats.

+const maskWallet = (wallet: string, prefixLength = 6, suffixLength = 4) => 
+  `${wallet.slice(0, prefixLength)}...${wallet.slice(-suffixLength)}`;
+
               {entry.who.metadata?.wallet && (
                 <span className="font-mono">
-                  {entry.who.metadata.wallet.slice(0, 6)}...
-                  {entry.who.metadata.wallet.slice(-4)}
+                  {maskWallet(entry.who.metadata.wallet)}
                 </span>
               )}
🛑 Comments failed to post (6)
apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/audit-log/page.tsx (1)

19-19: ⚠️ Potential issue

Fix the redirect path for authentication validation.

The getValidAccount call uses a hardcoded redirect path /team/${params.team_slug}/~/usage that doesn't match the current audit log route.

-    getValidAccount(`/team/${params.team_slug}/~/usage`),
+    getValidAccount(`/team/${params.team_slug}/~/audit-log`),
🤖 Prompt for AI Agents
In apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/audit-log/page.tsx at
line 19, the redirect path in the getValidAccount call is incorrectly set to
/team/${params.team_slug}/~/usage, which does not correspond to the current
audit log route. Update the redirect path to match the audit log route, likely
/team/${params.team_slug}/~/audit-log, to ensure proper authentication
validation and redirection.
apps/dashboard/src/@/api/audit-log.ts (1)

77-78: 🛠️ Refactor suggestion

Replace console.log with proper error logging.

Using console.log in production code is not ideal for error tracking and debugging.

-    const body = await response.text();
-    console.log(body);
+    const body = await response.text();
+    console.error("Audit log API error:", { status: response.status, body });
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

    const body = await response.text();
    console.error("Audit log API error:", { status: response.status, body });
🤖 Prompt for AI Agents
In apps/dashboard/src/@/api/audit-log.ts at lines 77 to 78, replace the
console.log statement used for outputting the response body with a proper error
logging mechanism. Identify the appropriate logger used in the project (e.g., a
logging library or a custom logger) and use it to log the response body,
ensuring the log level is suitable for error or debug information instead of
using console.log.
apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/audit-log/_components/entry.tsx (1)

99-99: 🛠️ Refactor suggestion

Add error handling for date parsing.

The formatDistanceToNow function could fail if entry.when is not a valid date string.

-            <span className="whitespace-nowrap text-muted-foreground text-xs">
-              {formatDistanceToNow(entry.when, { addSuffix: true })}
-            </span>
+            <span className="whitespace-nowrap text-muted-foreground text-xs">
+              {(() => {
+                try {
+                  return formatDistanceToNow(new Date(entry.when), { addSuffix: true });
+                } catch {
+                  return entry.when;
+                }
+              })()}
+            </span>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

            <span className="whitespace-nowrap text-muted-foreground text-xs">
              {(() => {
                try {
                  return formatDistanceToNow(new Date(entry.when), { addSuffix: true });
                } catch {
                  return entry.when;
                }
              })()}
            </span>
🤖 Prompt for AI Agents
In
apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/audit-log/_components/entry.tsx
at line 99, the call to formatDistanceToNow(entry.when, { addSuffix: true }) may
throw an error if entry.when is not a valid date. To fix this, add error
handling by validating or safely parsing entry.when before passing it to
formatDistanceToNow. If the date is invalid, display a fallback string or handle
the error gracefully to prevent the component from crashing.
apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/audit-log/_components/list.tsx (2)

87-89: 🛠️ Refactor suggestion

Potential key collision in buildAuditLogEntryKey function.

The key generation might not be unique enough if multiple entries have the same type, action, path, and timestamp. Consider including more unique identifiers.

 function buildAuditLogEntryKey(entry: AuditLogEntry) {
-  return `${entry.who.type}-${entry.what.action}-${entry.what.path ?? ""}-${entry.when}`;
+  return `${entry.who.type}-${entry.what.action}-${entry.what.path ?? ""}-${entry.when}-${entry.who.text}-${entry.what.resourceType}`;
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

function buildAuditLogEntryKey(entry: AuditLogEntry) {
  return `${entry.who.type}-${entry.what.action}-${entry.what.path ?? ""}-${entry.when}-${entry.who.text}-${entry.what.resourceType}`;
}
🤖 Prompt for AI Agents
In
apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/audit-log/_components/list.tsx
around lines 87 to 89, the buildAuditLogEntryKey function generates keys that
may not be unique if entries share the same type, action, path, and timestamp.
To fix this, enhance the key by including additional unique identifiers from the
AuditLogEntry object, such as a unique ID or a combination of other distinct
properties, ensuring each key is truly unique to prevent collisions.

51-53: 🛠️ Refactor suggestion

Previous button navigation may be unreliable with cursor pagination.

Using window.history.back() for the previous button might not work correctly with cursor-based pagination, especially if users navigate directly to a paginated URL or refresh the page.

Consider implementing a proper previous cursor or using a different approach:

           <Button
             variant="outline"
             size="sm"
             onClick={() => {
-              window.history.back();
+              setAfter(null); // Go back to first page
             }}
             disabled={isPending || !after}
           >

Alternatively, implement a stack-based approach to track previous cursors.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

<Button
  variant="outline"
  size="sm"
  onClick={() => {
    setAfter(null); // Go back to first page
  }}
  disabled={isPending || !after}
>
  Previous
</Button>
🤖 Prompt for AI Agents
In
apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/audit-log/_components/list.tsx
around lines 51 to 53, replace the use of window.history.back() for the previous
button because it can be unreliable with cursor pagination. Instead, implement
navigation using the stored previous cursor value to fetch the correct previous
page of data, or maintain a stack of cursors to track navigation history and use
that to determine the previous page. Update the onClick handler to use this
cursor-based navigation logic rather than relying on browser history.
apps/dashboard/src/@/components/blocks/upsell-wrapper.tsx (1)

70-74: ⚠️ Potential issue

Fix hardcoded plan value to use dynamic prop.

The TeamPlanBadge uses a hardcoded "scale" plan, but the component receives requiredPlan as a prop. This creates an inconsistency where the badge might show a different plan than what's actually required.

<TeamPlanBadge
-  plan="scale"
+  plan={requiredPlan}
  teamSlug={teamSlug}
  postfix=" Feature"
/>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

              <TeamPlanBadge
                plan={requiredPlan}
                teamSlug={teamSlug}
                postfix=" Feature"
              />
🤖 Prompt for AI Agents
In apps/dashboard/src/@/components/blocks/upsell-wrapper.tsx around lines 70 to
74, replace the hardcoded "scale" string passed as the plan prop to
TeamPlanBadge with the dynamic requiredPlan prop received by the component. This
ensures the badge correctly reflects the actual required plan instead of always
showing "scale".

Copy link
Contributor

github-actions bot commented Jun 7, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 62.57 KB (0%) 1.3 s (0%) 206 ms (+138.16% 🔺) 1.5 s
thirdweb (cjs) 345.55 KB (0%) 7 s (0%) 645 ms (+10.61% 🔺) 7.6 s
thirdweb (minimal + tree-shaking) 5.7 KB (0%) 114 ms (0%) 64 ms (+1083.07% 🔺) 178 ms
thirdweb/chains (tree-shaking) 531 B (0%) 11 ms (0%) 10 ms (+627.84% 🔺) 20 ms
thirdweb/react (minimal + tree-shaking) 19.56 KB (0%) 392 ms (0%) 46 ms (+293.74% 🔺) 437 ms

@jnsdls jnsdls force-pushed the _Dashboard_Add_audit_log_feature_for_Scale_plan_teams branch from 960019a to ea469c9 Compare June 7, 2025 07:23
@vercel vercel bot temporarily deployed to Preview – wallet-ui June 7, 2025 07:23 Inactive
@vercel vercel bot temporarily deployed to Preview – login June 7, 2025 07:23 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 June 7, 2025 07:23 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground June 7, 2025 07:23 Inactive
@jnsdls jnsdls force-pushed the _Dashboard_Add_audit_log_feature_for_Scale_plan_teams branch from ea469c9 to 21759c3 Compare June 7, 2025 07:26
@vercel vercel bot temporarily deployed to Preview – login June 7, 2025 07:26 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground June 7, 2025 07:26 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui June 7, 2025 07:26 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 June 7, 2025 07:26 Inactive
@jnsdls jnsdls merged commit b3e42f7 into main Jun 7, 2025
25 checks passed
@jnsdls jnsdls deleted the _Dashboard_Add_audit_log_feature_for_Scale_plan_teams branch June 7, 2025 07:37
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.

1 participant