Skip to content

Feat dialog component#57

Open
abdirahmanmahamoud wants to merge 3 commits into
TheOrcDev:mainfrom
abdirahmanmahamoud:feat--Dialog-component
Open

Feat dialog component#57
abdirahmanmahamoud wants to merge 3 commits into
TheOrcDev:mainfrom
abdirahmanmahamoud:feat--Dialog-component

Conversation

@abdirahmanmahamoud

@abdirahmanmahamoud abdirahmanmahamoud commented Mar 21, 2026

Copy link
Copy Markdown
Contributor

issues number #7

Summary by CodeRabbit

  • New Features

    • Introduced a new Warcraft-themed Dialog component for displaying modal content with customizable headers, footers, titles, and descriptions. Includes built-in close functionality with screen-reader support.
  • Documentation

    • Added comprehensive Dialog component documentation with installation instructions and practical usage examples.

@vercel

vercel Bot commented Mar 21, 2026

Copy link
Copy Markdown

@abdirahmanmahamoud is attempting to deploy a commit to the OrcDev Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Mar 21, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

A new Warcraft-themed Dialog component suite was added, built on Radix UI, with supporting documentation, registry entry, and navigation updates across the documentation structure.

Changes

Cohort / File(s) Summary
Dialog Component Implementation
components/ui/warcraftcn/dialog.tsx
New client-side Dialog component wrapper exporting eight sub-components (Dialog, DialogTrigger, DialogClose, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription) with Warcraft-themed styling, fixed centered positioning, overlay animation states, and built-in close button with icon.
Documentation & Navigation
content/docs/components/dialog.mdx, content/docs/components/index.mdx, content/docs/components/meta.json
Added new documentation page with Standard example, Installation instructions, and Usage guide; updated component index with Dialog card and navigation; added "dialog" entry to components metadata pages array.
Registry Configuration
registry.json
Registered new dialog component with Radix UI dependency (@radix-ui/react-dialog), mapping to component implementation file and Warcraft CSS stylesheet.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related issues

  • feat: Dialog component #7: This PR directly implements the Warcraft-themed Dialog component with all requested building blocks (Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, DialogClose) using Radix UI primitives, fully addressing this feature request.

Suggested reviewers

  • TheOrcDev

Poem

🐰✨ A dialog springs to life with Warcraft flair,
Portal and overlay floating in the air,
Trigger, content, footer dancing just right,
A rabbit's gift to close the gap in sight! 🎭

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Feat dialog component' clearly describes the main change: adding a new Dialog component. It is concise and specific enough to convey the primary purpose of the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can disable poems in the walkthrough.

Disable the reviews.poem setting to disable the poems in the walkthrough.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@components/ui/warcraftcn/dialog.tsx`:
- Around line 36-47: The overlay is receiving the same spread props as the
content which can duplicate IDs/handlers and send unsupported props to the wrong
element; update the component so DialogPrimitive.Overlay does not receive the
full {...props} meant for DialogPrimitive.Content—destructure the incoming props
(e.g., ({ className, ...contentProps }) or split into overlayProps and
contentProps) and spread only overlay-specific attributes onto
DialogPrimitive.Overlay and only contentProps (plus className) onto
DialogPrimitive.Content; reference DialogPrimitive.Overlay,
DialogPrimitive.Content, className and props to find and fix the incorrect
spread.

In `@registry.json`:
- Around line 492-493: The registry entry currently lists only
"@radix-ui/react-dialog" in the "dependencies" array but the component
components/ui/warcraftcn/dialog.tsx imports XIcon from "lucide-react"; update
the dialog registry entry by adding "lucide-react" to its "dependencies" array
so consumers will install it alongside `@radix-ui/react-dialog` and avoid
missing-import installation failures.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c1459c31-a6e9-47de-a152-f0afb51dbcd7

📥 Commits

Reviewing files that changed from the base of the PR and between 67dfa8e and abc3d42.

📒 Files selected for processing (5)
  • components/ui/warcraftcn/dialog.tsx
  • content/docs/components/dialog.mdx
  • content/docs/components/index.mdx
  • content/docs/components/meta.json
  • registry.json

Comment on lines +36 to +47
<DialogPrimitive.Overlay
data-slot="dialog-overlay"
className="fixed inset-0 z-50 bg-black/80 backdrop-blur-[2px] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
{...props}
/>
<DialogPrimitive.Content
data-slot="dialog-content"
className={cn(
"fantasy fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border-solid wc-dropdown-border [border-image-repeat:stretch] border-[16px] [border-image-slice:16_fill] bg-amber-950/95 p-6 text-amber-100 shadow-2xl duration-300 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-[0.98] data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[52%]",
className
)}
{...props}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Do not spread DialogContent props onto the overlay.

DialogPrimitive.Content props are also being applied to DialogPrimitive.Overlay on Line 39. This can duplicate IDs/event handlers and pass unsupported props to the wrong node.

🔧 Proposed fix
       <DialogPrimitive.Overlay
         data-slot="dialog-overlay"
         className="fixed inset-0 z-50 bg-black/80 backdrop-blur-[2px] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
-        {...props}
       />
       <DialogPrimitive.Content
         data-slot="dialog-content"
         className={cn(
           "fantasy fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border-solid wc-dropdown-border [border-image-repeat:stretch] border-[16px] [border-image-slice:16_fill] bg-amber-950/95 p-6 text-amber-100 shadow-2xl duration-300 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-[0.98] data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[52%]",
           className
         )}
         {...props}
       >
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<DialogPrimitive.Overlay
data-slot="dialog-overlay"
className="fixed inset-0 z-50 bg-black/80 backdrop-blur-[2px] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
{...props}
/>
<DialogPrimitive.Content
data-slot="dialog-content"
className={cn(
"fantasy fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border-solid wc-dropdown-border [border-image-repeat:stretch] border-[16px] [border-image-slice:16_fill] bg-amber-950/95 p-6 text-amber-100 shadow-2xl duration-300 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-[0.98] data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[52%]",
className
)}
{...props}
<DialogPrimitive.Overlay
data-slot="dialog-overlay"
className="fixed inset-0 z-50 bg-black/80 backdrop-blur-[2px] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
/>
<DialogPrimitive.Content
data-slot="dialog-content"
className={cn(
"fantasy fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border-solid wc-dropdown-border [border-image-repeat:stretch] border-[16px] [border-image-slice:16_fill] bg-amber-950/95 p-6 text-amber-100 shadow-2xl duration-300 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-[0.98] data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[52%]",
className
)}
{...props}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@components/ui/warcraftcn/dialog.tsx` around lines 36 - 47, The overlay is
receiving the same spread props as the content which can duplicate IDs/handlers
and send unsupported props to the wrong element; update the component so
DialogPrimitive.Overlay does not receive the full {...props} meant for
DialogPrimitive.Content—destructure the incoming props (e.g., ({ className,
...contentProps }) or split into overlayProps and contentProps) and spread only
overlay-specific attributes onto DialogPrimitive.Overlay and only contentProps
(plus className) onto DialogPrimitive.Content; reference
DialogPrimitive.Overlay, DialogPrimitive.Content, className and props to find
and fix the incorrect spread.

Comment thread registry.json
Comment on lines +492 to +493
"dependencies": ["@radix-ui/react-dialog"],
"registryDependencies": [],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Verify dialog component imports lucide-react
rg -n 'from "lucide-react"' components/ui/warcraftcn/dialog.tsx

# Verify declared dependencies in registry entry
rg -n '"name": "dialog"|"dependencies"' registry.json -A8 -B2

Repository: TheOrcDev/warcraftcn-ui

Length of output: 3998


Add missing lucide-react dependency for the dialog registry entry.

components/ui/warcraftcn/dialog.tsx imports XIcon from lucide-react, but the registry entry only declares @radix-ui/react-dialog as a dependency. This will cause installation failures for consumers.

🔧 Proposed fix
-      "dependencies": ["@radix-ui/react-dialog"],
+      "dependencies": ["@radix-ui/react-dialog", "lucide-react"],
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"dependencies": ["@radix-ui/react-dialog"],
"registryDependencies": [],
"dependencies": ["@radix-ui/react-dialog", "lucide-react"],
"registryDependencies": [],
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@registry.json` around lines 492 - 493, The registry entry currently lists
only "@radix-ui/react-dialog" in the "dependencies" array but the component
components/ui/warcraftcn/dialog.tsx imports XIcon from "lucide-react"; update
the dialog registry entry by adding "lucide-react" to its "dependencies" array
so consumers will install it alongside `@radix-ui/react-dialog` and avoid
missing-import installation failures.

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.

1 participant