Skip to content

feat: add button-v2#2933

Merged
chronark merged 17 commits intomainfrom
button-v2
Mar 4, 2025
Merged

feat: add button-v2#2933
chronark merged 17 commits intomainfrom
button-v2

Conversation

@ogzhanolguncu
Copy link
Contributor

@ogzhanolguncu ogzhanolguncu commented Mar 4, 2025

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

  • 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?

  • Test A
  • Test B

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
  • 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

Summary by CodeRabbit

  • New Features

    • Introduced a new button featuring a built-in keyboard shortcut for quick search.

    • Launched a unified dialog container for consistent modal interactions.

    • Expanded the icon set to enrich visual elements.

  • Refactor & Improvements

    • Revamped the button component with additional color variants, improved loading states, and enhanced accessibility.

    • Updated the UI color palette with new dynamic tokens and refined opacity settings.

    • Standardized modals, forms, and data displays for a smoother user experience.

    • Streamlined dialog implementations across multiple components.

    • Enhanced button styling with new size and rounded corner properties.

  • Documentation

    • Revised guidelines now include detailed examples on button usage and color schemes.

    • Enhanced documentation for color categories and accessibility features.

  • Bug Fixes

    • Improved visual feedback for buttons on hover and focus states.

    • Addressed inconsistencies in button sizes and styles across various components.

    • Updated button properties to ensure consistent appearance and usability.

@changeset-bot
Copy link

changeset-bot bot commented Mar 4, 2025

⚠️ No Changeset found

Latest commit: 84f4600

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Mar 4, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 4, 2025 6:24pm
engineering ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 4, 2025 6:24pm
play ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 4, 2025 6:24pm
www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 4, 2025 6:24pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 4, 2025

📝 Walkthrough

Walkthrough

This pull request removes several example button components and updates documentation to provide a more detailed overview of button variants, states, and features. A new button with keyboard shortcut support is introduced, and the main button component is refactored to include new styling variants, accessibility attributes, and loading behavior. In addition, CSS and Tailwind configurations are revised with expanded color variables, and various dashboard dialog and form components are refactored to use a unified dialog container. Minor updates include icon additions, improvements in number formatting, and simplified input focus styling.

Changes

