Skip to content

Show Error when rolling key fails#1967

Open
mosch wants to merge 2 commits intomainfrom
roll-key-error
Open

Show Error when rolling key fails#1967
mosch wants to merge 2 commits intomainfrom
roll-key-error

Conversation

@mosch
Copy link
Contributor

@mosch mosch commented Feb 12, 2026

CleanShot 2026-02-12 at 15 38 11

Summary by CodeRabbit

  • Bug Fixes
    • Added error alerts when API key rolling fails, displaying detailed error messages to help users understand and resolve issues
  • Style
    • Reorganized the API keys settings interface by moving the refresh button to a dedicated actions area for improved layout clarity

Copilot AI review requested due to automatic review settings February 12, 2026 14:38
@vercel
Copy link

vercel bot commented Feb 12, 2026

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

Project Deployment Actions Updated (UTC)
zudoku-cosmo-cargo Ready Ready Preview, Comment Feb 15, 2026 6:06am
zudoku-dev Ready Ready Preview, Comment Feb 15, 2026 6:06am

Request Review

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds error handling for the "Roll API Key" operation and improves the UI structure for the email verification prompt in API key settings.

Changes:

  • Added error alert display when rolling an API key fails, showing the error message to users
  • Restructured the Refresh button in email verification prompt to use ItemActions component for better UI consistency

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/zudoku/src/lib/plugins/api-keys/SettingsApiKeys.tsx Moved Refresh button from inside ItemDescription to a proper ItemActions wrapper for better component structure
packages/plugin-zuplo-monetization/src/pages/subscriptions/ApiKeysList.tsx Added destructive alert to display error messages when rolling API keys fails

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

github-actions bot commented Feb 12, 2026

Preview build of published Zudoku package for commit 21d8c4f.

See the deployment at: https://cf73da73.cosmocargo-public-package.pages.dev

Note

This is a preview of the Cosmo Cargo example using the Zudoku package published to a local registry to ensure it'll be working when published to the public NPM registry.

Last updated: 2026-02-15T06:07:25.715Z

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@coderabbitai
Copy link

coderabbitai bot commented Feb 15, 2026

📝 Walkthrough

Walkthrough

Two UI enhancements in plugin and API key management components. One adds error feedback when API key rolling fails, the other restructures button placement within email verification notice. Both are layout and display improvements without logic changes.

Changes

Cohort / File(s) Summary
Error Feedback UI
packages/plugin-zuplo-monetization/src/pages/subscriptions/ApiKeysList.tsx
Added conditional Alert component that displays "Could not roll API key" with error message details when rollKeyMutation fails.
Button Layout Restructuring
packages/zudoku/src/lib/plugins/api-keys/SettingsApiKeys.tsx
Relocated Refresh button from inline ItemDescription to dedicated ItemActions block within the Verified email required notice.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A button finds its perfect place,
Errors now show their graceful face,
With alerts and actions rearranged so neat,
The UI's dance is now complete! 🎨

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (28 files):

⚔️ docs/pages/docs/configuration/navigation.mdx (content)
⚔️ docs/sidebar.ts (content)
⚔️ examples/cosmo-cargo/zudoku.config.tsx (content)
⚔️ packages/plugin-zuplo-monetization/src/components/RedirectPage.tsx (content)
⚔️ packages/plugin-zuplo-monetization/src/pages/CheckoutPage.tsx (content)
⚔️ packages/plugin-zuplo-monetization/src/pages/ManagePaymentPage.tsx (content)
⚔️ packages/plugin-zuplo-monetization/src/pages/subscriptions/ActiveSubscription.tsx (content)
⚔️ packages/plugin-zuplo-monetization/src/pages/subscriptions/ApiKeysList.tsx (content)
⚔️ packages/zudoku/package.json (content)
⚔️ packages/zudoku/src/app/main.tsx (content)
⚔️ packages/zudoku/src/config/validators/InputNavigationSchema.ts (content)
⚔️ packages/zudoku/src/config/validators/NavigationSchema.ts (content)
⚔️ packages/zudoku/src/config/validators/icon-types.ts (content)
⚔️ packages/zudoku/src/config/validators/validate.ts (content)
⚔️ packages/zudoku/src/lib/components/MobileTopNavigation.tsx (content)
⚔️ packages/zudoku/src/lib/components/TopNavigation.tsx (content)
⚔️ packages/zudoku/src/lib/components/context/ZudokuContext.ts (content)
⚔️ packages/zudoku/src/lib/components/navigation/NavigationItem.tsx (content)
⚔️ packages/zudoku/src/lib/components/navigation/NavigationWrapper.tsx (content)
⚔️ packages/zudoku/src/lib/components/navigation/utils.ts (content)
⚔️ packages/zudoku/src/lib/core/ZudokuContext.ts (content)
⚔️ packages/zudoku/src/lib/plugins/api-keys/SettingsApiKeys.tsx (content)
⚔️ packages/zudoku/src/lib/plugins/openapi/OperationList.tsx (content)
⚔️ packages/zudoku/src/lib/plugins/openapi/util/buildTagCategories.test.ts (content)
⚔️ packages/zudoku/src/lib/plugins/openapi/util/buildTagCategories.ts (content)
⚔️ packages/zudoku/src/types.d.ts (content)
⚔️ packages/zudoku/src/vite/plugin-navigation.ts (content)
⚔️ pnpm-lock.yaml (content)

These conflicts must be resolved before merging into main.
Resolve conflicts locally and push changes to this branch.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Show Error when rolling key fails' accurately and concisely summarizes the main change: adding error UI feedback when API key roll operations fail.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch roll-key-error
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch roll-key-error
  • Create stacked PR with resolved conflicts
  • Post resolved changes as copyable diffs in a comment

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
packages/plugin-zuplo-monetization/src/pages/subscriptions/ApiKeysList.tsx (1)

133-138: Add a fallback message for empty error text.

If the backend returns an empty or missing message, the alert body will be blank. A small fallback improves UX.

♻️ Suggested tweak
       {rollKeyMutation.isError && (
         <Alert variant="destructive">
           <AlertTitle>Could not roll API key</AlertTitle>
-          <AlertDescription>{rollKeyMutation.error.message}</AlertDescription>
+          <AlertDescription>
+            {rollKeyMutation.error?.message ??
+              "Something went wrong while rolling the API key."}
+          </AlertDescription>
         </Alert>
       )}

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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

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

Labels

skip-changelog Will not appear in generated release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant