Skip to content

chore: moved visual button to ui#3306

Merged
MichaelUnkey merged 20 commits intomainfrom
visual-button-to-ui
Jun 17, 2025
Merged

chore: moved visual button to ui#3306
MichaelUnkey merged 20 commits intomainfrom
visual-button-to-ui

Conversation

@MichaelUnkey
Copy link
Collaborator

@MichaelUnkey MichaelUnkey commented Jun 9, 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?

Placed used still look and function as production.
Created key dialog, Created Root key Dialog. shows hidden key when clicked

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 reusable VisibleButton component for toggling visibility of sensitive information such as API keys.
    • Added a demonstration and documentation for the VisibleButton, including usage examples and accessibility details.
  • Enhancements

    • Replaced custom visibility toggle logic in several dashboard components with the new VisibleButton for a more consistent user experience.
    • Updated UI to use the VisibleButton with improved styling and accessibility.
  • Style

    • Overhauled global CSS and Tailwind configuration to support advanced theming, dark mode, custom animations, and enhanced code block presentation.
  • Chores

    • Added and updated Tailwind CSS and related plugin dependencies to support new styling features.

@changeset-bot
Copy link

changeset-bot bot commented Jun 9, 2025

⚠️ No Changeset found

Latest commit: 19c4e7e

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 Jun 9, 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 Jun 17, 2025 2:24pm
engineering ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 17, 2025 2:24pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 9, 2025

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

A new VisibleButton React component was introduced in the shared UI package and integrated across multiple dashboard and engineering app files, replacing custom visibility toggle logic. Accompanying documentation, usage examples, and global style/theme updates were added, along with enhancements to Tailwind CSS configuration and dependencies.

Changes

Files/Groups Change Summary
internal/ui/src/components/visible-button.tsx, internal/ui/src/index.ts Added new exported VisibleButton component to the UI package and exported it via the index file.
apps/dashboard/app/(app)/settings/root-keys/new/client.tsx,
apps/dashboard/app/new/keys.tsx
Replaced local VisibleButton imports with imports from @unkey/ui, and added variant="ghost" and className="focus:ring-0" props to all instances.
apps/dashboard/app/(app)/apis/[apiId]/_components/create-key/components/key-created-success-dialog.tsx,
apps/dashboard/app/(app)/apis/[apiId]/_components/create-key/components/secret-key.tsx
Swapped out custom visibility toggle button logic for the new VisibleButton component from @unkey/ui, simplifying visibility state handling.
apps/engineering/content/design/components/buttons/visual-button.examples.tsx Added a new VisibleButtonDemo React component demonstrating usage of VisibleButton with shared visibility state.
apps/engineering/content/design/components/buttons/visual-button.mdx Added documentation for the VisibleButton component, including usage, props, accessibility, and design details.
apps/engineering/app/global.css Overhauled global CSS: replaced Tailwind layers with custom theming using CSS variables, added code block styling, animations, and scrollbar utilities, supporting both light and dark modes.
apps/engineering/app/layout.tsx Added global styles import from @unkey/ui/css and adjusted import order.
apps/engineering/tailwind.config.js Switched to CommonJS export, added a recursive merge function, merged custom theme overrides (colors, fonts, animations), and expanded plugins and dark mode support.
apps/engineering/package.json Added Tailwind CSS and related plugin dependencies.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ParentComponent
    participant VisibleButton

    User->>VisibleButton: Clicks button
    VisibleButton->>ParentComponent: Calls setIsVisible(!isVisible)
    ParentComponent->>VisibleButton: Passes updated isVisible prop
    VisibleButton-->>User: Updates icon and aria-label/title
Loading

Suggested labels

🕹️ oss.gg, :joystick: 50 points, hacktoberfest

Suggested reviewers

  • perkinsjr
  • chronark
  • mcstepp
  • ogzhanolguncu

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
🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need 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)

  • @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 generate sequence diagram to generate a sequence diagram of the changes in 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 Jun 9, 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: 2

🧹 Nitpick comments (1)
apps/engineering/content/design/components/visual-button.mdx (1)

