Skip to content

Conversation

@BIT-zhaoyang
Copy link
Contributor

@BIT-zhaoyang BIT-zhaoyang commented May 26, 2025

added navigation menu component
Light Mode
image

Dark Mode
image

Summary by CodeRabbit

  • New Features

    • Introduced an 8-bit styled Navigation Menu component with retro font options and customizable variants.
    • Added a demo page showcasing the 8-bit Navigation Menu, including installation and usage instructions.
    • Included a live interactive demo for users to explore the component.
    • Added the Navigation Menu to the documentation and navigation structure.
  • Chores

    • Added Radix UI Navigation Menu package as a dependency.
    • Updated the registry and metadata to include the new 8-bit Navigation Menu component.

@BIT-zhaoyang BIT-zhaoyang requested a review from TheOrcDev as a code owner May 26, 2025 14:30
@vercel
Copy link

vercel bot commented May 26, 2025

@BIT-zhaoyang is attempting to deploy a commit to the OrcDev Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link

coderabbitai bot commented May 26, 2025

Walkthrough

This update introduces an 8-bit styled navigation menu component and its documentation. It adds new UI components, a demo, registry entries, documentation, and configuration for navigation and package dependencies. The changes include both the base and retro-styled navigation menu implementations, as well as supporting assets and metadata.

Changes

File(s) Change Summary
app/docs/components/navigation-menu/page.tsx Adds documentation page for the 8-bit Navigation Menu, including usage, installation, and demo sections.
components/ui/8bit/navigation-menu.tsx,
public/r/8bit-navigation-menu.json
Adds 8-bit styled navigation menu React components and their registry definition, supporting retro and normal fonts.
components/ui/navigation-menu.tsx Adds base navigation menu React components using Radix UI primitives and styling utilities.
components/examples/navigation-menu.tsx Adds a demo component showcasing the 8-bit navigation menu with sample items and links.
config/nav-items.ts Inserts "Navigation Menu" into the documentation navigation items list.
package.json Adds "@radix-ui/react-navigation-menu" as a new dependency.
lib/metadata.ts Adds exported constant for navigation menu metadata image path.
registry.json Registers the "8bit-navigation-menu" component in the global registry.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DocsPage
    participant NavigationMenuDemo
    participant 8bitNavigationMenu
    User->>DocsPage: Visits navigation menu docs page
    DocsPage->>NavigationMenuDemo: Renders demo section
    NavigationMenuDemo->>8bitNavigationMenu: Renders 8-bit menu with items
    User->>8bitNavigationMenu: Interacts (open, select, navigate)
    8bitNavigationMenu-->>User: Updates UI, navigates as needed
Loading

Suggested reviewers

  • TheOrcDev

Poem

A menu with pixels, so bold and so bright,
Now guides our users, both day and night.
With Radix and retro, the style is new—
Navigation in 8-bit, for me and for you!
🐰✨
Hopping through docs, with menus so neat,
This rabbit declares: the update’s complete!

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

app/docs/components/navigation-menu/page.tsx

