Skip to content

feat: migrate api requests table to shared DataTable component#5386

Open
MichaelUnkey wants to merge 10 commits intomainfrom
api-requests-table
Open

feat: migrate api requests table to shared DataTable component#5386
MichaelUnkey wants to merge 10 commits intomainfrom
api-requests-table

Conversation

@MichaelUnkey
Copy link
Collaborator

What does this PR do?

Replaces the custom VirtualTable implementation in the keys overview
with the shared DataTable from @unkey/ui, following the same pattern
established by root-keys-table.

  • Extract api-requests-table to components/api-requests-table/ with
    columns, hooks, schema, utils, and log-details sub-components
  • Add InvalidCountCell, OutcomePopoverCell, EmptyApiRequests, and
    formatOutcomeName/getOutcomeColor exports to @unkey/ui
  • Wire TanStack row selection (controlled via selectedLog) so column
    defs are stable across row selections instead of rebuilding on click
  • Add setSorts to useSort hook to support TanStack's onSortingChange API
  • Fix details panel flash-close on row selection by stopping mousedown
    propagation in DataTable rows, preventing useOnClickOutside from
    firing before the row click resolves
  • Fix missing workspace slug in log details Key ID link
  • Remove dead code: categorizeSeverity, getOutcomeBadgeClass

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Chore (refactoring code, technical debt, workflow improvements)
  • Enhancement (small improvements)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How should this be tested?

Table Rendering

  • Keys overview table loads and displays rows with correct columns: ID, Name, External ID, Valid, Invalid, Last
    Used
  • Loading skeleton shows 10 rows while data fetches
  • Empty state renders when no data is returned

Row Selection

  • Clicking a row opens the details panel
  • Clicking a different row updates the panel without it closing and reopening
  • Selected row is visually distinct (background, opacity on others)
  • Badge styles (Valid/Invalid columns) update correctly on selection
  • Pressing Escape closes the panel and deselects the row
  • Keyboard navigation (↑/↓ or j/k) between rows works. Enter selects focused row

Sorting

  • Clicking Valid column header sorts ascending/descending/unsorted (3-state)
  • Clicking Invalid column header sorts correctly
  • Clicking Last Used column header sorts correctly — verify sort field sent to server is "time", not "lastUsed"
  • ID, Name, External ID headers are not sortable
  • Sort state persists in URL params

Details Panel

  • Panel opens with correct key details for selected row
  • Key ID link in the panel navigates to the correct URL (includes workspace slug)
  • Outcome distribution section renders with correct colors and labels
  • Roles and permissions sections render correctly
  • Close button (X) dismisses the panel
  • Clicking outside the panel (not on a table row) closes it
  • Toast error appears when a row with missing key details is selected, panel stays closed

Filters

  • Filtering by Key ID, Name, Identity, Outcome, Tags updates the table
  • Time frame filter switches query path correctly

Regression

  • Root keys table (previously migrated) still renders and functions correctly
  • No console errors or TypeScript errors in the browser

Checklist

Required

  • Filled out the "How to test" section in this PR
  • Read Contributing Guide
  • Self-reviewed my own code
  • Commented on my code in hard-to-understand areas
  • Ran pnpm build
  • Ran pnpm fmt
  • Ran make fmt on /go directory
  • Checked for warnings, there are none
  • Removed all console.logs
  • Merged the latest changes from main onto my branch with git pull origin main
  • My changes don't cause any responsiveness issues

Appreciated

  • If a UI change was made: Added a screen recording or screenshots to this PR
  • Updated the Unkey Docs if changes were necessary

@vercel
Copy link

vercel bot commented Mar 19, 2026

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

Project Deployment Actions Updated (UTC)
dashboard Ready Ready Preview, Comment Mar 20, 2026 2:02pm

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 88e2d43d-2514-4f65-b577-20028dbfb0c2

📥 Commits

Reviewing files that changed from the base of the PR and between cc45163 and 5d6b532.

📒 Files selected for processing (3)
  • web/apps/dashboard/app/(app)/[workspaceSlug]/apis/[apiId]/_overview/components/table/logs-table.tsx
  • web/apps/dashboard/components/api-requests-table/utils/get-row-class.ts
  • web/internal/ui/src/components/data-table/types.ts

