Skip to content

Conversation

@joaquim-verges
Copy link
Member

@joaquim-verges joaquim-verges commented Sep 30, 2025


PR-Codex overview

This PR introduces a new id parameter to the useEngine hook and enhances the TransactionsTable component to filter transactions by this id. It allows fetching a specific transaction when an id is provided and adds an input field for users to filter transactions based on the Queue ID.

Detailed summary

  • Added id?: string to the parameters of the useEngine hook.
  • Modified the query function in useEngine to fetch a specific transaction when id is present.
  • Introduced filterId state in TransactionsTable to hold the Queue ID filter.
  • Added an input field in TransactionsTable for filtering transactions by Queue ID.

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

Summary by CodeRabbit

  • New Features
    • Transactions table now supports filtering by Queue ID via a new input field. Changing the filter refreshes results and resets pagination to page 1.
    • Providing a specific ID will fetch and display only the matching transaction in the list.
    • Result counts and pagination adapt to the active filter, showing a focused, single-result view when applicable.

@changeset-bot
Copy link

changeset-bot bot commented Sep 30, 2025

⚠️ No Changeset found

Latest commit: d3640f2

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 – docs-v2 September 30, 2025 22:12 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui September 30, 2025 22:12 Inactive
@vercel
Copy link

vercel bot commented Sep 30, 2025

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

Project Deployment Preview Comments Updated (UTC)
thirdweb-www Ready Ready Preview Comment Sep 30, 2025 10:44pm
4 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
docs-v2 Skipped Skipped Sep 30, 2025 10:44pm
nebula Skipped Skipped Sep 30, 2025 10:44pm
thirdweb_playground Skipped Skipped Sep 30, 2025 10:44pm
wallet-ui Skipped Skipped Sep 30, 2025 10:44pm

@vercel vercel bot temporarily deployed to Preview – nebula September 30, 2025 22:12 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground September 30, 2025 22:12 Inactive
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 30, 2025

Walkthrough

Introduces an optional id parameter to the engine transactions hook to fetch a single transaction by ID. Updates the transactions table UI to include a “Filter by Queue ID” input, wiring it to the hook’s id parameter and resetting pagination when the filter changes.

Changes

Cohort / File(s) Change Summary
Engine hook: optional ID fetch
apps/dashboard/src/@/hooks/useEngine.ts
Adds optional id to useEngineTransactions. When provided, performs GET on .../transaction/{id}, parses json.result as a single Transaction, and returns [transaction] with totalCount=1. Falls back to existing paginated fetch when id is absent.
Transactions table: filter wiring
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/engine/(instance)/[engineId]/overview/components/transactions-table.tsx
Adds an Input for “Filter by Queue ID”, tracks filterId state, passes it as id to the hook, and resets page to 1 on change. Imports Input component.

Sequence Diagram(s)

sequenceDiagram
  participant U as User
  participant TT as TransactionsTable
  participant H as useEngineTransactions
  participant API as Engine API

  U->>TT: Type in "Filter by Queue ID"
  TT->>H: useEngineTransactions({ id: filterId, page, ... })
  alt id provided
    H->>API: GET /transaction/{id}
    API-->>H: { result: Transaction }
    H-->>TT: { transactions: [Transaction], totalCount: 1 }
  else no id
    H->>API: GET /transactions?queryParams
    API-->>H: { results: Transaction[], totalCount }
    H-->>TT: { transactions, totalCount }
  end
  TT-->>U: Render transactions table
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description currently retains the placeholder template comments and includes only the PR-Codex overview, but it does not provide the required issue tag, reviewer notes, or testing instructions from the repository template. Please remove or replace the commented template placeholders and add the issue tag or Linear branch reference, include a "Notes for the reviewer" section with any important context, and provide a "How to test" section outlining manual or automated testing steps.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title "[Dashboard] Add transaction filtering by Queue ID to engine v2" directly reflects the main change by highlighting the addition of Queue ID filtering to the engine v2 dashboard, uses the required component prefix, and is concise and clear.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch _Dashboard_Add_transaction_filtering_by_Queue_ID

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

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

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

@github-actions github-actions bot added the Dashboard Involves changes to the Dashboard. label Sep 30, 2025
@joaquim-verges joaquim-verges changed the title [Dashboard] Add transaction filtering by Queue ID [Dashboard] Add transaction filtering by Queue ID to engine v2 Sep 30, 2025
@joaquim-verges joaquim-verges marked this pull request as ready for review September 30, 2025 22:12
@joaquim-verges joaquim-verges requested review from a team as code owners September 30, 2025 22:12
Copy link
Member Author