Oops! Something went wrong! :(

ESLint: 9.27.0

ESLint couldn't find the plugin "eslint-plugin-react-hooks".

(The package "eslint-plugin-react-hooks" was not found when loaded as a Node module from the directory "".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

npm install eslint-plugin-react-hooks@latest --save-dev

The plugin "eslint-plugin-react-hooks" was referenced from the config file in " » eslint-config-next/core-web-vitals » /node_modules/.pnpm/eslint-config-next@15.3.2_eslint@9.27.0_jiti@2.4.2__typescript@5.8.3/node_modules/eslint-config-next/index.js".

If you still can't figure out the problem, please see https://eslint.org/docs/latest/use/troubleshooting.

components/examples/navigation-menu.tsx

Oops! Something went wrong! :(

ESLint: 9.27.0

ESLint couldn't find the plugin "eslint-plugin-react-hooks".

(The package "eslint-plugin-react-hooks" was not found when loaded as a Node module from the directory "".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

npm install eslint-plugin-react-hooks@latest --save-dev

The plugin "eslint-plugin-react-hooks" was referenced from the config file in " » eslint-config-next/core-web-vitals » /node_modules/.pnpm/eslint-config-next@15.3.2_eslint@9.27.0_jiti@2.4.2__typescript@5.8.3/node_modules/eslint-config-next/index.js".

If you still can't figure out the problem, please see https://eslint.org/docs/latest/use/troubleshooting.

components/ui/8bit/navigation-menu.tsx

Oops! Something went wrong! :(

ESLint: 9.27.0

ESLint couldn't find the plugin "eslint-plugin-react-hooks".

(The package "eslint-plugin-react-hooks" was not found when loaded as a Node module from the directory "".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

npm install eslint-plugin-react-hooks@latest --save-dev

The plugin "eslint-plugin-react-hooks" was referenced from the config file in " » eslint-config-next/core-web-vitals » /node_modules/.pnpm/eslint-config-next@15.3.2_eslint@9.27.0_jiti@2.4.2__typescript@5.8.3/node_modules/eslint-config-next/index.js".

If you still can't figure out the problem, please see https://eslint.org/docs/latest/use/troubleshooting.

  • 1 others

📜 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 9e45262 and 86667f3.

⛔ Files ignored due to path filters (1)
  • public/assets/8bitcn-navigation-menu-light.png is excluded by !**/*.png
📒 Files selected for processing (5)
  • app/docs/components/navigation-menu/page.tsx (1 hunks)
  • components/examples/navigation-menu.tsx (1 hunks)
  • components/ui/8bit/navigation-menu.tsx (1 hunks)
  • lib/metadata.ts (1 hunks)
  • public/r/8bit-navigation-menu.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • lib/metadata.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/docs/components/navigation-menu/page.tsx
🧰 Additional context used
🧠 Learnings (2)
components/ui/8bit/navigation-menu.tsx (3)
Learnt from: BIT-zhaoyang
PR: TheOrcDev/8bitcn-ui#203
File: components/ui/8bit/navigation-menu.tsx:44-68
Timestamp: 2025-05-26T15:27:10.732Z
Learning: In components/ui/8bit/navigation-menu.tsx, the NavigationMenu component uses Radix Root directly instead of the ShadcnNavigationMenu wrapper because it needs to replace the contained NavigationMenuViewport with a custom implementation that includes shadow-border styling.
Learnt from: BIT-zhaoyang
PR: TheOrcDev/8bitcn-ui#203
File: components/ui/8bit/navigation-menu.tsx:170-189
Timestamp: 2025-05-26T15:29:11.949Z
Learning: In components/ui/8bit/navigation-menu.tsx, the NavigationMenuIndicator component uses Radix Indicator directly instead of the ShadcnNavigationMenuIndicator wrapper because it needs to apply custom styling (`dark:bg-ring`) to the inner div element, which the shadcn wrapper doesn't provide an interface for.
Learnt from: BIT-zhaoyang
PR: TheOrcDev/8bitcn-ui#175
File: components/ui/navigation-menu.tsx:124-138
Timestamp: 2025-05-23T12:15:58.081Z
Learning: Components from shadcn UI, such as those in components/ui/navigation-menu.tsx, should be kept as close to the original implementation as possible without modifications.
public/r/8bit-navigation-menu.json (2)
Learnt from: BIT-zhaoyang
PR: TheOrcDev/8bitcn-ui#203
File: components/ui/8bit/navigation-menu.tsx:44-68
Timestamp: 2025-05-26T15:27:10.732Z
Learning: In components/ui/8bit/navigation-menu.tsx, the NavigationMenu component uses Radix Root directly instead of the ShadcnNavigationMenu wrapper because it needs to replace the contained NavigationMenuViewport with a custom implementation that includes shadow-border styling.
Learnt from: BIT-zhaoyang
PR: TheOrcDev/8bitcn-ui#203
File: components/ui/8bit/navigation-menu.tsx:170-189
Timestamp: 2025-05-26T15:29:11.949Z
Learning: In components/ui/8bit/navigation-menu.tsx, the NavigationMenuIndicator component uses Radix Indicator directly instead of the ShadcnNavigationMenuIndicator wrapper because it needs to apply custom styling (`dark:bg-ring`) to the inner div element, which the shadcn wrapper doesn't provide an interface for.
🧬 Code Graph Analysis (2)
components/examples/navigation-menu.tsx (1)
components/ui/8bit/navigation-menu.tsx (8)
  • NavigationMenu (185-185)
  • NavigationMenuList (190-190)
  • NavigationMenuItem (188-188)
  • NavigationMenuTrigger (191-191)
  • NavigationMenuContent (186-186)
  • NavigationMenuLink (189-189)
  • navigationMenuTriggerStyle (16-16)
  • NavigationMenuIndicator (187-187)
components/ui/8bit/navigation-menu.tsx (3)
config/fonts.ts (1)
  • pressStart (3-6)
components/ui/navigation-menu.tsx (8)
  • NavigationMenu (159-159)
  • NavigationMenuViewport (166-166)
  • NavigationMenuList (160-160)
  • NavigationMenuItem (161-161)
  • NavigationMenuTrigger (163-163)
  • NavigationMenuContent (162-162)
  • NavigationMenuLink (164-164)
  • NavigationMenuIndicator (165-165)
lib/utils.ts (1)
  • cn (4-6)
🔇 Additional comments (11)
components/examples/navigation-menu.tsx (3)

17-54: LGTM! Well-structured component data.

The components array is well-organized with clear title, href, and description fields. The data structure is type-safe and provides good examples for the navigation menu demo.


56-119: Excellent navigation menu implementation.

The NavigationMenuDemo component demonstrates effective use of the 8-bit navigation menu components with:

  • Proper hierarchical structure with nested content
  • Good responsive design with grid layouts
  • Appropriate use of NavigationMenuIndicator for visual feedback
  • Clean separation between different navigation sections

The implementation follows React best practices and provides a comprehensive example.


121-139: Well-designed helper component.

The ListItem component is properly typed with React.ComponentPropsWithoutRef<"li"> & { href: string } and effectively demonstrates the composition pattern with NavigationMenuLink and Next.js Link integration.

public/r/8bit-navigation-menu.json (1)

1-18: Registry configuration looks correct.

The JSON structure follows the proper schema with accurate metadata:

  • Correct component type and naming
  • Appropriate dependency on the base "navigation-menu" component
  • Valid file path targeting the 8-bit implementation

The inline content appears to match the actual implementation file.

components/ui/8bit/navigation-menu.tsx (7)

1-22: Well-organized imports and font configuration.

The imports are properly structured with clear separation between React, Next.js, Radix UI, and local dependencies. The Press Start 2P font configuration is correctly set up with appropriate weight and subset specifications.


23-38: Excellent variant system implementation.

The navigationMenuVariants using class-variance-authority provides a clean, type-safe way to handle font switching. The getFontClassName helper function properly encapsulates the variant logic and promotes consistency across components.


40-64: Appropriate architectural decision for custom viewport.

Based on the retrieved learnings, using Radix Root directly is justified here because you need to replace the contained NavigationMenuViewport with a custom implementation that includes shadow-border styling. The component properly manages the viewport rendering and applies consistent font styling.


66-122: Consistent component wrapper implementations.

All the wrapper components (NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent) follow a consistent pattern:

  • Proper type definitions extending base component props with FontVariantProps
  • Consistent use of getFontClassName helper
  • Appropriate prop forwarding and className merging

The implementations are clean and maintainable.


124-148: Justified custom viewport implementation.

The NavigationMenuViewport component uses Radix Viewport directly, which is appropriate given the need for custom shadow-border styling that the base shadcn component doesn't expose. The implementation includes:

  • Proper wrapper div for positioning
  • Custom shadow classes for 8-bit aesthetic
  • Consistent font application
  • Responsive design with CSS custom properties

163-182: Appropriate custom indicator implementation.

Based on retrieved learnings, using Radix Indicator directly is justified because you need to apply custom styling (dark:bg-ring) to the inner div element that the shadcn wrapper doesn't provide an interface for. The implementation correctly handles:

  • Animation states with proper data attributes
  • Custom styling for light and dark modes
  • Consistent font application

184-193: Complete and properly organized exports.

All navigation menu components are exported with clear, consistent naming that follows the established pattern. The exports provide a complete API for building navigation menus with 8-bit styling.

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🔭 Outside diff range comments (1)
registry.json (1)

328-341: ⚠️ Potential issue

Remove duplicate tooltip component entry.

There's a duplicate entry for the "8bit-tooltip" component (first occurrence at lines 314-327). This duplication could cause registry conflicts and should be removed.

-    {
-      "name": "8bit-tooltip",
-      "type": "registry:component",
-      "title": "8-bit Tooltip",
-      "description": "A simple 8-bit tooltip component",
-      "registryDependencies": ["tooltip"],
-      "files": [
-        {
-          "path": "components/ui/8bit/tooltip.tsx",
-          "type": "registry:component",
-          "target": "components/ui/8bit/tooltip.tsx"
-        }
-      ]
-    },
🧹 Nitpick comments (4)
config/nav-items.ts (1)

98-101: Navigation configuration correctly implemented.

The new "Navigation Menu" item follows the established pattern and will be properly sorted alphabetically. Consider adding new: true if this component should be marked as new, similar to other recently added components.

If this is a new component, consider adding the new flag:

  {
    title: "Navigation Menu",
    url: "/docs/components/navigation-menu",
+   new: true,
  },
public/r/8bit-navigation-menu.json (1)

1-18: Registry structure looks good, but consider the maintenance implications of embedded code.

The registry file correctly follows the schema and properly declares the dependency on "navigation-menu". However, embedding the entire TypeScript component code as a string in line 13 makes it difficult to maintain, test with TypeScript compiler, and get IDE support.

Consider whether the component code could be stored as a separate file and referenced, rather than embedded as a string. This would improve maintainability and enable proper tooling support.

components/ui/navigation-menu.tsx (2)

76-76: Consider using CSS margin instead of a space character for layout.

The space character after {children} could be replaced with CSS margin on the icon for more maintainable spacing.

-      {children}{" "}
+      {children}
       <ChevronDownIcon
-        className="relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180"
+        className="relative top-[1px] ml-1.5 size-3 transition duration-300 group-data-[state=open]:rotate-180"

92-95: Extract complex animation classes for better maintainability.

The className string is very complex and difficult to read. Consider extracting the animation and viewport-specific classes into separate variables or using a utility function to compose them.

+const contentAnimationClasses = "data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52"
+
+const viewportFalseClasses = "group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none"

 function NavigationMenuContent({
   className,
   ...props
 }: React.ComponentProps<typeof NavigationMenuPrimitive.Content>) {
   return (
     <NavigationMenuPrimitive.Content
       data-slot="navigation-menu-content"
       className={cn(
-        "data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 top-0 left-0 w-full p-2 pr-2.5 md:absolute md:w-auto",
-        "group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none",
+        contentAnimationClasses,
+        "top-0 left-0 w-full p-2 pr-2.5 md:absolute md:w-auto",
+        viewportFalseClasses,
         className
       )}
       {...props}
     />
   )
 }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9e2ec92 and a1b9ceb.

📒 Files selected for processing (9)
  • app/docs/components/navigation-menu/demo.tsx (1 hunks)
  • app/docs/components/navigation-menu/page.tsx (1 hunks)
  • app/globals.css (3 hunks)
  • components/ui/8bit/navigation-menu.tsx (1 hunks)
  • components/ui/navigation-menu.tsx (1 hunks)
  • config/nav-items.ts (1 hunks)
  • package.json (1 hunks)
  • public/r/8bit-navigation-menu.json (1 hunks)
  • registry.json (1 hunks)
🔇 Additional comments (9)
registry.json (1)

773-786: LGTM! The navigation menu component registration follows proper conventions.

The new 8bit-navigation-menu entry is correctly structured with proper dependencies and file paths.

app/globals.css (3)

79-79: Good implementation of theme-aware CSS custom property.

The --shadow-border property correctly uses var(--foreground) for the light theme, ensuring consistency with the design system.


114-114: Appropriate dark theme variation.

The dark theme uses var(--ring) for the shadow border, which provides good contrast and visual distinction from the light theme.


126-132: Excellent 8-bit styling implementation.

The .shadow-border class creates a multi-directional pixelated border effect that perfectly aligns with the project's 8-bit aesthetic. The use of CSS custom properties makes it theme-aware and maintainable.

app/docs/components/navigation-menu/demo.tsx (2)

55-118: Well-structured navigation menu demo implementation!

The component properly demonstrates the navigation menu with dropdown content, grid layouts, and responsive design. Good use of semantic HTML and accessibility considerations.


120-138: Clean helper component implementation!

Good use of TypeScript for type safety and proper forwarding of props.

app/docs/components/navigation-menu/page.tsx (1)

20-87: Well-structured documentation page!

Good organization with clear sections for demo, installation, and usage. Proper use of environment variables for dynamic URLs.

components/ui/8bit/navigation-menu.tsx (2)

1-200: Excellent implementation of the 8-bit styled navigation menu!

The component architecture is well-designed with:

  • Clean separation of concerns using wrapper components
  • Consistent font variant implementation across all components
  • Proper TypeScript typing and prop forwarding
  • Good use of Radix UI primitives for accessibility

The retro font styling with Press_Start_2P adds a nice 8-bit aesthetic while maintaining functionality.


132-155:

✅ Verification successful

Verify the shadow-border class is properly defined.

The component uses the shadow-border class. Based on the PR changes, this should be defined in globals.css.

Run the following script to verify the shadow-border class definition:


🏁 Script executed:

#!/bin/bash
# Description: Verify that the shadow-border class is defined in the CSS files

# Search for shadow-border class definition
rg -A 5 "\.shadow-border" --type css

Length of output: 303


Confirm .shadow-border Class Definition

  • Verified presence of the .shadow-border rule in app/globals.css (defines the expected box-shadow).
  • No further changes needed—implementation is correct.

@BIT-zhaoyang BIT-zhaoyang force-pushed the feat-navigation-menu branch 2 times, most recently from 0ef6262 to 346c278 Compare May 26, 2025 15:04
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
app/docs/components/navigation-menu/demo.tsx (1)

37-39: Fix the incorrect description for the Scroll-area component.

The description "Visually or semantically separates content" doesn't match what a scroll area component does. This description is more appropriate for a separator component.

🧹 Nitpick comments (1)
components/ui/8bit/navigation-menu.tsx (1)

19-22: Consider reusing existing font configuration.

The Press Start 2P font configuration appears to be duplicated. Based on the relevant code snippets, there's already a pressStart export in config/fonts.ts. Consider importing from there instead of redefining it.

Apply this diff to reuse the existing font configuration:

-import { Press_Start_2P } from "next/font/google"
+import { pressStart } from "@/config/fonts"
-const pressStart = Press_Start_2P({
-  weight: ["400"],
-  subsets: ["latin"],
-})
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0ef6262 and 346c278.

📒 Files selected for processing (5)
  • app/docs/components/navigation-menu/demo.tsx (1 hunks)
  • app/docs/components/navigation-menu/page.tsx (1 hunks)
  • app/globals.css (3 hunks)
  • components/ui/8bit/navigation-menu.tsx (1 hunks)
  • package.json (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • package.json
  • app/globals.css
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/docs/components/navigation-menu/page.tsx
🧰 Additional context used
🧬 Code Graph Analysis (2)
app/docs/components/navigation-menu/demo.tsx (2)
components/ui/8bit/navigation-menu.tsx (8)
  • NavigationMenu (192-192)
  • NavigationMenuList (197-197)
  • NavigationMenuItem (195-195)
  • NavigationMenuTrigger (198-198)
  • NavigationMenuContent (193-193)
  • NavigationMenuLink (196-196)
  • navigationMenuTriggerStyle (17-17)
  • NavigationMenuIndicator (194-194)
components/ui/navigation-menu.tsx (8)
  • NavigationMenu (159-159)
  • NavigationMenuList (160-160)
  • NavigationMenuItem (161-161)
  • NavigationMenuTrigger (163-163)
  • NavigationMenuContent (162-162)
  • NavigationMenuLink (164-164)
  • navigationMenuTriggerStyle (167-167)
  • NavigationMenuIndicator (165-165)
components/ui/8bit/navigation-menu.tsx (3)
config/fonts.ts (1)
  • pressStart (3-6)
components/ui/navigation-menu.tsx (8)
  • NavigationMenu (159-159)
  • NavigationMenuViewport (166-166)
  • NavigationMenuList (160-160)
  • NavigationMenuItem (161-161)
  • NavigationMenuTrigger (163-163)
  • NavigationMenuContent (162-162)
  • NavigationMenuLink (164-164)
  • NavigationMenuIndicator (165-165)
lib/utils.ts (1)
  • cn (4-6)
🔇 Additional comments (6)
app/docs/components/navigation-menu/demo.tsx (2)

120-138: Well-implemented helper component.

The ListItem component demonstrates good practices:

  • Proper TypeScript typing with intersection types
  • Correct use of asChild pattern for accessibility
  • Good semantic HTML structure
  • Appropriate text truncation with line-clamp-2

84-86: Verify the Typography link destination and description.

The "Typography" link points to "/blocks" with description "Building Retro Blocks for the Web". This seems like a potential mismatch - verify that this is the intended destination for typography documentation.

components/ui/8bit/navigation-menu.tsx (4)

24-42: Well-structured variant system.

The CVA variant setup is clean and properly typed:

  • Clear variant names with sensible defaults
  • Comprehensive TypeScript interfaces
  • Good separation of concerns

44-68: Excellent root component implementation.

Good practices demonstrated:

  • Proper Radix UI primitive wrapping
  • Flexible viewport rendering option
  • Conditional font class application
  • Clean prop forwarding and class merging

70-189: Consistent and well-implemented component wrappers.

All component wrappers follow excellent patterns:

  • Consistent font variant application
  • Proper TypeScript typing
  • Clean prop forwarding
  • Special handling for viewport positioning and indicator styling

The implementation maintains consistency while allowing for component-specific customizations where needed.


191-200: Clean and comprehensive exports.

All components are properly exported with clear, consistent naming.

- create better, more consistent border behavior
- fix broken links in demo
@BIT-zhaoyang BIT-zhaoyang force-pushed the feat-navigation-menu branch from 346c278 to 4d4536f Compare May 26, 2025 15:15
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🧹 Nitpick comments (1)
components/ui/8bit/navigation-menu.tsx (1)

19-34: Consider improving the variant system design.

The font variant implementation is functional but could be more efficient and user-friendly:

  1. The default variant is "retro" which might be unexpected for users
  2. The font loading could be optimized by making it conditional

Consider this approach for better performance and UX:

-const pressStart = Press_Start_2P({
-  weight: ["400"],
-  subsets: ["latin"],
-})
+const pressStart = Press_Start_2P({
+  weight: ["400"],
+  subsets: ["latin"],
+  display: "swap", // Better font loading performance
+})

 export const navigationMenuVariants = cva("", {
   variants: {
     font: {
       normal: "",
       retro: pressStart.className,
     },
   },
   defaultVariants: {
-    font: "retro",
+    font: "normal", // More intuitive default
   },
 })
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 346c278 and 4d4536f.

📒 Files selected for processing (5)
  • app/docs/components/navigation-menu/demo.tsx (1 hunks)
  • app/docs/components/navigation-menu/page.tsx (1 hunks)
  • app/globals.css (3 hunks)
  • components/ui/8bit/navigation-menu.tsx (1 hunks)
  • package.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • package.json
  • app/globals.css
  • app/docs/components/navigation-menu/demo.tsx
  • app/docs/components/navigation-menu/page.tsx
🧰 Additional context used
🧬 Code Graph Analysis (1)
components/ui/8bit/navigation-menu.tsx (3)
config/fonts.ts (1)
  • pressStart (3-6)
components/ui/navigation-menu.tsx (8)
  • NavigationMenu (159-159)
  • NavigationMenuViewport (166-166)
  • NavigationMenuList (160-160)
  • NavigationMenuItem (161-161)
  • NavigationMenuTrigger (163-163)
  • NavigationMenuContent (162-162)
  • NavigationMenuLink (164-164)
  • NavigationMenuIndicator (165-165)
lib/utils.ts (1)
  • cn (4-6)
🔇 Additional comments (1)
components/ui/8bit/navigation-menu.tsx (1)

1-17: LGTM! Clean imports and re-export.

The imports are well-organized and the re-export of navigationMenuTriggerStyle maintains API consistency with the base component.

fix code rabbit ai comments
Copy link
Owner

@TheOrcDev TheOrcDev left a comment

Choose a reason for hiding this comment

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

When we fix these minor things we can merge! Thanks!

Copy link
Owner

Choose a reason for hiding this comment

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

remove all changes on the globals.css

Copy link
Owner

Choose a reason for hiding this comment

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

move this file to the example directory

title: "8-bit Navigation Menu",
description: "Displays an 8-bit navigation menu component.",
openGraph: {
images: labelMetaData,
Copy link
Owner

Choose a reason for hiding this comment

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

create a screenshot and add navigationMetaData

- Address review comment
- update registry file
Copy link
Owner

@TheOrcDev TheOrcDev left a comment

Choose a reason for hiding this comment

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

Looking great! Merging! Thank youuuu

@TheOrcDev TheOrcDev merged commit 601b068 into TheOrcDev:main May 27, 2025
1 of 2 checks passed
Riley1101 pushed a commit to Riley1101/8bitcn-ui that referenced this pull request Jun 8, 2025
* feat: navigation menu

* feat: navigation menu
fix code rabbit ai comments

* feat: navigation menu
- create better, more consistent border behavior
- fix broken links in demo

* feat: navigation menu
fix code rabbit ai comments

* feat: navigation menu
- Address review comment

* feat: navigation menu
- update registry file
TheOrcDev added a commit that referenced this pull request Jun 9, 2025
* added syntax highlight

* Feat/drawer (#195)

* setting up 8bit version of the drawer component, setting up the template for the drawer page and example from shadcn

* made drawer component for content, trigger, footer and header into 8bit pixel style

* added example of drawer component, metadata graph image and ran registry build

* fix issue with dark mode button border not yellow

* reran registry build

* rewrite content component to make use of vaul primitive drawer content and modify drawer handle

* reran registry build

* remove top side for drawer content

* reran registry build

* refactor: update drawer and sheet components styling and positioning

* feat(drawer) change example code

---------

Co-authored-by: OrcDev <urosmiric88@gmail.com>

* chore: add GitHub Sponsors funding configuration file (#197)

* docs: add GitHub sponsor badge to README (#198)

* refactor: update React.ElementRef to React.ComponentRef in UI components for better type safety (#199)

* Feat/toast (#200)

* feat(registry) add toast

* refactor(toast) change to 8-bit toast

* feat(installation-commands) replace sonner with 8-bit toast (#201)

* chore: latest dependencies (#202)

* Feat navigation menu (#203)

* feat: navigation menu

* feat: navigation menu
fix code rabbit ai comments

* feat: navigation menu
- create better, more consistent border behavior
- fix broken links in demo

* feat: navigation menu
fix code rabbit ai comments

* feat: navigation menu
- Address review comment

* feat: navigation menu
- update registry file

* feat(nav-items) add new tag to navigation menu (#204)

* Feat/themes (#205)

* feat(app) add themes page

* feat(themes) add all retro themes

* feat: add theme copy dialog and refactor theme management with TypeScript enums

* style: update calendar sizing, code snippet layout and theme selector text colors

* style: update theme selector UI and adjust accent color values across themes

* style: adjust accent and muted color values in dark and light themes

* feat(themes) add metadata (#206)

* chore: add semicolons and consistent formatting across components (#207)

* chore: latest dependencies (#208)

* feat(button) add local font for react support (#209)

* refactor: replace custom font with Google Fonts for Press Start 2P (#210)

* refactor: move retro font to external CSS and simplify button styling (#211)

* refactor(app) make all components work on react (#212)

* style: add type prefix to VariantProps imports across components (#213)

* refactor: remove new badges from nav items (#214)

* refactor: remove new badge from mobile navigation items (#215)

* fix: adjust YAxis width from 45 to 46 pixels in chart component (#216)

* feat(registry) add bar chart component (#217)

* feat: add authentication and charts blocks pages with example components (#218)

* added syntax highlight

* Removed unused code

* re added Max height control

---------

Co-authored-by: Elias Tran <trandinhphuc1997@gmail.com>
Co-authored-by: OrcDev <urosmiric88@gmail.com>
Co-authored-by: YangZhao <bit.zhaoyang512@gmail.com>
@coderabbitai coderabbitai bot mentioned this pull request Aug 28, 2025
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