📝 Walkthrough

Walkthrough

Replaces a local VirtualTable with the shared TanStack-based DataTable for key/log overview tables, centralizes column and cell definitions into a new api-requests-table module and @unkey/ui exports, updates sorting/selection/pagination wiring, and adjusts related imports and row-class utilities.

Changes

Cohort / File(s) Summary
Logs Table & Client
web/apps/dashboard/app/(app)/[workspaceSlug]/apis/[apiId]/_overview/components/table/logs-table.tsx, web/apps/dashboard/app/(app)/[workspaceSlug]/apis/[apiId]/_overview/logs-client.tsx
Replaced VirtualTable with shared DataTable using createApiRequestColumns; switched to TanStack sorting with manualSorting and added setSorts integration; changed row id/selection to getRowId/enableRowSelection; updated pagination/footer props and swapped custom empty JSX for EmptyApiRequests; adjusted log-details import.
Api Request Columns
web/apps/dashboard/components/api-requests-table/columns/create-api-request-columns.tsx, web/apps/dashboard/components/api-requests-table/columns/index.ts
Added createApiRequestColumns and API_REQUEST_COLUMN_IDS descriptors (id/accessor/header); centralized column renderers for key id, name, external id, valid/invalid counts, and last-used with sortable headers and specialized cells.
Table Cell Components (@unkey/ui)
web/internal/ui/src/components/data-table/components/cells/outcome-popover-cell.tsx, web/internal/ui/src/components/data-table/components/cells/invalid-count-cell.tsx, web/internal/ui/src/components/data-table/components/cells/index.ts
Introduced InvalidCountCell, promoted OutcomePopoverCell and outcome helpers (formatOutcomeName, getOutcomeColor, compact formatter), refactored popover/badge styles and exports.
Empty State Component (@unkey/ui)
web/internal/ui/src/components/data-table/components/empty/empty-api-requests.tsx, web/internal/ui/src/components/data-table/components/empty/index.ts
Added shared EmptyApiRequests component and re-export for API requests/keys empty state.
DataTable Core & Exports
web/internal/ui/src/components/data-table/data-table.tsx, web/internal/ui/src/components/data-table/index.ts
Added onMouseDown stopPropagation on row elements; expanded public exports to include new cell components, outcome utilities, and EmptyApiRequests.
Row/Class Utilities
web/apps/dashboard/components/api-requests-table/utils/get-row-class.ts, web/apps/dashboard/app/(app)/[workspaceSlug]/apis/[apiId]/keys/[keyAuthId]/[keyId]/components/table/utils/get-row-class.ts
Renamed STATUS_STYLESSEVERITY_STYLES, removed outcome-categorization helpers, switched to imported StatusStyle type, and updated getRowClassName to use request_id and accept nullable selected row.
Key Identifier & Log Details
web/apps/dashboard/components/api-requests-table/components/key-identifier-column.tsx, web/apps/dashboard/components/api-requests-table/components/log-details/index.tsx, .../log-details/components/log-outcome-distribution-section.tsx
Removed Suspense wrapper, updated imports to shared utilities, replaced errorShown state with ref, and changed key-details link to workspace-scoped path.
Hooks & Query Logic
web/apps/dashboard/components/logs/hooks/use-sort.tsx, web/apps/dashboard/components/api-requests-table/hooks/use-keys-overview-query.ts
Added memoized setSorts() to useSort; use-keys-overview-query now derives historical logs via useMemo from initialData instead of local state/effect; updated import paths.
Root Keys Table Changes
web/apps/dashboard/components/root-keys-table/columns/create-root-key-columns.tsx, web/apps/dashboard/components/root-keys-table/components/skeletons/render-root-key-skeleton-row.tsx
Standardized ROOT_KEY_COLUMN_IDS to structured descriptors ({id, accessorKey, header}) and updated skeleton rendering to compare column.id against descriptor .id fields.
Schema / TRPC Import Paths
web/apps/dashboard/components/api-requests-table/schema/keys-overview.schema.ts, web/apps/dashboard/lib/trpc/routers/api/keys/query-overview-logs/index.ts, .../utils.ts
Moved/updated schema import paths to the shared api-requests-table schema; adjusted corresponding trpc router and utils import locations.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: migrating the API requests table to use the shared DataTable component from @unkey/ui.
Description check ✅ Passed The description is comprehensive and covers all required sections: what the PR does, type of change, how to test, and a detailed checklist with required items marked as completed.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch api-requests-table
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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

