Skip to content

Refactor API keys page#297

Draft
sarimrmalik wants to merge 11 commits intomainfrom
refactor/api-keys-page
Draft

Refactor API keys page#297
sarimrmalik wants to merge 11 commits intomainfrom
refactor/api-keys-page

Conversation

@sarimrmalik
Copy link
Copy Markdown
Collaborator

Summary

  • refactor the dashboard API keys page into focused page, table, row, and dialog components
  • update the team API-key flows to support the new UI structure and removal flow
  • show filtered key counts while searching so the page summary matches the visible table state

Testing

  • manual code review of the edited API keys page component
  • automated checks could not be run in this cloud environment because Bun is not installed and project dependencies are not bootstrapped
Open in Web Open in Cursor 

sarimrmalik and others added 6 commits April 15, 2026 12:43
- Added a new `ApiKeysPageContent` component for displaying API keys with search functionality.
- Introduced `ApiKeysTable` and `ApiKeysTableRow` components for better organization of API key data.
- Updated `CreateApiKeyDialog` to utilize TRPC for creating API keys and improved user feedback on key creation.
- Removed deprecated key management functions and actions, streamlining the codebase.
- Updated routing and data fetching to align with the new component structure.

This refactor improves the user experience for managing API keys within the dashboard.
- Replaced `updateTag` with `revalidateTag` for cache invalidation in the teams router.
- Updated the cache revalidation logic to ensure proper tag handling for API keys.

This change enhances cache management and aligns with the latest API standards.
- Removed the `TEAM_API_KEYS` cache tag from the cache configuration.
- Simplified API key creation and deletion logic by eliminating unnecessary cache revalidation calls.

This change streamlines the code and improves maintainability by focusing on relevant cache management.
…onality

- Introduced `DeleteApiKeyDialog` for confirming API key deletions.
- Refactored `CreateApiKeyDialog` to improve user experience and input handling.
- Updated `ApiKeysPageContent` to include a search field and total key count display.
- Enhanced `ApiKeysTable` and `ApiKeysTableRow` for better organization and visual clarity.
- Improved empty state handling in various components for clearer user feedback.

These changes streamline the API key management process and enhance the overall user interface.
- Updated the layout of the CreateApiKeyDialog to enhance user experience with clearer component structure.
- Replaced deprecated components and improved accessibility with appropriate dialog descriptions.
- Introduced form validation to ensure the API key name is not empty before submission.
- Streamlined button states based on input validity to prevent unnecessary submissions.

These changes contribute to a more intuitive and user-friendly API key creation process.
Co-authored-by: Sarim Malik <sarimrmalik@users.noreply.github.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 15, 2026

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

Project Deployment Actions Updated (UTC)
web Ready Ready Preview, Comment Apr 15, 2026 8:14pm
web-juliett Ready Ready Preview, Comment Apr 15, 2026 8:14pm

Request Review

- Introduced a new `UserAvatar` component for consistent avatar rendering across member and API key tables.
- Updated `ApiKeysPageContent` layout for improved responsiveness and user experience.
- Simplified `ApiKeysTableRow` to utilize the new `UserAvatar` component, enhancing code maintainability.
- Adjusted styles in `CreateApiKeyDialog` for better alignment and responsiveness.

These changes streamline the user interface and improve the overall experience in managing team members and API keys.
…nality

- Introduced new components for API key name, ID badge, last used, and added date cells to enhance code organization and readability.
- Replaced the existing copy button with a more interactive badge component for copying API key IDs.
- Adjusted column widths in the ApiKeysTable for better layout and responsiveness.
- Improved empty state handling in the ApiKeysTable to provide clearer user feedback.

These changes streamline the API key management interface and enhance user experience.
…ctionality

- Updated the API keys table row components to enhance UI consistency and readability.
- Replaced the RemoveIcon with TrashIcon for better visual representation of delete actions.
- Adjusted padding and column widths in the ApiKeysTable for a more responsive design.
- Enhanced the empty state handling to accommodate the new column structure.

These changes contribute to a more intuitive and user-friendly API key management experience.
…lity

- Replaced the deprecated `formatShortRelativeAgo` function with `formatRelativeAgo` for displaying last used timestamps in the `DeleteApiKeyDialog` and `getLastUsedLabel` function.
- Updated the `ApiKeysTableRow` to utilize `formatUTCTimestamp` for formatting last used dates in tooltips, enhancing clarity and consistency across the application.
- Removed unused `toIsoUtcString` function from `api-keys-utils.ts` to streamline the codebase.

These changes enhance the user experience by providing clearer and more consistent date representations for API keys.
- Simplified the dialog structure by removing unnecessary components and enhancing the layout for better readability.
- Updated the key deletion confirmation message to dynamically display the API key name and last used timestamp.
- Improved button states and accessibility features for a more intuitive user interaction.

These changes enhance the overall usability of the API key deletion process.
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