File(s) Change Summary
apps/engineering/content/design/components/button.{disabled,icons,keyboard,loading,onClick,shape,variant}.tsx Removed example components demonstrating disabled state, icons, keyboard interactions, loading, onClick events, shape variations, and variant usages.
apps/engineering/content/design/components/button.mdx Updated documentation with enhanced descriptions, examples for multiple button variants (Primary, Outline, Ghost, etc.), size variants, icon usage, and keyboard shortcuts; added new components (ButtonWithKeyboardShortcut, AutoTypeTable) and sections.
apps/engineering/content/design/components/button.tsx Added new ButtonWithKeyboardShortcut component that supports a keyboard shortcut (Command/Ctrl+B) triggering a counter increment.
internal/ui/colors.css, internal/ui/tailwind.config.js, apps/engineering/content/design/colors.mdx Introduced a comprehensive set of new CSS color variables with transparency options, refactored Tailwind color generation using a new helper, and enhanced color documentation with additional sections (orange, accent, Alpha Colors).
apps/engineering/content/design/icons.mdx Added several new icon components and replaced an existing icon (CircleCarretRight replaced with CircleInfo) to update the iconography listings.
internal/ui/src/components/button.tsx Revised the button component’s structure and styling: updated default variant and size, introduced new color and compound variants, added a loadingLabel property, incorporated an animated loading spinner, and improved keyboard event and accessibility handling.
apps/dashboard/{app/**,components/**} Refactored multiple dashboard components—including namespace/API creation buttons, various dialog components (delete, identifier, namespace deletion), the navbar, settings, logs refresh button, and dialog styling—to use a unified DialogContainer with streamlined form handling and updated button properties; also updated the API list card to format key counts.
internal/ui/src/components/input.tsx Removed conditional focus ring classes for input variants when a placeholder is not shown, simplifying the visual focus feedback.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant B as ButtonWithKeyboardShortcut
    participant C as Counter

    U->>B: Press Command/Ctrl+B
    B->>C: Increment counter
Loading
sequenceDiagram
    participant U as User
    participant Btn as Action Button
    participant DC as DialogContainer
    participant Form as Form Handler

    U->>Btn: Clicks to open dialog
    Btn->>DC: Sets isOpen = true
    DC->>Form: Renders form content
    U->>Form: Populates and submits form
    Form->>DC: Submission success callback
    DC-->>U: Closes dialog (isOpen = false)
Loading

Possibly related PRs

Suggested labels

🕹️ oss.gg, :joystick: 150 points, Needs Approval

Suggested reviewers

  • mcstepp
  • chronark
  • perkinsjr

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d79b080 and 84f4600.

📒 Files selected for processing (1)
  • apps/dashboard/app/(app)/apis/_components/api-list-card.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/dashboard/app/(app)/apis/_components/api-list-card.tsx
⏰ Context from checks skipped due to timeout of 90000ms (16)
  • GitHub Check: Test Packages / Test ./packages/rbac
  • GitHub Check: Test Packages / Test ./packages/api
  • GitHub Check: Test Packages / Test ./packages/nextjs
  • GitHub Check: Test Packages / Test ./packages/cache
  • GitHub Check: Test Packages / Test ./internal/keys
  • GitHub Check: Test Packages / Test ./internal/clickhouse
  • GitHub Check: Test Packages / Test ./packages/hono
  • GitHub Check: Test Packages / Test ./internal/id
  • GitHub Check: Test Packages / Test ./internal/resend
  • GitHub Check: Test Packages / Test ./internal/billing
  • GitHub Check: Test Agent Local / test_agent_local
  • GitHub Check: Test API / API Test Local
  • GitHub Check: Test Go API Local / test_agent_local
  • GitHub Check: Build / Build
  • GitHub Check: autofix
  • GitHub Check: Analyze (javascript-typescript)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2025

Thank you for following the naming conventions for pull request titles! 🙏

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

🧹 Nitpick comments (15)
apps/engineering/content/design/components/button.tsx (1)

1-22: Consider blocking the default browser shortcut or verifying the user intent.
By default, some browsers may already use certain Cmd/Ctrl + key shortcuts. If overriding a system or browser shortcut is not intended, consider calling e.preventDefault() to avoid conflicting actions or let users know they’re overriding a default shortcut. Otherwise, the new feature logic and rendering approach look good.

internal/ui/tailwind.config.js (4)

19-20: Revisit the drop shadow for better consistency.
A shadow with zero offsets and a 3px spread may produce a subtle outline effect. Verify that this meets your design guidelines and user experience expectations.


21-41: Evaluate necessity of extensive opacity values.
This wide range of opacity steps (in increments of 5) can be helpful, but ensure they are all truly needed to avoid cluttering your utility classes.


48-63: Provide a fallback strategy for missing color variables.
getColor is well-structured, but consider how you want to handle cases where colorVar is invalid or undefined—adding a default, try-catch, or a console warning can help with diagnosing color configuration mistakes.


65-88: Double-check alpha-color coverage for all relevant color sets.
Currently, only a few color sets have alpha variants. If your design specs require alpha shades for other colors (e.g., info, accent), consider adding them for consistency.

apps/engineering/content/design/components/button.mdx (5)

2-3: Add a concise version name or broader context to the title.

While the title and description are clear, consider specifying "Button v2" in the title or providing a short versioning note to help distinguish from the previous button documentation if both exist concurrently.


21-33: Use caution with Tailwind's !important classes.

Applying !bg-accent-12/90 and !ring-4 !ring-gray-7 can override other variant or state behaviors, which might lead to style inconsistencies in certain contexts. Consider scoping these overrides to necessary usage only.


170-203: Ensure caution with partial destructive states.

While "Danger - Ghost" or "Warning - Primary" states are visually distinct, be mindful that minimal emphasis on destructive actions (e.g., ghost variant) can lead to accidental clicks. Ensure user confirmation flows are implemented if needed.


355-360: Add examples with icons in each size variant (optional).

Showing icons across size variants can help users understand how icons scale. This can reduce confusion among consumers of the button component.


433-433: Avoid intensifiers like "very" in documentation.

The phrase "Consider stacking buttons vertically on very small screens" might be simplified to "on small screens" or "on extremely small screens" for more precise context.

-Consider stacking buttons vertically on very small screens
+Consider stacking buttons vertically on small screens
🧰 Tools
🪛 LanguageTool

[style] ~433-~433: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ...Consider stacking buttons vertically on very small screens

(EN_WEAK_ADJECTIVE)

internal/ui/src/components/button.tsx (2)

13-30: Consider grouping or commenting compound variants for clarity.

Large arrays of strings make it hard to maintain or extend variants. Grouping them with inline comments or subdividing them by sub-variant (e.g., "base styles," "disabled states," etc.) can maintain clarity.


307-318: Extract reduced-motion logic for reuse.

Embedding the reduced-motion preference style injection here is convenient, but placing it in a separate module or global CSS might be more maintainable, especially if multiple components require a similar pattern.

 // Button.tsx
-if (typeof document !== "undefined") {
-  const style = document.createElement("style");
-  style.textContent = `...`;
-  document.head.appendChild(style);
-}
+// Proposed approach: separate a .css or .ts file with a global style that handles prefers-reduced-motion,
+// then import it once at a higher level (e.g., _app.tsx in Next.js or your global stylesheet).
internal/ui/colors.css (3)

25-37: Ensure consistent naming or grouping for GrayA (Slate A).

You’ve labeled them "GrayA" but commented them as “(Slate A).” For clarity, confirm whether this naming convention is desired or if merging them into "grayA" or "slateA" is more consistent.


67-79: Verify color contrast for success shades.

The new alpha-based success shades should be tested to meet WCAG AA minimum contrast ratios on various backgrounds.

Please run a script or external check to confirm color contrast for updated success shades.


210-222: Maintain consistent naming across dark theme overrides.

You’re reusing grayA in the dark theme as “SlateA,” which might cause naming confusion if you also refer to slate-based colors differently. Double-check that references remain coherent for theming across the codebase.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 34cb45a and fdc16ce.

📒 Files selected for processing (13)
  • apps/engineering/content/design/components/button.disabled.tsx (0 hunks)
  • apps/engineering/content/design/components/button.icons.tsx (0 hunks)
  • apps/engineering/content/design/components/button.keyboard.tsx (0 hunks)
  • apps/engineering/content/design/components/button.loading.tsx (0 hunks)
  • apps/engineering/content/design/components/button.mdx (1 hunks)
  • apps/engineering/content/design/components/button.onClick.tsx (0 hunks)
  • apps/engineering/content/design/components/button.shape.tsx (0 hunks)
  • apps/engineering/content/design/components/button.tsx (1 hunks)
  • apps/engineering/content/design/components/button.variant.tsx (0 hunks)
  • internal/ui/colors.css (9 hunks)
  • internal/ui/src/components/button.tsx (2 hunks)
  • internal/ui/src/index.ts (1 hunks)
  • internal/ui/tailwind.config.js (1 hunks)
💤 Files with no reviewable changes (7)
  • apps/engineering/content/design/components/button.icons.tsx
  • apps/engineering/content/design/components/button.keyboard.tsx
  • apps/engineering/content/design/components/button.loading.tsx
  • apps/engineering/content/design/components/button.shape.tsx
  • apps/engineering/content/design/components/button.onClick.tsx
  • apps/engineering/content/design/components/button.disabled.tsx
  • apps/engineering/content/design/components/button.variant.tsx
🧰 Additional context used
🪛 LanguageTool
apps/engineering/content/design/components/button.mdx

[style] ~433-~433: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ...Consider stacking buttons vertically on very small screens

(EN_WEAK_ADJECTIVE)

⏰ Context from checks skipped due to timeout of 90000ms (18)
  • GitHub Check: Test Packages / Test ./packages/rbac
  • GitHub Check: Test Packages / Test ./packages/nextjs
  • GitHub Check: Test Packages / Test ./packages/hono
  • GitHub Check: Test Packages / Test ./packages/cache
  • GitHub Check: Test Packages / Test ./packages/api
  • GitHub Check: Test Packages / Test ./internal/clickhouse
  • GitHub Check: Test Packages / Test ./internal/resend
  • GitHub Check: Test Packages / Test ./internal/keys
  • GitHub Check: Test Packages / Test ./internal/id
  • GitHub Check: Test Packages / Test ./internal/hash
  • GitHub Check: Test Packages / Test ./internal/encryption
  • GitHub Check: Test Packages / Test ./internal/billing
  • GitHub Check: Test Agent Local / test_agent_local
  • GitHub Check: Test API / API Test Local
  • GitHub Check: Build / Build
  • GitHub Check: Test Go API Local / test_agent_local
  • GitHub Check: autofix
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (6)
internal/ui/tailwind.config.js (1)

15-15: Dynamic color generation looks good.
Using generateRadixColors() is a solid way to maintain a centralized, scalable color system. This extends Tailwind’s capabilities without adding unnecessary complexity.

apps/engineering/content/design/components/button.mdx (2)

387-391: Confirm keyboard shortcut usage.

The example snippet is informative. If showing advanced usage, consider also displaying how to customize the trigger function for other keys or combos.


6-10:

Details

❓ Verification inconclusive

Confirm usage of the newly imported modules.

The RenderComponentWithSnippet and Button imports look appropriate, but verify that no references to the old example components remain in the docs or codebase to avoid confusion or dead imports.


🏁 Script executed:

#!/bin/bash
# Description: Search for references to old example components in the codebase
rg "DisabledExample|IconsExample|KeyboardExample|LoadingExample|OnClickExample|ShapeExample" 

Length of output: 94


Action: Verify that no deprecated example components remain in the codebase.

The new imports for RenderComponentWithSnippet and Button appear correct. However, our automated search for references to old example components (e.g., DisabledExample, IconsExample, KeyboardExample, LoadingExample, OnClickExample, ShapeExample) did not return any matches. Given that the automated output was minimal and potentially inconclusive, please perform a manual review of the documentation and relevant source files to ensure these deprecated components are not referenced anywhere else.

internal/ui/src/components/button.tsx (2)

9-9: Validate layering of CSS classes.

The default class string for buttonVariants includes multiple utility classes with potential overlap (e.g., group, inline-flex, transition-colors, etc.). Ensure there's no unintended conflict with custom states, especially when combining with companion libraries or advanced theming systems.


203-216: Commendable accessibility approach with aria-disabled and aria-busy.

Your approach ensures that screen readers and other assistive technologies correctly interpret button states. This is a best practice for inclusive design.

internal/ui/colors.css (1)

109-121: Cross-check partial transparency in the AmberA series.

Transparent overlays, especially in UI overlays or backgrounds, can stack in complex ways. Confirm that alpha layering remains visually clear when combined with other brand or background colors.

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

🧹 Nitpick comments (2)
internal/ui/src/components/button.tsx (2)

50-144: Comprehensive compound variants but consider DRYer approach

The compound variants implementation is thorough and addresses all combinations of variant and color, which is excellent. However, there's significant repetition in the focus styles, border-radius values, and hover states across variants.

Consider extracting common styles into shared variables or helper functions to reduce repetition. For example:

+ // Define common focus styles by color
+ const getFocusStyles = (color: string) => `focus:border-${color}-11 focus:ring-4 focus:ring-${color}-7 focus-visible:outline-none focus:ring-offset-0`;
+ 
+ // Define common disabled styles by variant
+ const getDisabledStyles = (variant: string) => variant === 'primary' 
+   ? 'disabled:bg-$color-7 disabled:text-white/80' 
+   : 'disabled:text-$colorA-7';

  // Then in your compound variants:
  {
    variant: "primary",
    color: "danger",
    className: [
      "text-white bg-error-9 hover:bg-error-10 rounded-md font-medium focus:hover:bg-error-10",
-     "focus:border-error-11 focus:ring-4 focus:ring-error-7 focus-visible:outline-none focus:ring-offset-0",
+     getFocusStyles("error"),
      "disabled:bg-error-6 disabled:text-white/80",
      "active:bg-error-11",
    ],
  },

This approach would make the code more maintainable as changes to focus styles would only need to be made in one place.


267-270: Consider animating the loading indicator with CSS instead of class

While the animate-spin class works, consider using CSS animations that can be more easily controlled with the prefers-reduced-motion preference. This would allow for a more direct connection between the animation and the reduced motion preference.

<Loader
-   className="animate-spin"
+   className="loader-spin"
    data-prefers-reduced-motion="respect-motion-preference"
/>

+ // Add this CSS to your styles:
+ /* 
+   .loader-spin {
+     animation: spin 1s linear infinite;
+   }
+   
+   @media (prefers-reduced-motion: reduce) {
+     .loader-spin {
+       animation: none;
+     }
+   }
+   
+   @keyframes spin {
+     from {
+       transform: rotate(0deg);
+     }
+     to {
+       transform: rotate(360deg);
+     }
+   }
+ */
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fdc16ce and e0e832d.

📒 Files selected for processing (1)
  • internal/ui/src/components/button.tsx (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: Test Packages / Test ./internal/clickhouse
  • GitHub Check: Test Go API Local / test_agent_local
  • GitHub Check: Test API / API Test Local
  • GitHub Check: Test Agent Local / test_agent_local
  • GitHub Check: Build / Build
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (11)
internal/ui/src/components/button.tsx (11)

9-30: Well-structured button variants implementation!

The reorganization of button variants using arrays of classes improves readability and maintainability compared to long string concatenations. This approach makes it easier to understand which styles apply to each variant state.


32-37: Good implementation of color system with semantic variants

Adding color variants (default, success, warning, danger) alongside the existing variant types creates a more flexible and semantically meaningful button system. This separation of concerns between the button's visual style (variant) and its semantic meaning (color) follows best practices for component design.

Also applies to: 46-48


175-178: Great accessibility improvement with loadingLabel

Adding the loadingLabel property enhances screen reader accessibility during loading states. This is an excellent practice that improves the user experience for users with disabilities.


181-200: Well-implemented keyboard shortcut indicator styling

The keyboardIconVariants function provides a consistent and visually appealing way to style keyboard shortcut indicators. The variants appropriately match the button variants and provide good visual differentiation.


213-216: Good separation of concerns for disabled states

Separating visual disabled state from click disabled behavior is an excellent approach. This allows the button to maintain its appropriate visual state while preventing interaction during loading, which improves both usability and accessibility.


218-229: Great UX enhancement with width preservation during loading

Using a ref to maintain consistent button width during loading states prevents layout shifts, which significantly improves the user experience. This is a thoughtful detail that prevents surrounding content from moving when buttons toggle between loading and normal states.


231-247: Improved keyboard handler with disabled state consideration

The keyboard handler now correctly considers the disabled state, which prevents keyboard shortcuts from triggering when the button is disabled or loading. This is an important accessibility and UX improvement.


252-258: Enhanced accessibility with proper ARIA attributes

Using aria-disabled for click-disabled states and aria-busy for loading states improves accessibility for screen reader users. The separation between the HTML disabled attribute and ARIA attributes provides better control over visual and functional states.


261-271: Accessible loading state implementation

The loading state implementation now includes proper aria-hidden attributes and a screen reader-only message, which greatly improves accessibility. The centered loading indicator with animation provides clear visual feedback.


284-294: Improved keyboard shortcut indicator

The keyboard shortcut indicator now uses the keyboardIconVariants function for consistent styling based on the button variant. The use of the <kbd> element is semantically correct for keyboard indicators.


300-311: Excellent accessibility feature for respecting reduced motion preferences

Adding support for reduced motion preferences shows great attention to accessibility concerns. This implementation correctly respects the user's system preferences and will disable animations for users who have indicated a preference for reduced motion.

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

🧹 Nitpick comments (5)
internal/ui/src/components/button.tsx (5)

8-31: Consider extracting repeating styles in variant definitions.
Your approach is clear, but repeated styles in primary, outline, ghost might be refactored into shared classes or utility functions for easier maintenance in the future.


43-56: Backward compatibility note for icon and square.
Keeping these in the size/shape variants for backward compatibility is fine. Just ensure to track their eventual removal so that they don't accumulate technical debt.


57-151: Repeated compound variants for danger, warning, success.
All sets of compound variants share common focus styles, border definitions, etc. Consider consolidating repetitive styles to simplify future updates.


223-284: Animated spinner implementation is functional but could consider alternative approaches.
Using setInterval for rotation is fine; however, a CSS-only spinner or a single rotation animation might simplify the logic and reduce overhead. Nonetheless, the current approach works.


419-444: Inline style injection for reduced motion and spin animation.
This works, but using external or modular CSS might be more maintainable long-term, especially in SSR environments where document might be undefined.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e0e832d and d552d08.

📒 Files selected for processing (5)
  • apps/dashboard/app/(app)/apis/create-api-button.tsx (4 hunks)
  • apps/dashboard/app/(app)/ratelimits/_components/create-namespace-button.tsx (3 hunks)
  • apps/dashboard/app/(app)/settings/team/invite.tsx (5 hunks)
  • apps/dashboard/components/navigation/navbar.tsx (4 hunks)
  • internal/ui/src/components/button.tsx (2 hunks)
✅ Files skipped from review due to trivial changes (3)
  • apps/dashboard/app/(app)/settings/team/invite.tsx
  • apps/dashboard/app/(app)/apis/create-api-button.tsx
  • apps/dashboard/components/navigation/navbar.tsx
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (9)
apps/dashboard/app/(app)/ratelimits/_components/create-namespace-button.tsx (3)

3-8: Multi-line import looks good.
No functional issue spotted with splitting the import statements for readability.


37-37: No functional change in the regex validation.
The reformatted error message remains correct. No concerns here.


67-71: Ensure consistency of color="default" usage.
Using color="default" aligns with your updated Button color variants. This should render the default styling as expected.

internal/ui/src/components/button.tsx (6)

37-42: Potential brand alignment check for danger and other color tokens.
Although the color variant keys are descriptive, confirm that “danger,” “success,” and “warning” align with design/brand standards for consistent naming across the project.


182-185: Good accessibility improvement with loadingLabel.
Including a screen reader-only label for the loading state is a best practice that enhances accessibility.


188-207: Keyboard icon styling meets the new variant system.
The keyboardIconVariants function is well-structured. Ensure color contrast is sufficient for all variants.


286-300: Bounds check for getPathForSegment function.
Consider handling out-of-range index gracefully or ensuring it’s never called with unexpected values to avoid potential runtime errors.


368-379: Distinguishing click-disabled from visual-disabled is a nice touch.
This approach avoids losing focus styling or pointer events while maintaining intended behavior. Great solution for nuanced states.


383-391: Overlaid spinner preserves button dimensions.
Hiding the children under a spinner overlay helps maintain layout stability during loading. Good implementation.

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

🧹 Nitpick comments (1)
internal/ui/src/components/button.tsx (1)

414-438: Good implementation of reduced motion support

Adding CSS for respecting reduced motion preferences is an excellent accessibility enhancement. The approach of injecting styles dynamically ensures the styles are available when the component is used.

However, consider moving this to a more centralized location like a global CSS file to:

  1. Avoid multiple injections if the component is used multiple times
  2. Keep the component logic focused on rendering
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d552d08 and efc6ee9.

📒 Files selected for processing (5)
  • apps/dashboard/app/(app)/apis/_components/create-api-button.tsx (1 hunks)
  • apps/dashboard/app/(app)/ratelimits/_components/create-namespace-button.tsx (1 hunks)
  • apps/dashboard/app/(app)/settings/team/invite.tsx (1 hunks)
  • apps/dashboard/components/navigation/navbar.tsx (1 hunks)
  • internal/ui/src/components/button.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/dashboard/app/(app)/ratelimits/_components/create-namespace-button.tsx
  • apps/dashboard/app/(app)/settings/team/invite.tsx
⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: Test Packages / Test ./packages/nextjs
  • GitHub Check: Test Packages / Test ./packages/cache
  • GitHub Check: Test Packages / Test ./internal/clickhouse
  • GitHub Check: Test Go API Local / test_agent_local
  • GitHub Check: Test API / API Test Local
  • GitHub Check: Test Agent Local / test_agent_local
  • GitHub Check: Build / Build
  • GitHub Check: autofix
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (12)
apps/dashboard/components/navigation/navbar.tsx (1)

74-77: Good update to the Button styling

The changes to use variant="outline" and add bg-gray-4 hover:bg-gray-5 classes align well with the updated Button component design system. This creates better visual separation between the icon button and surrounding content, improving the UI consistency.

apps/dashboard/app/(app)/apis/_components/create-api-button.tsx (1)

67-67:

Details

❓ Verification inconclusive

Good adoption of the new Button color prop

Adding color="default" to the Button properly utilizes the new component API. This ensures compatibility with the updated button design system while maintaining the primary variant style.

You might want to also check other buttons in this component (like the one at line 97-105) to ensure consistent application of the color prop across all buttons in this file.


🏁 Script executed:

#!/bin/bash
# Find all Button components in this file and check if they use the color prop
cat "apps/dashboard/app/(app)/apis/_components/create-api-button.tsx" | grep -A 10 "<Button"

Length of output: 1021


Consistent Button Color Prop Usage

The updated primary button at line 67 correctly includes color="default", aligning with the new design system. However, the secondary submit button (lines 97–105) does not have a color prop applied. Please verify whether this omission is intentional. If consistency is desired across the component, consider adding color="default" (or the appropriate color) to the second button.

  • File: apps/dashboard/app/(app)/apis/_components/create-api-button.tsx
    • Line 67: <Button variant="primary" {...rest} color="default">…
    • Line 97–105: <Button type="submit" variant="primary" …> (missing the color prop)
internal/ui/src/components/button.tsx (10)

7-9: Good improvements to the button base styling

The updated base styles provide a more solid foundation with better transitions and focus states, ensuring consistent behavior across all button variants.


12-31: Good restructuring of button variants

The reorganization of button variants with clear, semantic names (primary, outline, ghost) improves the design system's consistency. The detailed styling for each variant with proper focus, hover, and active states enhances the user experience.


37-42: Well-implemented color system for buttons

Adding the color variants (default, success, warning, danger) allows for more contextual use of buttons across the application, improving user understanding of actions.


44-49: Good button sizing options

The updated size variants with clear naming conventions (sm, md, lg, xlg) and the appropriate heights make it easier to maintain visual consistency across the application.


57-151: Excellent implementation of compound variants

The compound variants system elegantly combines colors and variants, providing a comprehensive set of button styles that maintain consistent design language while offering contextual variations. The detailed styling for different states (hover, focus, disabled, active) ensures a polished user experience.


182-186: Good addition of screen reader support

Adding the loadingLabel prop enhances accessibility by providing context to screen reader users during loading states.


188-207: Well-designed keyboard shortcut indicator

The keyboardIconVariants implementation provides consistent styling for keyboard shortcuts across different button variants, enhancing the UI for power users.


219-294: Excellent implementation of animated loading spinner

The AnimatedLoadingSpinner component provides:

  1. A visually appealing loading indicator with sequential animation
  2. Proper SVG implementation with good performance
  3. Support for reduced motion preferences (line 250)

This is a significant improvement over a simple spinner and provides better visual feedback to users.


307-338: Robust variant and width management during loading

The implementation properly handles:

  1. Mapping old variants to new ones for backward compatibility
  2. Preserving button width during loading state to prevent layout shifts
  3. Separate handling of visual and functional disabled states

This provides a smoother user experience, especially during async operations.


371-373: Consider enhancing accessibility for loading state

While using aria-busy={loading} is a good start, this attribute has inconsistent support across screen readers. Consider adding a live region announcement for loading state changes.

For more reliable screen reader announcements, consider adding a visually hidden live region:

const Button: React.FC<ButtonProps> = ({
  // existing props
}) => {
  // existing code

+  // Live region for loading state announcements
+  React.useEffect(() => {
+    if (loading) {
+      // Create or update live region when loading starts
+      let liveRegion = document.getElementById('button-loading-status');
+      if (!liveRegion) {
+        liveRegion = document.createElement('div');
+        liveRegion.id = 'button-loading-status';
+        liveRegion.setAttribute('aria-live', 'polite');
+        liveRegion.className = 'sr-only';
+        document.body.appendChild(liveRegion);
+      }
+      liveRegion.textContent = loadingLabel;
+      
+      return () => {
+        // Clear announcement when loading ends
+        if (liveRegion) {
+          liveRegion.textContent = '';
+        }
+      };
+    }
+  }, [loading, loadingLabel]);

  // rest of the component
}

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

🧹 Nitpick comments (2)
apps/dashboard/app/(app)/ratelimits/_components/controls/components/logs-datetime/index.tsx (1)

80-82: Consider enhancing keyboard shortcut accessibility

The button has a keyboard shortcut hint in the title attribute, but it might be beneficial to implement the actual keyboard shortcut handler using the useKeyboardShortcut hook as seen in the LiveSwitchButton component.

import { Calendar } from "@unkey/icons";
import { Button } from "@unkey/ui";
+ import { useKeyboardShortcut } from "@/hooks/use-keyboard-shortcut";
import { useEffect, useState } from "react";
import { useFilters } from "../../../hooks/use-filters";

export const LogsDateTime = () => {
  const [title, setTitle] = useState<string | null>(null);
  const { filters, updateFilters } = useFilters();
+  
+  // Add keyboard shortcut for toggling the datetime filter
+  useKeyboardShortcut({ key: "t" }, () => {
+    // Implementation to toggle the datetime popover
+  });

  // Rest of the component
apps/dashboard/app/(app)/logs/components/controls/components/logs-datetime/index.tsx (1)

80-82: Consider enhancing keyboard shortcut accessibility

The button has a keyboard shortcut hint in the title attribute, but it might be beneficial to implement the actual keyboard shortcut handler using the useKeyboardShortcut hook as seen in other components like LiveSwitchButton.

import { DatetimePopover } from "@/components/logs/datetime/datetime-popover";
import { cn } from "@/lib/utils";
import { Calendar } from "@unkey/icons";
import { Button } from "@unkey/ui";
+ import { useKeyboardShortcut } from "@/hooks/use-keyboard-shortcut";
import { useEffect, useState } from "react";
import { useFilters } from "../../../../hooks/use-filters";

export const LogsDateTime = () => {
  const [title, setTitle] = useState<string | null>(null);
  const { filters, updateFilters } = useFilters();
+  
+  // Add keyboard shortcut for toggling the datetime filter
+  useKeyboardShortcut({ key: "t" }, () => {
+    // Implementation to toggle the datetime popover
+  });

  // Rest of the component
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e6669a2 and 53ebfb8.

📒 Files selected for processing (11)
  • apps/dashboard/app/(app)/apis/_components/controls/components/logs-datetime/index.tsx (1 hunks)
  • apps/dashboard/app/(app)/audit/components/controls/components/logs-datetime/index.tsx (1 hunks)
  • apps/dashboard/app/(app)/logs/components/controls/components/logs-datetime/index.tsx (1 hunks)
  • apps/dashboard/app/(app)/logs/components/controls/components/logs-display/index.tsx (1 hunks)
  • apps/dashboard/app/(app)/logs/components/controls/components/logs-filters/index.tsx (1 hunks)
  • apps/dashboard/app/(app)/ratelimits/[namespaceId]/_overview/components/controls/components/logs-datetime/index.tsx (1 hunks)
  • apps/dashboard/app/(app)/ratelimits/[namespaceId]/logs/components/controls/components/logs-datetime/index.tsx (1 hunks)
  • apps/dashboard/app/(app)/ratelimits/_components/controls/components/logs-datetime/index.tsx (1 hunks)
  • apps/dashboard/components/logs/control-cloud/control-pill.tsx (1 hunks)
  • apps/dashboard/components/logs/live-switch-button/index.tsx (1 hunks)
  • apps/dashboard/components/logs/refresh-button/index.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • apps/dashboard/app/(app)/audit/components/controls/components/logs-datetime/index.tsx
  • apps/dashboard/app/(app)/apis/_components/controls/components/logs-datetime/index.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/dashboard/components/logs/refresh-button/index.tsx
⏰ Context from checks skipped due to timeout of 90000ms (18)
  • GitHub Check: Test Packages / Test ./packages/rbac
  • GitHub Check: Test Packages / Test ./packages/nextjs
  • GitHub Check: Test Packages / Test ./packages/hono
  • GitHub Check: Test Packages / Test ./packages/cache
  • GitHub Check: Test Packages / Test ./packages/api
  • GitHub Check: Test Packages / Test ./internal/clickhouse
  • GitHub Check: Test Packages / Test ./internal/resend
  • GitHub Check: Test Packages / Test ./internal/keys
  • GitHub Check: Test Packages / Test ./internal/id
  • GitHub Check: Test Packages / Test ./internal/hash
  • GitHub Check: Test Packages / Test ./internal/encryption
  • GitHub Check: Test Packages / Test ./internal/billing
  • GitHub Check: Test API / API Test Local
  • GitHub Check: Test Agent Local / test_agent_local
  • GitHub Check: Test Go API Local / test_agent_local
  • GitHub Check: Build / Build
  • GitHub Check: autofix
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (8)
apps/dashboard/app/(app)/ratelimits/[namespaceId]/logs/components/controls/components/logs-datetime/index.tsx (1)

70-77: Button styling standardization looks good.

The addition of size="md" and the rounded-lg class to the button styling is consistent with the button component standardization in this PR.

apps/dashboard/components/logs/control-cloud/control-pill.tsx (1)

74-87: Enhanced interactive states improve usability.

The addition of hover:bg-gray-4 and focus:hover:bg-gray-4 classes improve the button's interactive feedback, providing better visual cues for users.

These hover and focus states will make the control pill's close button more intuitive to interact with, especially for keyboard users navigating through the UI.

apps/dashboard/app/(app)/ratelimits/[namespaceId]/_overview/components/controls/components/logs-datetime/index.tsx (1)

70-77: Button styling update is consistent with design system changes.

The addition of size="md" property and rounded-lg class aligns with the button-v2 feature implementation across the application.

apps/dashboard/app/(app)/logs/components/controls/components/logs-display/index.tsx (1)

9-14: Consistent button styling implementation.

The addition of size="md" and the rounded-lg class maintains visual consistency with other button component updates in this PR.

apps/dashboard/components/logs/live-switch-button/index.tsx (1)

18-18: Consistent button styling applied

The button has been updated with size="md" and rounded-lg class to align with the new button standard being applied across the application.

Also applies to: 21-21

apps/dashboard/app/(app)/logs/components/controls/components/logs-filters/index.tsx (1)

38-38: Consistent button styling applied

The button has been updated with size="md" and rounded-lg class, maintaining a consistent appearance with other buttons across the application and properly preserving conditional styling based on filter state.

Also applies to: 40-41

apps/dashboard/app/(app)/ratelimits/_components/controls/components/logs-datetime/index.tsx (1)

72-72: Consistent button styling applied

The button has been updated with size="md" and rounded-lg class while properly preserving the conditional styling based on title state.

Also applies to: 74-77

apps/dashboard/app/(app)/logs/components/controls/components/logs-datetime/index.tsx (1)

72-72: Consistent button styling applied

The button has been updated with size="md" and rounded-lg class while properly preserving the conditional styling based on title state.

Also applies to: 74-77

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

🧹 Nitpick comments (2)
apps/engineering/content/design/components/button.mdx (2)

17-19: Minor grammatical improvement needed

There's a slight grammatical issue in this sentence.

- Button comes in three basic variants that serve different UI purposes:
+ The Button comes in three basic variants that serve different UI purposes:
🧰 Tools
🪛 LanguageTool

[uncategorized] ~18-~18: Possible missing article found.
Context: ...board interactions. ## Basic Variants Button comes in three basic variants that serv...

(AI_HYDRA_LEO_MISSING_THE)


844-875: Comprehensive usage guidelines

The usage guidelines section covers important considerations for button usage, including hierarchy, color semantics, interaction states, sizing, content guidelines, and accessibility.

One minor improvement suggestion for line 875:

- Consider stacking buttons vertically on very small screens
+ Consider stacking buttons vertically on compact or mobile screens
🧰 Tools
🪛 LanguageTool

[style] ~875-~875: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ...Consider stacking buttons vertically on very small screens

(EN_WEAK_ADJECTIVE)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 53ebfb8 and d79b080.

📒 Files selected for processing (6)
  • apps/dashboard/app/(app)/apis/_components/api-list-client.tsx (2 hunks)
  • apps/dashboard/app/(app)/logs/components/table/logs-table.tsx (1 hunks)
  • apps/dashboard/app/(app)/ratelimits/[namespaceId]/_overview/components/table/logs-table.tsx (1 hunks)
  • apps/dashboard/app/(app)/ratelimits/[namespaceId]/logs/components/table/logs-table.tsx (1 hunks)
  • apps/engineering/content/design/components/button.mdx (1 hunks)
  • apps/engineering/content/design/components/button.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • apps/dashboard/app/(app)/ratelimits/[namespaceId]/logs/components/table/logs-table.tsx
  • apps/dashboard/app/(app)/apis/_components/api-list-client.tsx
🧰 Additional context used
🪛 LanguageTool
apps/engineering/content/design/components/button.mdx

[uncategorized] ~18-~18: Possible missing article found.
Context: ...board interactions. ## Basic Variants Button comes in three basic variants that serv...

(AI_HYDRA_LEO_MISSING_THE)


[style] ~875-~875: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ...Consider stacking buttons vertically on very small screens

(EN_WEAK_ADJECTIVE)

⏰ Context from checks skipped due to timeout of 90000ms (17)
  • GitHub Check: Test Packages / Test ./packages/nextjs
  • GitHub Check: Test Packages / Test ./packages/hono
  • GitHub Check: Test Packages / Test ./packages/cache
  • GitHub Check: Test Packages / Test ./packages/api
  • GitHub Check: Test Packages / Test ./internal/clickhouse
  • GitHub Check: Test Packages / Test ./internal/resend
  • GitHub Check: Test Packages / Test ./internal/keys
  • GitHub Check: Test Packages / Test ./internal/id
  • GitHub Check: Test Packages / Test ./internal/hash
  • GitHub Check: Test Packages / Test ./internal/encryption
  • GitHub Check: Test Packages / Test ./internal/billing
  • GitHub Check: Test Go API Local / test_agent_local
  • GitHub Check: Build / Build
  • GitHub Check: Test Agent Local / test_agent_local
  • GitHub Check: Test API / API Test Local
  • GitHub Check: autofix
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (12)
apps/dashboard/app/(app)/ratelimits/[namespaceId]/_overview/components/table/logs-table.tsx (1)

208-208: Button component updated with appropriate size property.

The addition of the size="md" prop to the Button component aligns with the broader changes introduced in this PR's Button v2 feature. This ensures consistent button sizing across the application.

apps/engineering/content/design/components/button.tsx (1)

6-41: Well-implemented keyboard shortcut component with good user feedback!

The ButtonWithKeyboardShortcut component demonstrates a clean implementation of a button with keyboard shortcut capabilities. The code handles loading states correctly and provides clear visual feedback about the shortcut.

Some minor enhancement suggestions:

  1. Consider adding a focus trap or ensuring the keyboard event only triggers when appropriate (e.g., when the component is visible/mounted)
  2. The simulated delay with setTimeout works for demo purposes, but in a production environment, you might want to add error handling for async operations
  const handleClick = async () => {
    setIsLoading(true);
-   await new Promise((resolve) => setTimeout(resolve, 1000));
-   setCount((prev) => prev + 1);
-   setIsLoading(false);
+   try {
+     await new Promise((resolve) => setTimeout(resolve, 1000));
+     setCount((prev) => prev + 1);
+   } catch (error) {
+     console.error("Error during operation:", error);
+   } finally {
+     setIsLoading(false);
+   }
  };
apps/engineering/content/design/components/button.mdx (9)

1-15: Comprehensive button documentation with clear description

The metadata and introduction provide an excellent overview of the button component's capabilities, variants, and design considerations.


21-49: Well-structured primary button documentation with comprehensive state examples

The primary button section provides clear examples of all important states (default, hover, focus, loading, disabled) in both light and dark themes.


51-153: Thorough documentation of outline and ghost variants

The documentation for the outline and ghost variants includes all necessary states and clearly explains their use cases.


155-695: Comprehensive color variant documentation

The color variants (danger, warning, success) documentation is very thorough, covering all combinations of variants and states. The explanations for when to use each variant are clear and helpful.


697-725: Clear size variants demonstration

The size variants section effectively demonstrates the range of available button sizes.


733-775: Well-documented icon support

The documentation clearly demonstrates how to use icons within buttons, showing both leading and trailing icon placements.


777-781: Effective keyboard shortcut demonstration

The keyboard shortcut section uses the custom component to demonstrate the feature, providing both visual cues and functional example.


789-831: Helpful additional features documentation

The legacy variant support and shape variants sections provide important information for backward compatibility and special layout cases.


835-842: Props documentation with auto-generated table

Using the AutoTypeTable component to automatically generate the props documentation from TypeScript types is an excellent practice that ensures the documentation stays up-to-date with the code.

apps/dashboard/app/(app)/logs/components/table/logs-table.tsx (1)

262-262:

Details

✅ Verification successful

Button component updated with size prop

The addition of size="md" to the Button component is part of the new button version implementation. This ensures consistent sizing across the application's UI.

I noticed that in other files, buttons are being updated with both size="md" and className="rounded-lg" according to the AI summary. Let's verify if this button should also have the rounded corners class for consistency:


🏁 Script executed:

#!/bin/bash
# Description: Check for Button components with size="md" and see if they commonly have rounded-lg class
echo "Searching for Button components with size prop..."
rg "Button size=" --type=tsx -A 1 -B 1

echo "Checking if rounded-lg is commonly used with these buttons..."
rg "Button size=\"md\"" --type=tsx -A 5 -B 5 | rg "rounded-lg"

Length of output: 399


Action Needed: Manual Verification of Rounded Corners on Button Components

It looks like our initial automated search couldn’t reliably detect whether other Button instances add className="rounded-lg" alongside size="md"—the TSX file type wasn’t recognized. To investigate further, please run the following revised shell script that limits the search to TSX files:

If the output confirms that other Button components consistently include className="rounded-lg", then the Button in apps/dashboard/app/(app)/logs/components/table/logs-table.tsx might also need that class for consistency. Otherwise, if there’s no clear pattern, you should manually verify whether the current styling meets the design requirements.


🏁 Script executed:

#!/bin/bash
echo "Searching for Button components with size prop in TSX files..."
rg "Button size=" -g "*.tsx" -A 1 -B 1

echo "Searching for Button components with size=\"md\" and rounded-lg class in TSX files..."
rg "Button size=\"md\"" -g "*.tsx" -A 5 -B 5 | grep "rounded-lg"

Length of output: 3568


Button Component Update Verified

The updated Button with size="md" is consistent with our current usage. Our search confirms that across the codebase, Button components using the size="md" prop do not include a className="rounded-lg". Therefore, no additional changes are necessary for consistency at this time.

@chronark chronark added this pull request to the merge queue Mar 4, 2025
Merged via the queue into main with commit f45b387 Mar 4, 2025
31 checks passed
@chronark chronark deleted the button-v2 branch March 4, 2025 18:48
@coderabbitai coderabbitai bot mentioned this pull request Jun 2, 2025
18 tasks
@coderabbitai coderabbitai bot mentioned this pull request Jun 26, 2025
18 tasks
@coderabbitai coderabbitai bot mentioned this pull request Aug 20, 2025
18 tasks
@coderabbitai coderabbitai bot mentioned this pull request Sep 23, 2025
18 tasks
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.

2 participants