Caution

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

⚠️ Outside diff range comments (1)
web/apps/dashboard/components/api-requests-table/schema/keys-overview.schema.ts (1)

14-14: ⚠️ Potential issue | 🟡 Minor

Redundant .nullable() modifier.

The cursor field has .nullable().optional().nullable() which applies nullable twice. This is redundant and likely unintentional.

🔧 Proposed fix
-  cursor: z.number().nullable().optional().nullable(),
+  cursor: z.number().nullable().optional(),
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@web/apps/dashboard/components/api-requests-table/schema/keys-overview.schema.ts`
at line 14, The `cursor` schema entry currently uses `.nullable()` twice
(`cursor: z.number().nullable().optional().nullable()`); remove the duplicate
modifier so the field reads e.g. `cursor: z.number().nullable().optional()` (or
`z.number().optional().nullable()`), keeping only a single `.nullable()` and
preserving `.optional()` as intended on the `cursor` symbol in
keys-overview.schema.ts.
🧹 Nitpick comments (2)
web/apps/dashboard/app/(app)/[workspaceSlug]/apis/[apiId]/_overview/components/table/logs-table.tsx (1)

53-61: Type assertion as SortFields at API boundary.

While the cast on line 57 is pragmatic for bridging TanStack's string id type to your SortFields union, it bypasses compile-time safety. Consider adding a runtime guard or using a type predicate to validate the column ID.

♻️ Safer alternative with runtime validation
+const isSortField = (id: string): id is SortFields =>
+  Object.values(API_REQUEST_COLUMN_IDS).some((col) => col.id === id);
+
 const handleSortingChange = useCallback(
   (updater: SortingState | ((old: SortingState) => SortingState)) => {
     const next = typeof updater === "function" ? updater(sorting) : updater;
     setSorts(
-      next.map((s) => ({ column: s.id as SortFields, direction: s.desc ? "desc" : "asc" })),
+      next
+        .filter((s) => isSortField(s.id))
+        .map((s) => ({ column: s.id as SortFields, direction: s.desc ? "desc" : "asc" })),
     );
   },
   [sorting, setSorts],
 );

As per coding guidelines: "Never compromise type safety: No any, no ! (non-null assertion), no as Type"

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@web/apps/dashboard/app/`(app)/[workspaceSlug]/apis/[apiId]/_overview/components/table/logs-table.tsx
around lines 53 - 61, The code uses an unsafe type assertion (s.id as
SortFields) in handleSortingChange; replace it with a runtime guard that
validates s.id before converting to your SortFields union: implement a type
predicate like isSortField(id): id is SortFields and use it to filter/map the
incoming next array (from sorting) so you only call setSorts with entries whose
s.id passes isSortField, and handle or ignore invalid ids instead of casting;
update references in handleSortingChange and any related consumers that assume
SortFields.
web/apps/dashboard/components/api-requests-table/columns/create-api-request-columns.tsx (1)

16-22: Consider extracting TruncatedTextCell for reuse.