60-60: Fix grammatical issue

Missing article "the" as flagged by static analysis.

-4. The timer resets if the content is hidden manually before timeout
+4. The timer resets if the content is hidden manually before the timeout
🧰 Tools
🪛 LanguageTool

[uncategorized] ~60-~60: You might be missing the article “the” here.
Context: ...f the content is hidden manually before timeout ## Accessibility - Includes sr-only...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 56d51eb and a5290fc.

📒 Files selected for processing (6)
  • apps/dashboard/app/(app)/settings/root-keys/new/client.tsx (1 hunks)
  • apps/dashboard/app/new/keys.tsx (1 hunks)
  • apps/engineering/content/design/components/buttons/visual-button.examples.tsx (1 hunks)
  • apps/engineering/content/design/components/visual-button.mdx (1 hunks)
  • internal/ui/src/components/visible-button.tsx (1 hunks)
  • internal/ui/src/index.ts (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
apps/engineering/content/design/components/buttons/visual-button.examples.tsx (2)
apps/engineering/app/components/render.tsx (1)
  • RenderComponentWithSnippet (12-67)
internal/ui/src/components/visible-button.tsx (1)
  • VisibleButton (13-45)
🪛 LanguageTool
apps/engineering/content/design/components/visual-button.mdx

[uncategorized] ~60-~60: You might be missing the article “the” here.
Context: ...f the content is hidden manually before timeout ## Accessibility - Includes sr-only...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

⏰ Context from checks skipped due to timeout of 90000ms (19)
  • GitHub Check: Test Go API Local / Test (Shard 5/8)
  • GitHub Check: Build / Build
  • GitHub Check: Test Go API Local / Test (Shard 7/8)
  • GitHub Check: Test Go API Local / Test (Shard 2/8)
  • GitHub Check: Test Go API Local / Test (Shard 4/8)
  • GitHub Check: Test Go API Local / Test (Shard 3/8)
  • GitHub Check: Test Go API Local / Test (Shard 1/8)
  • GitHub Check: Test Go API Local / Test (Shard 6/8)
  • GitHub Check: Test Go API Local / Test (Shard 8/8)
  • GitHub Check: Test API / API Test Local
  • GitHub Check: Test Packages / Test ./packages/hono
  • GitHub Check: Test Packages / Test ./internal/id
  • GitHub Check: Test Packages / Test ./packages/nextjs
  • GitHub Check: Test Packages / Test ./internal/resend
  • GitHub Check: Test Packages / Test ./internal/clickhouse
  • GitHub Check: Test Packages / Test ./packages/cache
  • GitHub Check: autofix
  • GitHub Check: Analyze (actions)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (9)
internal/ui/src/index.ts (1)

19-19: Export addition looks good.

The new export for visible-button follows the established pattern and correctly exposes the component from the UI package.

internal/ui/src/components/visible-button.tsx (3)

1-1: Client directive correctly added.

The "use client" directive is necessary since this component uses React hooks (useEffect) and event handlers.


4-6: Import adjustments are appropriate for the package migration.

The React import with biome ignore comment provides good explanation, and the relative path for utilities is correct for the new location in the UI package.


13-45: Component implementation is well-structured.

The component properly handles:

  • Auto-hide functionality with cleanup
  • Accessibility via sr-only text
  • Proper prop spreading and type safety
  • Correct dependency array in useEffect
apps/dashboard/app/new/keys.tsx (1)

16-16:

Details

✅ Verification successful

Import migration completed correctly.

The import change from the local dashboard component to the UI package aligns with the refactoring objective and should work correctly given the proper export in the UI package.

Verify that the component is properly accessible from the UI package:


🏁 Script executed:

#!/bin/bash
# Description: Verify VisibleButton is exported from @unkey/ui package

# Check if the component is properly exported
ast-grep --pattern 'export * from "./components/visible-button"'

# Verify the component file exists
fd "visible-button.tsx" internal/ui/src/components/

Length of output: 237


Import migration verified: VisibleButton is exported from @unkey/ui

Confirmed that VisibleButton is re-exported in internal/ui/src/index.ts (line 19) and the source component exists at internal/ui/src/components/visible-button.tsx.
No further action required—approve the change.

apps/dashboard/app/(app)/settings/root-keys/new/client.tsx (1)

19-19: Consistent import migration pattern.

The import change follows the same pattern as other dashboard files and correctly centralizes the component usage to the UI package.

apps/engineering/content/design/components/buttons/visual-button.examples.tsx (2)

1-1: LGTM: Correct client directive usage

The "use client" directive is properly placed for this interactive component that uses React state.


7-28: Well-structured demo component with practical examples

The demo effectively showcases two common use cases:

  1. Simple visibility toggle with user feedback
  2. Sensitive content masking (API keys)

The shared state approach ensures both examples stay synchronized, which enhances the demonstration.

apps/engineering/content/design/components/visual-button.mdx (1)

1-75: Comprehensive and well-structured documentation

The documentation effectively covers all aspects of the VisibleButton component:

  • Clear feature list and behavioral specifications
  • Accurate props table matching the component interface
  • Practical usage examples
  • Accessibility and design considerations

The 10-second auto-hide timer and other behavioral details are correctly documented based on the component implementation.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~60-~60: You might be missing the article “the” here.
Context: ...f the content is hidden manually before timeout ## Accessibility - Includes sr-only...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

MichaelUnkey and others added 2 commits June 9, 2025 12:35
…on.examples.tsx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@vercel vercel bot temporarily deployed to Preview – engineering June 9, 2025 16:39 Inactive
@vercel vercel bot temporarily deployed to Preview – engineering June 9, 2025 22:59 Inactive
@vercel vercel bot temporarily deployed to Preview – dashboard June 9, 2025 23:01 Inactive
@vercel vercel bot temporarily deployed to Preview – engineering June 9, 2025 23:09 Inactive
Copy link
Contributor

@ogzhanolguncu ogzhanolguncu left a comment

Choose a reason for hiding this comment

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

image I think visual button should use the same styling as this one. TLDR; it should use our component. Let's just copy it from there, wdyt?

@vercel vercel bot temporarily deployed to Preview – engineering June 11, 2025 17:55 Inactive
@vercel vercel bot temporarily deployed to Preview – dashboard June 11, 2025 17:55 Inactive
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: 2

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

3-4: Track the TODO for icon migration.

This TODO indicates technical debt that should be tracked. Consider creating an issue to convert these icons to Nucleo Icons and move them to the unkey/icons package.

Would you like me to create an issue to track this icon migration task?


5-6: Remove misleading biome comment.

The comment is inaccurate as React is actively used for useEffect, not just for types. Consider removing this comment or updating it to accurately reflect why the biome rule is being ignored.

-// biome-ignore lint: React in this context is used throughout, so biome will change to types because no APIs are used even though React is needed.
 import React, { useEffect } from "react";
apps/engineering/tailwind.config.js (2)

16-19: Address technical debt for theme consolidation.

The comment indicates that colors and font sizes should be moved to @unkey/ui. Since this PR is already refactoring UI components into the shared package, consider addressing this technical debt now to avoid duplication.

Would you like me to help refactor these theme values into the @unkey/ui package or create an issue to track this work?


161-162: Use Object.hasOwn instead of hasOwnProperty.

Replace hasOwnProperty with the safer Object.hasOwn method to avoid the biome warning.

-    // biome-ignore lint/suspicious/noPrototypeBuiltins: don't tell me what to do
-    if (obj2.hasOwnProperty(key)) {
+    if (Object.hasOwn(obj2, key)) {
apps/engineering/app/global.css (1)

15-16: Fix inconsistent CSS color value formatting.

Some HSL color values are missing spaces after commas. For consistency with other color definitions in the file, add spaces after commas.

-    --warn: 46, 97%, 65%;
-    --warn-foreground: 46, 97%, 15%;
+    --warn: 46 97% 65%;
+    --warn-foreground: 46 97% 15%;
-    --content-warn: 46, 97%, 40%;
+    --content-warn: 46 97% 40%;
-    --warn: 46, 100%, 45%;
-    --warn-foreground: 46, 97%, 5%;
+    --warn: 46 100% 45%;
+    --warn-foreground: 46 97% 5%;
-    --content-warn: 46, 100%, 55%;
+    --content-warn: 46 100% 55%;

Also applies to: 32-33, 51-52, 67-68

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between fb84b7b and 94a4ffc.

📒 Files selected for processing (10)
  • apps/dashboard/app/new/keys.tsx (1 hunks)
  • apps/engineering/app/global.css (1 hunks)
  • apps/engineering/app/layout.tsx (1 hunks)
  • apps/engineering/content/design/components/buttons/visual-button.examples.tsx (1 hunks)
  • apps/engineering/tailwind.config.js (2 hunks)
  • internal/icons/src/icons/hide.tsx (1 hunks)
  • internal/icons/src/icons/view.tsx (1 hunks)
  • internal/icons/src/index.ts (2 hunks)
  • internal/ui/src/components/visible-button.tsx (1 hunks)
  • internal/ui/src/index.ts (1 hunks)
✅ Files skipped from review due to trivial changes (4)
  • apps/engineering/app/layout.tsx
  • internal/icons/src/index.ts
  • internal/icons/src/icons/hide.tsx
  • internal/icons/src/icons/view.tsx
🚧 Files skipped from review as they are similar to previous changes (3)
  • internal/ui/src/index.ts
  • apps/dashboard/app/new/keys.tsx
  • apps/engineering/content/design/components/buttons/visual-button.examples.tsx
🧰 Additional context used
🧬 Code Graph Analysis (1)
internal/ui/src/components/visible-button.tsx (3)
internal/ui/src/components/button.tsx (2)
  • ButtonProps (190-221)
  • Button (396-396)
internal/icons/src/icons/view.tsx (1)
  • View (16-47)
internal/icons/src/icons/hide.tsx (1)
  • Hide (16-62)
⏰ Context from checks skipped due to timeout of 90000ms (14)
  • GitHub Check: Test Go API Local / Test (Shard 1/8)
  • GitHub Check: Test Go API Local / Test (Shard 6/8)
  • GitHub Check: Test Go API Local / Test (Shard 5/8)
  • GitHub Check: Test Go API Local / Test (Shard 3/8)
  • GitHub Check: Test Go API Local / Test (Shard 7/8)
  • GitHub Check: Test Go API Local / Test (Shard 8/8)
  • GitHub Check: Test Go API Local / Test (Shard 2/8)
  • GitHub Check: Test Go API Local / Test (Shard 4/8)
  • GitHub Check: Test API / API Test Local
  • GitHub Check: Build / Build
  • GitHub Check: Test Packages / Test ./internal/clickhouse
  • GitHub Check: Test Packages / Test ./internal/encryption
  • GitHub Check: autofix
  • GitHub Check: Analyze (javascript-typescript)

Copy link
Collaborator Author

🔍 Review requested from @ogzhanolguncu

@vercel vercel bot temporarily deployed to Preview – dashboard June 13, 2025 17:35 Inactive
@vercel vercel bot temporarily deployed to Preview – engineering June 17, 2025 13:01 Inactive
@vercel vercel bot temporarily deployed to Preview – dashboard June 17, 2025 13:02 Inactive
@vercel vercel bot temporarily deployed to Preview – engineering June 17, 2025 13:35 Inactive
@vercel vercel bot temporarily deployed to Preview – dashboard June 17, 2025 13:35 Inactive
@MichaelUnkey MichaelUnkey marked this pull request as ready for review June 17, 2025 13:38
@MichaelUnkey MichaelUnkey enabled auto-merge June 17, 2025 13:38
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: 9

♻️ Duplicate comments (3)
internal/ui/src/components/visible-button.tsx (1)

8-21: Make title required & drop redundant variant override

title drives the aria-label/title attributes – when omitted the button renders “Hide undefined / Show undefined”, breaking a11y.
variant already exists inside ButtonProps; repeating it forces needless prop-picking and risks API drift.

-type VisibleButtonProps = ButtonProps & {
-  /**
-   * Current visibility state
-   */
-  isVisible: boolean;
-  /**
-   * Function to set the visibility state
-   */
-  setIsVisible: (visible: boolean) => void;
-  /**
-   * Variant of the button
-   */
-  variant?: ButtonProps["variant"];
-};
+type VisibleButtonProps = Omit<ButtonProps, "title" | "variant"> & {
+  /** Current visibility state */
+  isVisible: boolean;
+  /** State setter provided by parent */
+  setIsVisible: (visible: boolean) => void;
+  /** Descriptive label used for accessibility (“Password”, “API key”, …) */
+  title: string;
+  /** Optional visual variant – falls back to `"outline"` */
+  variant?: ButtonProps["variant"];
+};
apps/dashboard/app/new/keys.tsx (1)

152-157: Still missing the mandatory title prop on VisibleButton

Previous review highlighted the a11y issue; instances here still render “Hide undefined / Show undefined”.

-<VisibleButton
-  isVisible={showKey}
-  setIsVisible={setShowKey}
+<VisibleButton
+  isVisible={showKey}
+  setIsVisible={setShowKey}
+  title="Root key"

Apply analogous titles for the snippet ("Root key snippet") and API key sections ("API key").

Also applies to: 175-180, 215-220, 237-241

apps/dashboard/app/(app)/settings/root-keys/new/client.tsx (1)

296-301: Add descriptive title prop for accessibility

Same omission as above – provide a clear noun so screen-reader users know what will be shown / hidden.

-<VisibleButton
-  isVisible={showKey}
-  setIsVisible={setShowKey}
+<VisibleButton
+  isVisible={showKey}
+  setIsVisible={setShowKey}
+  title="Root key"

Repeat for the snippet button (title="Snippet").

Also applies to: 313-317

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between ffdb927 and 9916466.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • apps/dashboard/app/(app)/settings/root-keys/new/client.tsx (3 hunks)
  • apps/dashboard/app/new/keys.tsx (5 hunks)
  • apps/engineering/content/design/components/buttons/visual-button.examples.tsx (1 hunks)
  • apps/engineering/content/design/components/buttons/visual-button.mdx (1 hunks)
  • apps/engineering/package.json (2 hunks)
  • internal/ui/src/components/visible-button.tsx (1 hunks)
  • internal/ui/src/index.ts (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (3)
apps/dashboard/app/new/keys.tsx (1)
internal/ui/src/components/visible-button.tsx (1)
  • VisibleButton (23-48)
apps/dashboard/app/(app)/settings/root-keys/new/client.tsx (1)
internal/ui/src/components/visible-button.tsx (1)
  • VisibleButton (23-48)
apps/engineering/content/design/components/buttons/visual-button.examples.tsx (2)
apps/engineering/app/components/render.tsx (1)
  • RenderComponentWithSnippet (12-67)
internal/ui/src/components/visible-button.tsx (1)
  • VisibleButton (23-48)
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: Test Go API Local / Test (Shard 4/8)
  • GitHub Check: Test Go API Local / Test (Shard 5/8)
  • GitHub Check: Test Go API Local / Test (Shard 1/8)
  • GitHub Check: Test Go API Local / Test (Shard 3/8)
  • GitHub Check: Test Go API Local / Test (Shard 2/8)
  • GitHub Check: Test API / API Test Local
🔇 Additional comments (4)
internal/ui/src/index.ts (1)

22-22: Export looks good

VisibleButton is now part of the public surface – perfect.

apps/engineering/content/design/components/buttons/visual-button.examples.tsx (1)

18-24: Example is clear and passes required props – nice

The demo supplies title, variant overrides, and custom classes correctly. Good showcase.

Also applies to: 32-37

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

5-6: Import statement looks good
The VisibleButtonDemo import path and MDX import syntax are correct.


18-36: Usage example is clear
The TSX snippet correctly demonstrates the component API and default behavior.

@vercel vercel bot temporarily deployed to Preview – dashboard June 17, 2025 14:02 Inactive
@vercel vercel bot temporarily deployed to Preview – engineering June 17, 2025 14:02 Inactive
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

♻️ Duplicate comments (4)
apps/engineering/package.json (2)

32-34: Tailwind plugins correctly moved to devDependencies
The build-time plugins (@tailwindcss/aspect-ratio, @tailwindcss/container-queries, @tailwindcss/typography) are now properly grouped under devDependencies as recommended.


27-28: Consolidate Tailwind CSS declaration to avoid version conflicts
Tailwind itself is a build‐time tool and should not be in dependencies, especially since it's already declared (v3.4.10) under devDependencies. Remove the "tailwindcss": "^3.4.3" entry from dependencies to eliminate duplication and prevent production bundle bloat.

--- a/apps/engineering/package.json
+++ b/apps/engineering/package.json
@@ dependencies
-    "tailwind-merge": "^2.5.4",
-    "tailwindcss": "^3.4.3",
+    "tailwind-merge": "^2.5.4",
     "zod": "^3.23.8"
internal/ui/src/components/visible-button.tsx (2)

8-21: title must be required – avoid “Hide undefined” & drop redundant variant prop

title is interpolated into both aria-label and title attributes but is currently optional because it comes from ButtonProps. When the caller omits it, assistive tech and tooltips receive “Hide undefined”, which is an a11y regression.
Additionally, variant is already part of ButtonProps; re-declaring it here bloats the surface API without adding value.

-type VisibleButtonProps = ButtonProps & {
+type VisibleButtonProps = Omit<ButtonProps, "title" | "variant"> & {
   /**
    * Current visibility state
    */
   isVisible: boolean;
   /**
    * Function to set the visibility state
    */
   setIsVisible: (visible: boolean) => void;
-  /**
-   * Variant of the button
-   */
-  variant?: ButtonProps["variant"];
+  /**
+   * Mandatory label used for aria / tooltip text
+   */
+  title: string;
 };

28-44: Compose caller’s onClick and respect event.defaultPrevented

onClick is destructured but never invoked, so consumers lose their handler.
Call it first, then toggle only if the event wasn’t cancelled:

-      onClick={(e) => {
-        if (!e.defaultPrevented) {
-          setIsVisible(!isVisible);
-        }
-      }}
+      onClick={(e) => {
+        onClick?.(e);
+        if (!e.defaultPrevented) {
+          setIsVisible(!isVisible);
+        }
+      }}

This preserves extensibility (e.g., analytics, validation) and keeps the toggle cancellable.
Don’t forget to include onClick in the destructuring list ({ onClick, ...rest }) as you already do.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9916466 and 36bf563.

📒 Files selected for processing (3)
  • apps/engineering/content/design/components/buttons/visual-button.mdx (1 hunks)
  • apps/engineering/package.json (1 hunks)
  • internal/ui/src/components/visible-button.tsx (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
internal/ui/src/components/visible-button.tsx (3)
internal/ui/src/components/button.tsx (2)
  • ButtonProps (233-264)
  • Button (439-439)
internal/icons/src/icons/eye-slash.tsx (1)
  • EyeSlash (15-64)
internal/icons/src/icons/eye.tsx (1)
  • Eye (15-47)
⏰ Context from checks skipped due to timeout of 90000ms (12)
  • GitHub Check: Test Go API Local / Test (Shard 6/8)
  • GitHub Check: Test Go API Local / Test (Shard 8/8)
  • GitHub Check: Test Go API Local / Test (Shard 7/8)
  • GitHub Check: Test Go API Local / Test (Shard 3/8)
  • GitHub Check: Test Go API Local / Test (Shard 1/8)
  • GitHub Check: Test Go API Local / Test (Shard 4/8)
  • GitHub Check: Test Go API Local / Test (Shard 5/8)
  • GitHub Check: Test Go API Local / Test (Shard 2/8)
  • GitHub Check: Build / Build
  • GitHub Check: Test API / API Test Local
  • GitHub Check: autofix
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
apps/engineering/package.json (1)

41-41: Animation plugin placement is correct
Listing tailwindcss-animate under devDependencies is appropriate since it’s only needed during the build process.

@vercel vercel bot temporarily deployed to Preview – dashboard June 17, 2025 14:11 Inactive
@vercel vercel bot temporarily deployed to Preview – engineering June 17, 2025 14:11 Inactive
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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 36bf563 and c5c2937.

📒 Files selected for processing (1)
  • apps/engineering/content/design/components/buttons/visual-button.mdx (1 hunks)
🧰 Additional context used
🪛 LanguageTool
apps/engineering/content/design/components/buttons/visual-button.mdx

[uncategorized] ~12-~12: You might be missing the article “the” here.
Context: ...support. - Customizable styling through className prop. - Configurable button `...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

⏰ Context from checks skipped due to timeout of 90000ms (20)
  • GitHub Check: Test Go API Local / Test (Shard 1/8)
  • GitHub Check: Test Go API Local / Test (Shard 7/8)
  • GitHub Check: Test Go API Local / Test (Shard 8/8)
  • GitHub Check: Test Go API Local / Test (Shard 4/8)
  • GitHub Check: Test Go API Local / Test (Shard 6/8)
  • GitHub Check: Test Go API Local / Test (Shard 5/8)
  • GitHub Check: Test Go API Local / Test (Shard 3/8)
  • GitHub Check: Test Go API Local / Test (Shard 2/8)
  • GitHub Check: Build / Build
  • GitHub Check: Test API / API Test Local
  • GitHub Check: Test Packages / Test ./internal/resend
  • GitHub Check: Test Packages / Test ./packages/nextjs
  • GitHub Check: Test Packages / Test ./internal/keys
  • GitHub Check: Test Packages / Test ./packages/hono
  • GitHub Check: Test Packages / Test ./internal/clickhouse
  • GitHub Check: Test Packages / Test ./packages/rbac
  • GitHub Check: Test Packages / Test ./internal/encryption
  • GitHub Check: Test Packages / Test ./packages/api
  • GitHub Check: autofix
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (9)
apps/engineering/content/design/components/buttons/visual-button.mdx (9)

1-4: Frontmatter is correctly using description.
Aligns with standard documentation conventions by using description instead of summary.


5-6: The imported VisibleButtonDemo is utilized in the Examples section; no action needed.


7-14: Features list is clear and properly formatted.
Prop names are wrapped in backticks and each bullet ends with a period.


15-36: Usage example is clear and comprehensive.
The TSX code block correctly demonstrates state management, accessibility labels, and variant usage.


38-41: Example demo integration is present.
Including <VisibleButtonDemo /> provides a concrete preview of the component.


52-53: Forwarded props note is helpful.
Linking to the Button component docs guides readers to explore additional props.


54-58: Behavior section is well-defined.
Numbered items are concise, descriptive, and punctuated correctly.


59-65: Accessibility guidelines are thorough.
Bullet points cover ARIA details and maintain punctuation consistency.


66-74: Design section clearly outlines visual characteristics.
Bullets succinctly cover styling, iconography, and responsive considerations.

@vercel vercel bot temporarily deployed to Preview – engineering June 17, 2025 14:24 Inactive
@vercel vercel bot temporarily deployed to Preview – dashboard June 17, 2025 14:24 Inactive
@MichaelUnkey MichaelUnkey added this pull request to the merge queue Jun 17, 2025
Merged via the queue into main with commit 4993146 Jun 17, 2025
30 of 37 checks passed
@MichaelUnkey MichaelUnkey deleted the visual-button-to-ui branch June 17, 2025 15:43
@coderabbitai coderabbitai bot mentioned this pull request Jun 24, 2025
18 tasks
@coderabbitai coderabbitai bot mentioned this pull request Aug 18, 2025
18 tasks
@coderabbitai coderabbitai bot mentioned this pull request Sep 29, 2025
18 tasks
@coderabbitai coderabbitai bot mentioned this pull request Nov 4, 2025
19 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