chore: new root key dialog#3637
Conversation
|
📝 WalkthroughWalkthroughA new React component, Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Navigation
participant CreateRootKeyButton
participant DialogContainer
User->>Navigation: Navigates to Root Keys page
Navigation->>CreateRootKeyButton: Renders button
User->>CreateRootKeyButton: Clicks "Create New Root Key"
CreateRootKeyButton->>DialogContainer: Opens modal dialog
User->>DialogContainer: Fills form, submits (submission currently stubbed)
Estimated code review effort2 (~15 minutes) Possibly related PRs
Suggested reviewers
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
|
ok grabbing a lunch item and ill fix these |
|
Thank you for following the naming conventions for pull request titles! 🙏 |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 7
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
apps/dashboard/app/(app)/settings/root-keys/components/create-root-key/create-rootkey-button.tsx(1 hunks)apps/dashboard/app/(app)/settings/root-keys/navigation.tsx(2 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: ogzhanolguncu
PR: unkeyed/unkey#3156
File: apps/dashboard/app/(app)/apis/[apiId]/_components/create-key/index.tsx:112-0
Timestamp: 2025-04-22T11:49:06.167Z
Learning: In the CreateKeyDialog component of Unkey, section navigation is designed to always allow progression even if validation fails, as visual indicators display the validation state of each section.
Learnt from: chronark
PR: unkeyed/unkey#2792
File: apps/dashboard/app/(app)/settings/user/update-user-email.tsx:76-78
Timestamp: 2025-01-07T19:55:33.055Z
Learning: In the Unkey codebase, the Empty component can be used as a container for loading states, as demonstrated in the UpdateUserEmail component where it wraps the Loading component.
Learnt from: ogzhanolguncu
PR: unkeyed/unkey#3242
File: apps/dashboard/app/(app)/apis/[apiId]/_overview/components/table/components/override-indicator.tsx:50-65
Timestamp: 2025-05-15T16:26:08.666Z
Learning: In the Unkey dashboard, Next.js router (router.push) should be used for client-side navigation instead of window.location.href to preserve client state and enable smoother transitions between pages.
Learnt from: ogzhanolguncu
PR: unkeyed/unkey#3315
File: apps/dashboard/app/(app)/apis/[apiId]/_components/create-key/components/general-setup.tsx:40-50
Timestamp: 2025-06-19T13:01:55.338Z
Learning: In the create-key form's GeneralSetup component, the Controller is intentionally bound to "identityId" as the primary field while "externalId" is set explicitly via setValue. The ExternalIdField component has been designed to handle this pattern where it receives identityId as its value prop but manages both identityId and externalId through its onChange callback.
Learnt from: ogzhanolguncu
PR: unkeyed/unkey#2143
File: apps/dashboard/components/ui/group-button.tsx:21-31
Timestamp: 2024-12-03T14:07:45.173Z
Learning: In the `ButtonGroup` component (`apps/dashboard/components/ui/group-button.tsx`), avoid suggesting the use of `role="group"` in ARIA attributes.
Learnt from: chronark
PR: unkeyed/unkey#2146
File: apps/dashboard/app/(app)/apis/[apiId]/settings/default-prefix.tsx:74-75
Timestamp: 2024-10-04T17:27:09.821Z
Learning: In `apps/dashboard/app/(app)/apis/[apiId]/settings/default-prefix.tsx`, the hidden `<input>` elements for `workspaceId` and `keyAuthId` work correctly without being registered with React Hook Form.
Learnt from: p6l-richard
PR: unkeyed/unkey#2085
File: apps/www/components/glossary/terms-stepper-mobile.tsx:16-20
Timestamp: 2024-10-23T16:25:33.113Z
Learning: In the `apps/www/components/glossary/terms-stepper-mobile.tsx` file, avoid suggesting to extract the term navigation logic into a custom hook, as the user prefers to keep the component straightforward.
Learnt from: Srayash
PR: unkeyed/unkey#2568
File: apps/dashboard/app/auth/sign-up/oauth-signup.tsx:25-25
Timestamp: 2024-10-25T23:53:41.716Z
Learning: In the React component `OAuthSignUp` (`apps/dashboard/app/auth/sign-up/oauth-signup.tsx`), adding a `useEffect` cleanup function to reset the `isLoading` state causes a "something went wrong" popup to appear before redirecting when a user clicks on signup.
Learnt from: ogzhanolguncu
PR: unkeyed/unkey#2825
File: apps/dashboard/app/(app)/logs-v2/components/controls/components/logs-datetime/index.tsx:0-0
Timestamp: 2025-01-30T20:38:00.058Z
Learning: In the logs dashboard, keyboard shortcuts that toggle UI elements (like popovers) should be implemented in the component that owns the state being toggled, not in the presentational wrapper components. For example, the 'T' shortcut for toggling the datetime filter is implemented in DatetimePopover, not in LogsDateTime.
apps/dashboard/app/(app)/settings/root-keys/navigation.tsx (7)
Learnt from: ogzhanolguncu
PR: #2143
File: apps/dashboard/components/ui/group-button.tsx:21-31
Timestamp: 2024-12-03T14:07:45.173Z
Learning: In the ButtonGroup component (apps/dashboard/components/ui/group-button.tsx), avoid suggesting the use of role="group" in ARIA attributes.
Learnt from: ogzhanolguncu
PR: #3242
File: apps/dashboard/app/(app)/apis/[apiId]/_overview/components/table/components/override-indicator.tsx:50-65
Timestamp: 2025-05-15T16:26:08.666Z
Learning: In the Unkey dashboard, Next.js router (router.push) should be used for client-side navigation instead of window.location.href to preserve client state and enable smoother transitions between pages.
Learnt from: p6l-richard
PR: #2085
File: apps/www/components/glossary/terms-stepper-mobile.tsx:16-20
Timestamp: 2024-10-23T16:25:33.113Z
Learning: In the apps/www/components/glossary/terms-stepper-mobile.tsx file, avoid suggesting to extract the term navigation logic into a custom hook, as the user prefers to keep the component straightforward.
Learnt from: ogzhanolguncu
PR: #3156
File: apps/dashboard/app/(app)/apis/[apiId]/_components/create-key/index.tsx:112-0
Timestamp: 2025-04-22T11:49:06.167Z
Learning: In the CreateKeyDialog component of Unkey, section navigation is designed to always allow progression even if validation fails, as visual indicators display the validation state of each section.
Learnt from: chronark
PR: #2146
File: apps/dashboard/app/(app)/apis/[apiId]/settings/default-prefix.tsx:74-75
Timestamp: 2024-10-04T17:27:09.821Z
Learning: In apps/dashboard/app/(app)/apis/[apiId]/settings/default-prefix.tsx, the hidden <input> elements for workspaceId and keyAuthId work correctly without being registered with React Hook Form.
Learnt from: chronark
PR: #3324
File: apps/dashboard/app/(app)/authorization/roles/components/upsert-role/components/warning-callout.tsx:22-27
Timestamp: 2025-07-03T11:57:15.263Z
Learning: The target prop on InlineLink components in the @unkey/ui package is a boolean prop, not a string. When target is truthy, it automatically sets target="_blank" and rel="noopener noreferrer" on the underlying anchor element. Using just target (equivalent to target={true}) is the correct way to make the link open in a new tab.
Learnt from: ogzhanolguncu
PR: #3528
File: apps/dashboard/app/(app)/settings/team/role-switcher.tsx:60-76
Timestamp: 2025-07-11T12:57:39.875Z
Learning: In the Select component from @unkey/ui, when fixing chevron overflow/positioning issues, applying w-fit directly to the SelectTrigger doesn't resolve the problem. A wrapper div with w-fit class around the entire Select component is required to properly contain the chevron within the trigger area.
apps/dashboard/app/(app)/settings/root-keys/components/create-root-key/create-rootkey-button.tsx (4)
Learnt from: ogzhanolguncu
PR: #2143
File: apps/dashboard/components/ui/group-button.tsx:21-31
Timestamp: 2024-12-03T14:07:45.173Z
Learning: In the ButtonGroup component (apps/dashboard/components/ui/group-button.tsx), avoid suggesting the use of role="group" in ARIA attributes.
Learnt from: chronark
PR: #2146
File: apps/dashboard/app/(app)/apis/[apiId]/settings/default-prefix.tsx:74-75
Timestamp: 2024-10-04T17:27:09.821Z
Learning: In apps/dashboard/app/(app)/apis/[apiId]/settings/default-prefix.tsx, the hidden <input> elements for workspaceId and keyAuthId work correctly without being registered with React Hook Form.
Learnt from: Srayash
PR: #2568
File: apps/dashboard/app/auth/sign-up/oauth-signup.tsx:25-25
Timestamp: 2024-10-25T23:53:41.716Z
Learning: In the React component OAuthSignUp (apps/dashboard/app/auth/sign-up/oauth-signup.tsx), adding a useEffect cleanup function to reset the isLoading state causes a "something went wrong" popup to appear before redirecting when a user clicks on signup.
Learnt from: ogzhanolguncu
PR: #3156
File: apps/dashboard/app/(app)/apis/[apiId]/_components/create-key/index.tsx:112-0
Timestamp: 2025-04-22T11:49:06.167Z
Learning: In the CreateKeyDialog component of Unkey, section navigation is designed to always allow progression even if validation fails, as visual indicators display the validation state of each section.
🪛 GitHub Actions: autofix.ci
apps/dashboard/app/(app)/settings/root-keys/components/create-root-key/create-rootkey-button.tsx
[error] 31-31: ESLint correctness/noUnusedVariables: This variable 'rest' is unused. Unused variables usually are result of incomplete refactoring, typos and other source of bugs.
[error] 33-33: ESLint correctness/noUnusedVariables: This variable 'trpcUtils' is unused. Unsafe fix suggested: prepend with underscore.
[error] 35-35: ESLint correctness/noUnusedVariables: This variable 'name' is unused. Unsafe fix suggested: prepend with underscore.
[error] 35-35: ESLint correctness/noUnusedVariables: This variable 'setName' is unused. Unsafe fix suggested: prepend with underscore.
[error] 36-36: ESLint correctness/noUnusedVariables: This variable 'showKeyInSnippet' is unused. Unsafe fix suggested: prepend with underscore.
[error] 36-36: ESLint correctness/noUnusedVariables: This variable 'setShowKeyInSnippet' is unused. Unsafe fix suggested: prepend with underscore.
[error] 37-37: ESLint correctness/noUnusedVariables: This variable 'isConfirmOpen' is unused. Unsafe fix suggested: prepend with underscore.
[error] 37-37: ESLint correctness/noUnusedVariables: This variable 'setIsConfirmOpen' is unused. Unsafe fix suggested: prepend with underscore.
[error] 38-38: ESLint correctness/noUnusedVariables: This variable 'pendingAction' is unused. Unsafe fix suggested: prepend with underscore.
[error] 38-38: ESLint correctness/noUnusedVariables: This variable 'setPendingAction' is unused. Unsafe fix suggested: prepend with underscore.
[error] 45-45: ESLint correctness/noUnusedVariables: This variable 'setValue' is unused.
[error] 46-46: ESLint correctness/noUnusedVariables: This variable 'watch' is unused.
[error] 47-47: ESLint correctness/noUnusedVariables: This variable 'isValid' is unused.
[error] 47-47: ESLint correctness/noUnusedVariables: This variable 'isSubmitting' is unused.
[error] 69-69: ESLint correctness/noUnusedVariables: Parameter 'values' in function 'onSubmit' is unused. Unsafe fix suggested: prepend with underscore.
🔇 Additional comments (3)
apps/dashboard/app/(app)/settings/root-keys/navigation.tsx (1)
7-7: Good refactoring to extract UI logic into a dedicated component.The extraction of the root key creation functionality into a dedicated
CreateRootKeyButtoncomponent improves separation of concerns and maintainability. The conditional rendering logic is preserved while abstracting the implementation details.Also applies to: 79-79
apps/dashboard/app/(app)/settings/root-keys/components/create-root-key/create-rootkey-button.tsx (2)
23-26: Form schema validation looks appropriate.The Zod schema provides reasonable validation with a 3-50 character range for the name field and array structure for permissions, which aligns with typical root key requirements.
131-131: Submit button is hardcoded as disabled.The submit button is currently hardcoded as
disabled={true}, which prevents form submission. This appears intentional for work-in-progress code, but ensure this gets updated when the mutation logic is implemented.Verify that the submit functionality will be enabled once the commented mutation code is implemented.
| import { useRouter } from "next/navigation"; | ||
| import { parseAsArrayOf, useQueryState } from "nuqs"; |
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Remove unused imports.
The useRouter from Next.js navigation and parseAsArrayOf, useQueryState from nuqs are imported but not used in the current implementation.
-import { useRouter } from "next/navigation";
-import { parseAsArrayOf, useQueryState } from "nuqs";📝 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.
| import { useRouter } from "next/navigation"; | |
| import { parseAsArrayOf, useQueryState } from "nuqs"; |
🤖 Prompt for AI Agents
In
apps/dashboard/app/(app)/settings/root-keys/components/create-root-key/create-rootkey-button.tsx
at lines 8 to 9, remove the unused imports: useRouter from next/navigation and
parseAsArrayOf, useQueryState from nuqs, as they are not used anywhere in the
file.
| ...rest | ||
| }: React.ButtonHTMLAttributes<HTMLButtonElement> & Props) => { | ||
| const trpcUtils = trpc.useUtils(); | ||
| const [isOpen, setIsOpen] = useState(defaultOpen ?? false); | ||
| const [name, setName] = useState<string | undefined>(undefined); | ||
| const [showKeyInSnippet, setShowKeyInSnippet] = useState(false); | ||
| const [isConfirmOpen, setIsConfirmOpen] = useState(false); | ||
| const [pendingAction, setPendingAction] = useState< | ||
| "close" | "create-another" | "go-to-details" | null | ||
| >(null); |
There was a problem hiding this comment.
Remove unused state variables to fix linting errors.
Multiple state variables are declared but never used, causing ESLint errors. Since this appears to be work-in-progress code, consider removing unused variables or prefixing them with underscore if they're planned for future use.
-const [name, setName] = useState<string | undefined>(undefined);
-const [showKeyInSnippet, setShowKeyInSnippet] = useState(false);
-const [isConfirmOpen, setIsConfirmOpen] = useState(false);
-const [pendingAction, setPendingAction] = useState<
- "close" | "create-another" | "go-to-details" | null
->(null);Or if these are planned for future implementation, prefix with underscore:
+const [_name, _setName] = useState<string | undefined>(undefined);
+const [_showKeyInSnippet, _setShowKeyInSnippet] = useState(false);
+const [_isConfirmOpen, _setIsConfirmOpen] = useState(false);
+const [_pendingAction, _setPendingAction] = useState<
+ "close" | "create-another" | "go-to-details" | null
+>(null);📝 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.
| ...rest | |
| }: React.ButtonHTMLAttributes<HTMLButtonElement> & Props) => { | |
| const trpcUtils = trpc.useUtils(); | |
| const [isOpen, setIsOpen] = useState(defaultOpen ?? false); | |
| const [name, setName] = useState<string | undefined>(undefined); | |
| const [showKeyInSnippet, setShowKeyInSnippet] = useState(false); | |
| const [isConfirmOpen, setIsConfirmOpen] = useState(false); | |
| const [pendingAction, setPendingAction] = useState< | |
| "close" | "create-another" | "go-to-details" | null | |
| >(null); | |
| ...rest | |
| }: React.ButtonHTMLAttributes<HTMLButtonElement> & Props) => { | |
| const trpcUtils = trpc.useUtils(); | |
| const [isOpen, setIsOpen] = useState(defaultOpen ?? false); |
🧰 Tools
🪛 GitHub Actions: autofix.ci
[error] 35-35: ESLint correctness/noUnusedVariables: This variable 'name' is unused. Unsafe fix suggested: prepend with underscore.
[error] 35-35: ESLint correctness/noUnusedVariables: This variable 'setName' is unused. Unsafe fix suggested: prepend with underscore.
[error] 36-36: ESLint correctness/noUnusedVariables: This variable 'showKeyInSnippet' is unused. Unsafe fix suggested: prepend with underscore.
[error] 36-36: ESLint correctness/noUnusedVariables: This variable 'setShowKeyInSnippet' is unused. Unsafe fix suggested: prepend with underscore.
[error] 37-37: ESLint correctness/noUnusedVariables: This variable 'isConfirmOpen' is unused. Unsafe fix suggested: prepend with underscore.
[error] 37-37: ESLint correctness/noUnusedVariables: This variable 'setIsConfirmOpen' is unused. Unsafe fix suggested: prepend with underscore.
[error] 38-38: ESLint correctness/noUnusedVariables: This variable 'pendingAction' is unused. Unsafe fix suggested: prepend with underscore.
[error] 38-38: ESLint correctness/noUnusedVariables: This variable 'setPendingAction' is unused. Unsafe fix suggested: prepend with underscore.
🤖 Prompt for AI Agents
In
apps/dashboard/app/(app)/settings/root-keys/components/create-root-key/create-rootkey-button.tsx
around lines 34 to 43, several state variables like name, showKeyInSnippet,
isConfirmOpen, and pendingAction are declared but not used, causing ESLint
errors. To fix this, either remove these unused state declarations if they are
not needed yet, or prefix their names with an underscore to indicate they are
intentionally unused placeholders for future implementation.
| const { | ||
| register, | ||
| handleSubmit, | ||
| setValue, | ||
| watch, | ||
| formState: { errors, isValid, isSubmitting }, | ||
| } = useForm<z.infer<typeof formSchema>>({ | ||
| resolver: zodResolver(formSchema), | ||
| mode: "onChange", | ||
| }); |
There was a problem hiding this comment.
Fix unused form hook variables.
Several variables from the form hook are unused, causing linting errors. Clean up unused variables or prefix with underscore if planned for future use.
const {
register,
handleSubmit,
- setValue,
- watch,
- formState: { errors, isValid, isSubmitting },
+ formState: { errors },
} = useForm<z.infer<typeof formSchema>>({
resolver: zodResolver(formSchema),
mode: "onChange",
});📝 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 { | |
| register, | |
| handleSubmit, | |
| setValue, | |
| watch, | |
| formState: { errors, isValid, isSubmitting }, | |
| } = useForm<z.infer<typeof formSchema>>({ | |
| resolver: zodResolver(formSchema), | |
| mode: "onChange", | |
| }); | |
| const { | |
| register, | |
| handleSubmit, | |
| formState: { errors }, | |
| } = useForm<z.infer<typeof formSchema>>({ | |
| resolver: zodResolver(formSchema), | |
| mode: "onChange", | |
| }); |
🤖 Prompt for AI Agents
In
apps/dashboard/app/(app)/settings/root-keys/components/create-root-key/create-rootkey-button.tsx
between lines 48 and 57, several variables returned from the useForm hook are
unused, causing linting errors. Remove the unused variables from the
destructuring assignment or prefix them with an underscore if you intend to use
them later, to resolve the lint warnings.
| // const selectedPermissions = watch("permissions"); | ||
|
|
||
| // const create = trpc.rootKey.create.useMutation({ | ||
| // onSuccess: async (res) => { | ||
| // toast.success("Your Root Key has been created"); | ||
| // await revalidate("/settings/root-keys"); | ||
| // api.overview.query.invalidate(); | ||
| // router.push(`/settings/root-keys/${res.keyId}`); | ||
| // setIsOpen(false); | ||
| // }, | ||
| // onError: (error) => { | ||
| // console.error(error); | ||
| // toast.error(error.message); | ||
| // }, | ||
| // }); | ||
|
|
||
| async function onSubmit(values: z.infer<typeof formSchema>) { | ||
| // create.mutate({ | ||
| // name: values.name, | ||
| // permissions: [], | ||
| // }); | ||
| } | ||
|
|
||
| // function handlePermissionChange(permission: string, checked: boolean) { | ||
| // const current = new Set(selectedPermissions); | ||
| // if (checked) { | ||
| // current.add(permission); | ||
| // } else { | ||
| // current.delete(permission); | ||
| // } | ||
| // setValue("permissions", Array.from(current), { shouldValidate: true }); | ||
| // } | ||
|
|
||
| // function handleSelectAll(group: string, checked: boolean) { | ||
| // const groupPerms = PERMISSIONS.find((g) => g.group === group)?.permissions || []; | ||
| // const current = new Set(selectedPermissions); | ||
| // if (checked) { | ||
| // groupPerms.forEach((p) => current.add(p)); | ||
| // } else { | ||
| // groupPerms.forEach((p) => current.delete(p)); | ||
| // } | ||
| // setValue("permissions", Array.from(current), { shouldValidate: true }); | ||
| // } |
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Consider cleaning up extensive commented code.
There's a large amount of commented-out code for mutation handling and permission selection. For work-in-progress code, consider either:
- Removing commented code and tracking planned features in TODOs/issues
- Converting key commented sections to TODO comments with specific implementation plans
This will improve code readability and maintainability.
Example approach:
-// const selectedPermissions = watch("permissions");
-// const create = trpc.rootKey.create.useMutation({...});
+// TODO: Implement permission selection logic
+// TODO: Implement TRPC mutation for root key creation with proper error handlingCommittable suggestion skipped: line range outside the PR's diff.
🧰 Tools
🪛 GitHub Actions: autofix.ci
[error] 69-69: ESLint correctness/noUnusedVariables: Parameter 'values' in function 'onSubmit' is unused. Unsafe fix suggested: prepend with underscore.
🤖 Prompt for AI Agents
In
apps/dashboard/app/(app)/settings/root-keys/components/create-root-key/create-rootkey-button.tsx
between lines 59 and 101, there is a large block of commented-out code related
to mutation handling and permission selection. To improve readability and
maintainability, remove this commented code entirely if it is not immediately
needed, or replace it with concise TODO comments that clearly describe the
intended future implementation. This keeps the code clean while preserving the
plan for these features.
| async function onSubmit(values: z.infer<typeof formSchema>) { | ||
| // create.mutate({ | ||
| // name: values.name, | ||
| // permissions: [], | ||
| // }); | ||
| } |
There was a problem hiding this comment.
Fix unused parameter in submit handler.
The values parameter is unused, causing a linting error. Since this is a stub implementation, prefix with underscore to indicate intentional non-use.
-async function onSubmit(values: z.infer<typeof formSchema>) {
+async function onSubmit(_values: z.infer<typeof formSchema>) {
// create.mutate({
// name: values.name,
// permissions: [],
// });
}📝 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.
| async function onSubmit(values: z.infer<typeof formSchema>) { | |
| // create.mutate({ | |
| // name: values.name, | |
| // permissions: [], | |
| // }); | |
| } | |
| async function onSubmit(_values: z.infer<typeof formSchema>) { | |
| // create.mutate({ | |
| // name: values.name, | |
| // permissions: [], | |
| // }); | |
| } |
🤖 Prompt for AI Agents
In
apps/dashboard/app/(app)/settings/root-keys/components/create-root-key/create-rootkey-button.tsx
around lines 75 to 80, the onSubmit function has an unused parameter 'values'
causing a linting error. Rename the parameter to '_values' to indicate
intentional non-use and resolve the lint warning while keeping the stub
implementation.
| <FormInput | ||
| label="Name" | ||
| description="Give your key a name, this is not customer facing." | ||
| error={errors.name?.message} | ||
| {...register("name")} | ||
| placeholder="key-name" | ||
| /> |
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Consider label clarity based on PR feedback.
The current label is "Name" which is generic. Based on the PR comments, there was feedback to change "Root Key" to "Root Key Name" for clarity. Consider using a more descriptive label like "Root Key Name" to improve user understanding.
<FormInput
- label="Name"
+ label="Root Key Name"
description="Give your key a name, this is not customer facing."
error={errors.name?.message}
{...register("name")}
placeholder="key-name"
/>📝 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.
| <FormInput | |
| label="Name" | |
| description="Give your key a name, this is not customer facing." | |
| error={errors.name?.message} | |
| {...register("name")} | |
| placeholder="key-name" | |
| /> | |
| <FormInput | |
| - label="Name" | |
| + label="Root Key Name" | |
| description="Give your key a name, this is not customer facing." | |
| error={errors.name?.message} | |
| {...register("name")} | |
| placeholder="key-name" | |
| /> |
🤖 Prompt for AI Agents
In
apps/dashboard/app/(app)/settings/root-keys/components/create-root-key/create-rootkey-button.tsx
around lines 145 to 151, update the FormInput label from "Name" to "Root Key
Name" to improve clarity and align with PR feedback. This change will make the
label more descriptive and help users better understand the input purpose.
| <Button type="button" variant="outline" size="md" className="w-fit rounded-lg pl-3"> | ||
| Select Permissions... | ||
| </Button> |
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Implement permissions selection functionality.
The permissions selection is currently just a placeholder button. This is likely the next step in the implementation to address the form's permissions validation requirement.
Would you like me to help implement the permissions selection UI or create an issue to track this functionality?
🤖 Prompt for AI Agents
In
apps/dashboard/app/(app)/settings/root-keys/components/create-root-key/create-rootkey-button.tsx
around lines 158 to 160, the "Select Permissions..." button is currently a
placeholder without functionality. Implement the permissions selection UI by
adding an interactive component such as a dropdown or modal that allows users to
choose permissions. Connect this UI to the form state to ensure permissions are
properly captured and validated. If this is a larger task, create a tracking
issue to implement this feature incrementally.
Graphite Automations"Post a GIF when PR approved" took an action on this PR • (07/21/25)1 gif was posted to this PR based on Andreas Thomas's automation. |
* chore: new root key dialog (#3637) * Dialog created * small changes * feat: ui show permission side bar when select permission button is (#3654) * Dialog created * small changes * half functional * small spacing changes and chevron * Rabbit Changes * remove useffect * feat: UI when a permission is selected it should show in the modal (#3663) * Dialog created * small changes * half functional * small spacing changes and chevron * Rabbit Changes * remove useffect * almost * re ordered badge list collapse * undo rabbit * [autofix.ci] apply automated fixes * fix scroll * button size and margin --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * feat: UI when a user searches for a permission it should show (#3695) * Dialog created * small changes * half functional * small spacing changes and chevron * Rabbit Changes * remove useffect * almost * re ordered badge list collapse * undo rabbit * [autofix.ci] apply automated fixes * fix scroll * changes before merge * functioning again * style change * more tweaks * Fix all the fucking things * remove close button * fmt --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: James Perkins <jamesperkins@hey.com> * feat: rootkey create with success dialog and confirm close (#3714) * Dialog created * small changes * half functional * small spacing changes and chevron * Rabbit Changes * remove useffect * almost * re ordered badge list collapse * undo rabbit * [autofix.ci] apply automated fixes * fix scroll * changes before merge * functioning again * style change * more tweaks * Fix all the fucking things * remove close button * fmt * dialog and confirm added --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: James Perkins <jamesperkins@hey.com> * feat: a user selects edit root key and an edit root key modal (#3731) * Dialog created * small changes * half functional * small spacing changes and chevron * Rabbit Changes * remove useffect * almost * re ordered badge list collapse * undo rabbit * [autofix.ci] apply automated fixes * fix scroll * changes before merge * chore: deprecate v1 endpoints (#3680) * fix: openapi * chore: deprecate v1 endpoints * fix: vault credentials and chproxy config (#3681) * fix: openapi * fix: vault credentials and chproxy config * fix: rename flag accessor too * fix: linter issues * fix: some more v2 api changes (#3677) * remove namespaceID * actually use limit and cursor * filter out delted overrides * fix error messages list endpoints * fix more error messages * ensure identity create handles like permission/role create * fix regex for roles * fix regex for roles * fix list keys cursor * fix: uppercase common files (#3683) * name files uppercase * name files uppercase * [autofix.ci] apply automated fixes * name files uppercase * name files uppercase --------- Co-authored-by: Andreas Thomas <dev@chronark.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * fix: conflicting casing (#3689) * fix the openapi spec again (#3692) * dont trace chproxy endpoints (#3691) * fix: log verifications to the owning workspace (#3693) * functioning again * style change * more tweaks * fix: validate s3 config (#3694) * Fix all the fucking things * remove close button * fmt * fix: speakeasy ignore directive is ignored if it's a string (#3699) * fix: upsert permissions with slug or name colission (#3696) * fix: upsert permissions with slug or name colission * chore: also remove index * fix permission test and remove unnnecessary test --------- Co-authored-by: Flo <53355483+Flo4604@users.noreply.github.com> * docs: migration (#3678) * fix: openapi * docs: migration from v1 to v2 * fix: remove binaries * [autofix.ci] apply automated fixes * docs: add james' feedback --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * fix: api list keys zod errors (#3702) * fix api zod errors * [autofix.ci] apply automated fixes * make array handling uniform * make array handling uniform * fix rabbi comment * fix: permission array for roles --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * ci: don't build for windows and freebsd (#3700) * docs: errors (#3703) * chore: move sdks to unkeyed/sdks (#3701) * fix: omitting array vs null (#3704) * fix omitting array vs null * [autofix.ci] apply automated fixes * fix flakey test * fix flakey test --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * fix: panics not being catched (#3706) * fix panics not being catched * feat: add counter to track panics Signed-off-by: Ian Meyer <k@imeyer.io> --------- Signed-off-by: Ian Meyer <k@imeyer.io> Co-authored-by: Ian Meyer <k@imeyer.io> * docs: use `CodeGroup` in hono/nextjs TS libraries (#3708) * Update hono.mdx * Update nextjs.mdx * ci: remove outdated steps and flows (#3709) * docs: update sdks (#3712) * docs: update sdks * Update nextjs.mdx * [autofix.ci] apply automated fixes * fix: rabbit feedback * Update nextjs.mdx * fix: root key is required --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * dialog and confirm added * feat(deployment beta): projects UI for Unkey Deploy (#3662) * projects and branches * wip * wip * spec differ wip * fix some docker, add some trpc, integrate diff viewer * change version to deployments, add feature flag, update go schema * update versions page * fix null condition * delete old router, fix null assertion * fmt * fmt * fmt again * apply auth and feature flagging access to projects, remove versions * yolo * stable yolo * stable yolo * style: fmt * fix: hardcode time, so it doesn't fail on the first of a month * [autofix.ci] apply automated fixes --------- Co-authored-by: chronark <dev@chronark.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * chore: add missingd delete endpoint for v2 (#3711) * only log key at the end (#3716) * fix: allow wildcard and colon in permissions query (#3717) * remove regex for permissions * allow for asterix and colon in permissions * fix: update identity by identity key instead of externalId and fix wrong body for permission and role (#3713) * docs and remove externalId from keyResponse * fix updateIdentity to take in an identity parameter instead of an externalId * fix get role/permission * Update go/apps/api/openapi/spec/common/Permission.yaml Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update openapi-generated.yaml * fix comment --------- Co-authored-by: Andreas Thomas <dev@chronark.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * chore: openapi references (#3723) * feat: add paginated tRPC endpoint for projects (#3697) * feat: add new endpoint for deploy projects * chore: replace file path * [autofix.ci] apply automated fixes * feat: add missing endpoint * fix: trpc path * fix: add feature flag * chore: remove optin --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * fix: region not showing and wrong rl id (#3722) * fix: region not showing and wrong rl id * pass region down * perf: bad get key performance (#3724) * perf: make getKey 2 seperate queries so mysql chooses correct idx * fix query * fix query name * docs: verify identities endpoints (#3727) * chore: docs (#3728) * chore: fixup migration guide * adjust more * adjust more * adjust more * rabbit comments * Update index.mdx * working updates * re factor for clarity * only update if diff than existing * [autofix.ci] apply automated fixes * re name create-root-key to root-key folder --------- Signed-off-by: Ian Meyer <k@imeyer.io> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Andreas Thomas <dev@chronark.com> Co-authored-by: Flo <53355483+Flo4604@users.noreply.github.com> Co-authored-by: Oğuzhan Olguncu <21091016+ogzhanolguncu@users.noreply.github.com> Co-authored-by: James Perkins <jamesperkins@hey.com> Co-authored-by: Ian Meyer <k@imeyer.io> Co-authored-by: JA Castro <51177379+ubinatus@users.noreply.github.com> Co-authored-by: Meg Stepp <mcstepp@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fresh * start rabbit changes * rabbits * missing processing * Update apps/dashboard/lib/trpc/routers/index.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update apps/dashboard/app/(app)/settings/root-keys/components/root-key/components/permission-badge-list.tsx Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * more rabbit * function name * [autofix.ci] apply automated fixes * minor changes * rabbit checked locally * comment changes * light mode fix * removed old page files * updated success * slack comment changes * cleanup * rabbit * more rabbits * most consts * change clear and details * cleanup * pr suggested changes * few nits --------- Signed-off-by: Ian Meyer <k@imeyer.io> Co-authored-by: CodeReaper <148160799+MichaelUnkey@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Andreas Thomas <dev@chronark.com> Co-authored-by: Flo <53355483+Flo4604@users.noreply.github.com> Co-authored-by: Oğuzhan Olguncu <21091016+ogzhanolguncu@users.noreply.github.com> Co-authored-by: Ian Meyer <k@imeyer.io> Co-authored-by: JA Castro <51177379+ubinatus@users.noreply.github.com> Co-authored-by: Meg Stepp <mcstepp@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: MichaelUnkey <michael@unkey.com>



What does this PR do?
Fixes # (issue)
If there is not an issue for this, please create one first. This is used to tracking purposes and also helps use understand why this PR exists
Type of change
How should this be tested?
Checklist
Required
pnpm buildpnpm fmtconsole.logsgit pull origin mainAppreciated
Summary by CodeRabbit