This helper is defined inline but could be useful in other column definitions. Consider moving it to the shared cells components in @unkey/ui if truncation with tooltip is a common pattern.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@web/apps/dashboard/components/api-requests-table/columns/create-api-request-columns.tsx`
around lines 16 - 22, TruncatedTextCell is defined inline and should be
extracted for reuse: create a shared component (e.g., TruncatedTextCell) inside
the shared cells library (`@unkey/ui`) that accepts a value prop (string) and
preserves the current layout/props (flex container, mono font, max-w-37.5,
truncate, title tooltip). Replace the inline definition in
create-api-request-columns.tsx with an import from `@unkey/ui` and update any
other column files to import the shared TruncatedTextCell to avoid duplication.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@web/apps/dashboard/app/`(app)/[workspaceSlug]/apis/[apiId]/_overview/components/table/logs-table.tsx:
- Around line 63-66: Change getRowClassName to accept a nullable second argument
and remove the unsafe cast: update the function signature in get-row-class.ts
(the exported getRowClassName) to take (log: KeysOverviewLog, selectedLog:
KeysOverviewLog | null) and adjust any internal typings accordingly (it already
uses optional chaining). Then in logs-table.tsx remove the "as KeysOverviewLog"
cast in getRowClassNameMemoized so it calls getRowClassName(log, selectedLog)
with selectedLog possibly null, and ensure getRowClassNameMemoized still depends
on [selectedLog].

In
`@web/apps/dashboard/components/root-keys-table/columns/create-root-key-columns.tsx`:
- Around line 26-27: The KEY column metadata is using accessorKey: "key" but the
RootKey model exposes the field as start and the cell renderer reads
row.original; update the KEY column in create-root-key-columns (symbol KEY) to
correctly align the accessor with the data by replacing accessorKey: "key" with
either accessorKey: "start" or an explicit accessorFn: (row) => row.start so
TanStack can use the accessor for sorting/filtering/export; ensure the custom
cell renderer that uses row.original continues to work after this change.

---

Outside diff comments:
In
`@web/apps/dashboard/components/api-requests-table/schema/keys-overview.schema.ts`:
- Line 14: The `cursor` schema entry currently uses `.nullable()` twice
(`cursor: z.number().nullable().optional().nullable()`); remove the duplicate
modifier so the field reads e.g. `cursor: z.number().nullable().optional()` (or
`z.number().optional().nullable()`), keeping only a single `.nullable()` and
preserving `.optional()` as intended on the `cursor` symbol in
keys-overview.schema.ts.

---

Nitpick comments:
In
`@web/apps/dashboard/app/`(app)/[workspaceSlug]/apis/[apiId]/_overview/components/table/logs-table.tsx:
- Around line 53-61: The code uses an unsafe type assertion (s.id as SortFields)
in handleSortingChange; replace it with a runtime guard that validates s.id
before converting to your SortFields union: implement a type predicate like
isSortField(id): id is SortFields and use it to filter/map the incoming next
array (from sorting) so you only call setSorts with entries whose s.id passes
isSortField, and handle or ignore invalid ids instead of casting; update
references in handleSortingChange and any related consumers that assume
SortFields.

In
`@web/apps/dashboard/components/api-requests-table/columns/create-api-request-columns.tsx`:
- Around line 16-22: TruncatedTextCell is defined inline and should be extracted
for reuse: create a shared component (e.g., TruncatedTextCell) inside the shared
cells library (`@unkey/ui`) that accepts a value prop (string) and preserves the
current layout/props (flex container, mono font, max-w-37.5, truncate, title
tooltip). Replace the inline definition in create-api-request-columns.tsx with
an import from `@unkey/ui` and update any other column files to import the shared
TruncatedTextCell to avoid duplication.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a5e39c64-7baf-45aa-b255-629c97645372

📥 Commits

Reviewing files that changed from the base of the PR and between a216904 and 3f6cc1b.

📒 Files selected for processing (27)
  • web/apps/dashboard/app/(app)/[workspaceSlug]/apis/[apiId]/_overview/components/table/logs-table.tsx
  • web/apps/dashboard/app/(app)/[workspaceSlug]/apis/[apiId]/_overview/logs-client.tsx
  • web/apps/dashboard/app/(app)/[workspaceSlug]/apis/[apiId]/keys/[keyAuthId]/[keyId]/components/table/utils/get-row-class.ts
  • web/apps/dashboard/components/api-requests-table/columns/create-api-request-columns.tsx
  • web/apps/dashboard/components/api-requests-table/columns/index.ts
  • web/apps/dashboard/components/api-requests-table/components/key-identifier-column.tsx
  • web/apps/dashboard/components/api-requests-table/components/log-details/components/log-header.tsx
  • web/apps/dashboard/components/api-requests-table/components/log-details/components/log-outcome-distribution-section.tsx
  • web/apps/dashboard/components/api-requests-table/components/log-details/components/log-section.tsx
  • web/apps/dashboard/components/api-requests-table/components/log-details/components/roles-permissions.tsx
  • web/apps/dashboard/components/api-requests-table/components/log-details/index.tsx
  • web/apps/dashboard/components/api-requests-table/hooks/use-keys-overview-query.ts
  • web/apps/dashboard/components/api-requests-table/schema/keys-overview.schema.ts
  • web/apps/dashboard/components/api-requests-table/utils/calculate-blocked-percentage.ts
  • web/apps/dashboard/components/api-requests-table/utils/get-row-class.ts
  • web/apps/dashboard/components/logs/hooks/use-sort.tsx
  • web/apps/dashboard/components/root-keys-table/columns/create-root-key-columns.tsx
  • web/apps/dashboard/components/root-keys-table/components/skeletons/render-root-key-skeleton-row.tsx
  • web/apps/dashboard/lib/trpc/routers/api/keys/query-overview-logs/index.ts
  • web/apps/dashboard/lib/trpc/routers/api/keys/query-overview-logs/utils.ts
  • web/internal/ui/src/components/data-table/components/cells/index.ts
  • web/internal/ui/src/components/data-table/components/cells/invalid-count-cell.tsx
  • web/internal/ui/src/components/data-table/components/cells/outcome-popover-cell.tsx
  • web/internal/ui/src/components/data-table/components/empty/empty-api-requests.tsx
  • web/internal/ui/src/components/data-table/components/empty/index.ts
  • web/internal/ui/src/components/data-table/data-table.tsx
  • web/internal/ui/src/components/data-table/index.ts
💤 Files with no reviewable changes (1)
  • web/apps/dashboard/app/(app)/[workspaceSlug]/apis/[apiId]/keys/[keyAuthId]/[keyId]/components/table/utils/get-row-class.ts

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

🧹 Nitpick comments (2)
web/apps/dashboard/components/root-keys-table/columns/create-root-key-columns.tsx (2)

89-105: Minor inconsistency: PERMISSIONS column doesn't use its descriptor's accessorKey.

The descriptor defines accessorKey: "permissions" but the column definition omits it. While this works since enableSorting: false means TanStack won't use the accessor for sorting, it's inconsistent with the other columns that fully utilize their descriptors.

