Skip to content

fix(admin_ui): fallback tokens#1408

Merged
paanSinghCoder merged 1 commit intomainfrom
fix/tokens-fallback
Feb 23, 2026
Merged

fix(admin_ui): fallback tokens#1408
paanSinghCoder merged 1 commit intomainfrom
fix/tokens-fallback

Conversation

@paanSinghCoder
Copy link
Contributor

Summary

Revert fallback logic

Changes

Technical Details

Test Plan

  • Manual testing completed
  • Build and type checking passes

@vercel
Copy link

vercel bot commented Feb 23, 2026

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

Project Deployment Actions Updated (UTC)
frontier Ready Ready Preview, Comment Feb 23, 2026 10:38am

@paanSinghCoder paanSinghCoder requested a review from rsbh February 23, 2026 10:37
@coderabbitai
Copy link

coderabbitai bot commented Feb 23, 2026

📝 Walkthrough

Summary by CodeRabbit

Bug Fixes

  • Fixed the add tokens dialog form initialization to properly apply default product values when the product identifier field is empty or unset.

Walkthrough

Changed the default value initialization logic in the AddTokensDialog form from nullish coalescing operator (??) to logical OR operator (||) for the product field, affecting how empty strings and falsy values trigger fallback to defaults.

Changes

Cohort / File(s) Summary
Form Default Value Logic
web/sdk/admin/views/organizations/details/layout/add-tokens-dialog.tsx
Modified product field default value resolution from nullish coalescing to logical OR operator, changing fallback behavior for falsy values including empty strings.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes


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

@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.

Caution

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

⚠️ Outside diff range comments (1)
web/sdk/admin/views/organizations/details/layout/add-tokens-dialog.tsx (1)

141-154: ⚠️ Potential issue | 🟡 Minor

Duplicate data-test-id on Cancel and Add buttons.

Both buttons carry data-test-id="add-tokens-invite-button", making them indistinguishable in selector-based tests. The Cancel button ID likely should be something like "add-tokens-cancel-button".

🐛 Proposed fix
-              <Button
-                data-test-id="add-tokens-invite-button"
-                type="reset"
-                color="neutral"
-                variant="outline"
-              >
+              <Button
+                data-test-id="add-tokens-cancel-button"
+                type="reset"
+                color="neutral"
+                variant="outline"
+              >
                 Cancel
               </Button>
🧹 Nitpick comments (2)
web/sdk/admin/views/organizations/details/layout/add-tokens-dialog.tsx (2)

22-24: Interface name InviteUsersDialogProps should be AddTokensDialogProps.

Copy-paste remnant; doesn't affect runtime but misleads readers tracing the type.

♻️ Proposed rename
-interface InviteUsersDialogProps {
+interface AddTokensDialogProps {
   onOpenChange: (open: boolean) => void;
 }
 
 // ...
 
-export const AddTokensDialog = ({ onOpenChange }: InviteUsersDialogProps) => {
+export const AddTokensDialog = ({ onOpenChange }: AddTokensDialogProps) => {

118-118: min={0} on the input conflicts with z.coerce.number().min(1) in the schema.

The browser allows typing 0 without any visual constraint, but Zod then rejects it — producing a slightly confusing experience. Aligning min={1} on the input prevents the value from even being enterable.

♻️ Proposed fix
-                          min={0}
+                          min={1}

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 59f0007 and b1e32e4.

📒 Files selected for processing (1)
  • web/sdk/admin/views/organizations/details/layout/add-tokens-dialog.tsx

@coveralls
Copy link

Pull Request Test Coverage Report for Build 22302526511

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 38.457%

Totals Coverage Status
Change from base Build 22301950801: 0.0%
Covered Lines: 16200
Relevant Lines: 42125

💛 - Coveralls

@paanSinghCoder paanSinghCoder merged commit 222d46d into main Feb 23, 2026
8 checks passed
@paanSinghCoder paanSinghCoder deleted the fix/tokens-fallback branch February 23, 2026 10:46
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.

3 participants