joaquim-verges commented Sep 30, 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.

@codecov
Copy link

codecov bot commented Sep 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.28%. Comparing base (90c1e57) to head (d3640f2).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8163   +/-   ##
=======================================
  Coverage   56.28%   56.28%           
=======================================
  Files         906      906           
  Lines       59208    59208           
  Branches     4180     4180           
=======================================
  Hits        33324    33324           
  Misses      25779    25779           
  Partials      105      105           
Flag Coverage Δ
packages 56.28% <ø> (ø)
🚀 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.

Base automatically changed from _Dashboard_Add_transaction_filtering_by_Queue_ID_and_wallet_address to main September 30, 2025 22:15
@joaquim-verges joaquim-verges force-pushed the _Dashboard_Add_transaction_filtering_by_Queue_ID branch from 07f602b to d3640f2 Compare September 30, 2025 22:36
@vercel vercel bot temporarily deployed to Preview – nebula September 30, 2025 22:36 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui September 30, 2025 22:36 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground September 30, 2025 22:36 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 September 30, 2025 22: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 (1)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/engine/(instance)/[engineId]/overview/components/transactions-table.tsx (1)

166-175: Consider debouncing the filter input for better UX.

The input implementation is correct, but every keystroke triggers a new query. Since the filter fetches a specific transaction by ID, users typing a partial ID will get errors or empty results until the complete ID is entered.

Consider debouncing the filter to wait for the user to finish typing:

import { useMemo } from "react";
import { useDebounce } from "@/hooks/useDebounce"; // or install use-debounce

// In component:
const [filterIdInput, setFilterIdInput] = useState("");
const filterId = useDebounce(filterIdInput.trim() || undefined, 500);

// In render:
<Input
  className="max-w-[250px]"
  onChange={(e) => {
    setFilterIdInput(e.target.value);
    setPage(1);
  }}
  placeholder="Filter by Queue ID"
  value={filterIdInput}
/>

Alternatively, use a search button pattern where users explicitly trigger the filter.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 90c1e57 and d3640f2.

📒 Files selected for processing (2)
  • apps/dashboard/src/@/hooks/useEngine.ts (1 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/engine/(instance)/[engineId]/overview/components/transactions-table.tsx (4 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from @/types or local types.ts barrels
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial, Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose

**/*.{ts,tsx}: Use explicit function declarations and explicit return types in TypeScript
Limit each file to one stateless, single‑responsibility function
Re‑use shared types from @/types where applicable
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Prefer composition over inheritance; use utility types (Partial, Pick, etc.)
Lazy‑import optional features and avoid top‑level side‑effects to reduce bundle size

Files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/engine/(instance)/[engineId]/overview/components/transactions-table.tsx
  • apps/dashboard/src/@/hooks/useEngine.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

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

Files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/engine/(instance)/[engineId]/overview/components/transactions-table.tsx
  • apps/dashboard/src/@/hooks/useEngine.ts
apps/{dashboard,playground-web}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

apps/{dashboard,playground-web}/**/*.{ts,tsx}: Import UI primitives from @/components/ui/* (Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator) in dashboard and playground apps
Use NavLink for internal navigation with automatic active states in dashboard and playground apps
Use Tailwind CSS only – no inline styles or CSS modules
Use cn() from @/lib/utils for conditional class logic
Use design system tokens (e.g., bg-card, border-border, text-muted-foreground)
Server Components (Node edge): Start files with import "server-only";
Client Components (browser): Begin files with 'use client';
Always call getAuthToken() to retrieve JWT from cookies on server side
Use Authorization: Bearer header – never embed tokens in URLs
Return typed results (e.g., Project[], User[]) – avoid any
Wrap client-side data fetching calls in React Query (@tanstack/react-query)
Use descriptive, stable queryKeys for React Query cache hits
Configure staleTime/cacheTime in React Query based on freshness (default ≥ 60s)
Keep tokens secret via internal API routes or server actions
Never import posthog-js in server components

Files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/engine/(instance)/[engineId]/overview/components/transactions-table.tsx
  • apps/dashboard/src/@/hooks/useEngine.ts
apps/{dashboard,playground}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/engine/(instance)/[engineId]/overview/components/transactions-table.tsx
  • apps/dashboard/src/@/hooks/useEngine.ts
apps/{dashboard,playground}/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

Expose a className prop on the root element of every component

Files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/engine/(instance)/[engineId]/overview/components/transactions-table.tsx
⏰ 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: Size
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: Unit Tests
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: Build Packages
  • GitHub Check: Lint Packages
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (3)
apps/dashboard/src/@/hooks/useEngine.ts (1)

382-384: LGTM! Parameter addition looks good.

The optional id parameter is correctly typed and destructured, maintaining backward compatibility with existing callers.

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/engine/(instance)/[engineId]/overview/components/transactions-table.tsx (2)

1-1: LGTM! Import follows coding guidelines.

The Input component is correctly imported from the workspace UI library as specified in the coding guidelines.


114-126: LGTM! Filter state and hook integration look correct.

The filterId state is properly typed and wired to the useEngineTransactions hook. The optional string type matches the hook's parameter signature.

Comment on lines +389 to +401
if (id) {
const res = await fetch(`${instanceUrl}transaction/${id}`, {
headers: getEngineRequestHeaders(authToken),
method: "GET",
});

const json = await res.json();
const transaction = (json.result as Transaction) || {};
return {
transactions: [transaction],
totalCount: 1,
};
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Add error handling and response validation.

The single-transaction fetch path lacks error handling and response validation. Consider these concerns:

  1. No HTTP status check - non-2xx responses are not handled
  2. No validation that json.result exists before casting
  3. Empty object fallback (|| {}) could return invalid Transaction shape

While the existing fetch-all path (lines 414-421) has similar patterns, this represents a good opportunity to add defensive checks.

Consider this approach:

 if (id) {
   const res = await fetch(`${instanceUrl}transaction/${id}`, {
     headers: getEngineRequestHeaders(authToken),
     method: "GET",
   });

+  if (!res.ok) {
+    throw new Error(`Failed to fetch transaction: ${res.status} ${await res.text()}`);
+  }
+
   const json = await res.json();
-  const transaction = (json.result as Transaction) || {};
+  
+  if (!json.result) {
+    throw new Error("Invalid response: missing result field");
+  }
+  
+  const transaction = json.result as Transaction;
   return {
     transactions: [transaction],
     totalCount: 1,
   };
 }
📝 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.

Suggested change
if (id) {
const res = await fetch(`${instanceUrl}transaction/${id}`, {
headers: getEngineRequestHeaders(authToken),
method: "GET",
});
const json = await res.json();
const transaction = (json.result as Transaction) || {};
return {
transactions: [transaction],
totalCount: 1,
};
}
if (id) {
const res = await fetch(`${instanceUrl}transaction/${id}`, {
headers: getEngineRequestHeaders(authToken),
method: "GET",
});
if (!res.ok) {
throw new Error(`Failed to fetch transaction: ${res.status} ${await res.text()}`);
}
const json = await res.json();
if (!json.result) {
throw new Error("Invalid response: missing result field");
}
const transaction = json.result as Transaction;
return {
transactions: [transaction],
totalCount: 1,
};
}
🤖 Prompt for AI Agents
In apps/dashboard/src/@/hooks/useEngine.ts around lines 389 to 401, the
single-transaction fetch path lacks HTTP status checking and response
validation; add a res.ok check and throw or handle non-2xx responses, parse json
and verify json.result exists and has the expected Transaction shape (at least
required fields like id), avoid using a blind || {} fallback, and return either
a validated transactions array with totalCount 1 or an empty array with
totalCount 0 (or propagate the error) — wrap the fetch in try/catch to surface
or log errors consistently with the fetch-all path and ensure the function
always returns the same response shape.

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 64.69 KB (0%) 1.3 s (0%) 142 ms (+195.6% 🔺) 1.5 s
thirdweb (cjs) 361.52 KB (0%) 7.3 s (0%) 553 ms (+8.92% 🔺) 7.8 s
thirdweb (minimal + tree-shaking) 5.73 KB (0%) 115 ms (0%) 84 ms (+2056.78% 🔺) 199 ms
thirdweb/chains (tree-shaking) 526 B (0%) 11 ms (0%) 18 ms (+1407.27% 🔺) 29 ms
thirdweb/react (minimal + tree-shaking) 19.14 KB (0%) 383 ms (0%) 105 ms (+2541.12% 🔺) 487 ms

@joaquim-verges joaquim-verges merged commit 4c51fe6 into main Sep 30, 2025
25 checks passed
@joaquim-verges joaquim-verges deleted the _Dashboard_Add_transaction_filtering_by_Queue_ID branch September 30, 2025 22:53
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