Consider either adding accessorKey: ROOT_KEY_COLUMN_IDS.PERMISSIONS.accessorKey for consistency, or removing the unused accessorKey from the descriptor definition.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@web/apps/dashboard/components/root-keys-table/columns/create-root-key-columns.tsx`
around lines 89 - 105, Add the missing accessorKey to the PERMISSIONS column for
consistency: update the column object that uses ROOT_KEY_COLUMN_IDS.PERMISSIONS
to include accessorKey: ROOT_KEY_COLUMN_IDS.PERMISSIONS.accessorKey (leave other
props like enableSorting and cell using AssignedItemsCell unchanged). This keeps
the column descriptor consistent with the other columns that use their
descriptor.accessorKey, or alternatively remove the unused accessorKey from the
descriptor itself if you prefer that approach; reference
ROOT_KEY_COLUMN_IDS.PERMISSIONS, accessorKey, the column object in
create-root-key-columns.tsx, and the cell render that reads
rootKey.permissionSummary/selectedRootKeyId when making the change.

149-151: Minor inconsistency: ACTION column header doesn't use its descriptor.

The descriptor defines header: "Action" but line 151 hardcodes header: "". This works functionally since action columns typically don't display headers, but creates an inconsistency with how other columns derive their headers.

Consider either using ROOT_KEY_COLUMN_IDS.ACTION.header here or changing the descriptor's header to an empty string to accurately reflect usage.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@web/apps/dashboard/components/root-keys-table/columns/create-root-key-columns.tsx`
around lines 149 - 151, The ACTION column header is hardcoded to an empty string
but the descriptor ROOT_KEY_COLUMN_IDS.ACTION defines a non-empty header,
creating an inconsistency; update the column definition in
create-root-key-columns (the object with id: ROOT_KEY_COLUMN_IDS.ACTION.id) to
use ROOT_KEY_COLUMN_IDS.ACTION.header instead of "" (or alternatively change
ROOT_KEY_COLUMN_IDS.ACTION.header to "" if you prefer the descriptor to reflect
no visible header) so the header source is consistent with other columns.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@web/apps/dashboard/app/`(app)/[workspaceSlug]/apis/[apiId]/_overview/components/table/logs-table.tsx:
- Around line 40-42: The visual selection mismatch is caused by getRowClassName
comparing log.key_id to selectedLog?.key_id while rowSelection and getRowId use
request_id; modify getRowClassName (in get-row-class.ts) to check equality using
log.request_id === selectedLog?.request_id (or otherwise derive the same row id
used by getRowId) so the CSS highlight matches the controlled rowSelection state
that keys by request_id.
- Line 31: The paginated hook useKeysOverviewLogsQuery returns loadMore and
isLoadingMore but the component only destructures historicalLogs, isLoading,
hasMore and hides the footer; update the destructure to include loadMore and
isLoadingMore, remove the explicit hide: true on the footer, and wire the footer
props by passing onLoadMore: loadMore and isFetchingNextPage: isLoadingMore to
loadMoreFooterProps (keep using historicalLogs/isLoading/hasMore as before);
alternatively, if pagination should be removed, modify useKeysOverviewLogsQuery
to return the full dataset without loadMore and update calls that expect
loadMore/isLoadingMore accordingly.
- Around line 53-58: The handleSortingChange callback currently casts s.id with
"as SortFields", which breaks type safety; replace that cast by
validating/parsing s.id before calling setSorts: implement a small guard or
mapping (e.g. isSortField(id): id is SortFields or a map from string to
SortFields) and use it when transforming next.map(s => ...), filtering out or
rejecting unknown ids, and then call setSorts with only validated SortFields;
reference handleSortingChange, SortingState, SortFields, s.id and setSorts so
the unsafe assertion is removed and only parsed/guarded sort ids reach setSorts.

---

Nitpick comments:
In
`@web/apps/dashboard/components/root-keys-table/columns/create-root-key-columns.tsx`:
- Around line 89-105: Add the missing accessorKey to the PERMISSIONS column for
consistency: update the column object that uses ROOT_KEY_COLUMN_IDS.PERMISSIONS
to include accessorKey: ROOT_KEY_COLUMN_IDS.PERMISSIONS.accessorKey (leave other
props like enableSorting and cell using AssignedItemsCell unchanged). This keeps
the column descriptor consistent with the other columns that use their
descriptor.accessorKey, or alternatively remove the unused accessorKey from the
descriptor itself if you prefer that approach; reference
ROOT_KEY_COLUMN_IDS.PERMISSIONS, accessorKey, the column object in
create-root-key-columns.tsx, and the cell render that reads
rootKey.permissionSummary/selectedRootKeyId when making the change.
- Around line 149-151: The ACTION column header is hardcoded to an empty string
but the descriptor ROOT_KEY_COLUMN_IDS.ACTION defines a non-empty header,
creating an inconsistency; update the column definition in
create-root-key-columns (the object with id: ROOT_KEY_COLUMN_IDS.ACTION.id) to
use ROOT_KEY_COLUMN_IDS.ACTION.header instead of "" (or alternatively change
ROOT_KEY_COLUMN_IDS.ACTION.header to "" if you prefer the descriptor to reflect
no visible header) so the header source is consistent with other columns.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 200753c0-be6d-410e-9477-8cabbd7e079e

📥 Commits

Reviewing files that changed from the base of the PR and between 3f6cc1b and cc45163.

📒 Files selected for processing (3)
  • web/apps/dashboard/app/(app)/[workspaceSlug]/apis/[apiId]/_overview/components/table/logs-table.tsx
  • web/apps/dashboard/components/api-requests-table/utils/get-row-class.ts
  • web/apps/dashboard/components/root-keys-table/columns/create-root-key-columns.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • web/apps/dashboard/components/api-requests-table/utils/get-row-class.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant