Skip to content

Conversation

@Harshit2569
Copy link

@Harshit2569 Harshit2569 commented Dec 11, 2025

Summary

This update adds a Home/Dashboard navigation icon to the Pricing page, providing users with a clear and convenient way to return to the main dashboard without needing to use the browser’s back button.
It improves the navigation flow, reinforces consistency across the application, and enhances the overall user experience by reducing friction and promoting intuitive movement between key sections of the app.

Additionally, the new navigation element aligns with modern UI/UX best practices, ensuring a more accessible, responsive, and mobile-friendly design.
This small yet impactful change strengthens the sense of structure and continuity throughout the user journey, making the app feel more polished and cohesive.
Problem

On the Opensox pro, users currently have no direct way to navigate back to the Dashboard or Home screen.
The only available option is to use the browser’s back button, which is not intuitive and disrupts the natural flow of navigation.

This lack of an accessible navigation option leads to:

1.Poor navigation experience, especially for new users.

Inconsistent layout behavior compared to other pages that provide clear navigation.

Reduced usability on mobile devices, where the browser back button is less convenient.

Higher cognitive load, as users must figure out how to return manually instead of following a visible UI element.

Proposed Solution

I added a Home/Dashboard icon to the header on the Opensox pro page so users can easily go back to the main dashboard without using the browser’s back button.

The icon is placed at the top-left corner and looks good on both desktop and mobile screens. It’s also responsive and easy to tap on smaller devices.

This change makes navigation smoother, more consistent, and improves the overall user experience on the Opensox pro page.

https://drive.google.com/file/d/1ohzbETtXZz5ioeXKF9C5FyXtiD2YgvX4/view?usp=sharing here is the video link please take the look

Summary by CodeRabbit

  • New Features
    • Sidebar now expands on hover when collapsed, revealing full labels and icons for improved navigation.
    • Header supports an optional home navigation link, showing a home icon when provided.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Dec 11, 2025

@Harshit2569 is attempting to deploy a commit to the AJEET PRATAP SINGH's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 11, 2025

Walkthrough

Adds an optional homeLink prop to the Header and passes "/dashboard/home" from the Pricing page; introduces hover-to-expand behavior in the Dashboard Sidebar that dynamically adjusts expansion state and widths based on hover and collapse flags.

Changes

Cohort / File(s) Summary
Header Component
apps/web/src/components/ui/header.tsx
Adds optional homeLink?: string prop; imports Link and Home icon; conditionally renders a Home link/icon when homeLink is provided; adjusts layout and visual props.
Pricing Page
apps/web/src/app/(main)/(landing)/pricing/page.tsx
Passes homeLink="/dashboard/home" to the Header invocation.
Sidebar Hover-to-Expand
apps/web/src/components/dashboard/Sidebar.tsx
Adds isHovered state and mouse enter/leave handlers; computes `isSidebarExpanded = !isCollapsed

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review Sidebar: interplay of isHovered and isCollapsed, width animation values, and all conditional render switches from isCollapsed to isSidebarExpanded.
  • Verify Header: optional homeLink is backward-compatible and accessible (aria-label) where rendered.
  • Quick test: Pricing page renders Header with home link and Sidebar hover behaves across breakpoints.

Possibly related issues

  • Issue 255 — adds Home/Dashboard navigation and passing home link to Header: matches Header prop addition and Pricing page change.

Possibly related PRs

  • PR 170 — previously added homeLink support to Header (related prop/signature changes).
  • PR 250 — modifies Header and Pricing usages (overlapping edits to same components).
  • PR 172 — touches Sidebar behavior/structure and may overlap with hover/animation adjustments.

Poem

🐰 I hopped along the sidebar's seam,
A hover made it stretch and gleam,
A tiny home-icon points the way,
From Pricing to Dashboard, bright as day,
Hooray — I nibble bugs away! 🎉

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'Feature/pricing UI' is vague and generic, using non-descriptive branch-naming conventions rather than clearly summarizing the primary change of adding a Home navigation icon to the Pricing page. Use a more specific, descriptive title such as 'Add Home navigation icon to Pricing page header' or 'Add Dashboard home link to Pricing page' to clearly communicate the main change.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@cla-assistant
Copy link

cla-assistant bot commented Dec 11, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

1 similar comment
@cla-assistant
Copy link

cla-assistant bot commented Dec 11, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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/web/src/components/ui/header.tsx (1)

10-10: extract header props into a named type

to match the typescript guidelines (define a type for const functions), consider pulling props into a reusable type instead of an inline annotation.

-const Header = ({title, homeLink}: {title: string, homeLink?: string}) => {
+type HeaderProps = {
+    title: string
+    homeLink?: string
+}
+
+const Header = ({ title, homeLink }: HeaderProps) => {

as per coding guidelines, this keeps the component api clearer and easier to extend.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 050e439 and 94b02ed.

📒 Files selected for processing (3)
  • apps/web/src/app/(main)/(landing)/pricing/page.tsx (1 hunks)
  • apps/web/src/components/dashboard/Sidebar.tsx (12 hunks)
  • apps/web/src/components/ui/header.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (11)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx,js,jsx}: Always use lowercase when writing comments
Avoid unnecessary comments; code should be self-documenting when possible
Use comments to explain 'why', not 'what'
Remove unused imports
Use UPPER_SNAKE_CASE for constants
Use camelCase for functions and variables

Files:

  • apps/web/src/app/(main)/(landing)/pricing/page.tsx
  • apps/web/src/components/dashboard/Sidebar.tsx
  • apps/web/src/components/ui/header.tsx
apps/web/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

apps/web/src/**/*.{ts,tsx}: Always follow the design system defined in apps/web/src/lib/design-tokens.ts and apps/web/tailwind.config.ts
NEVER use hardcoded hex values (e.g., #5519f7) directly in components; ALWAYS reference colors from the design token system using Tailwind classes
Use semantic color names that describe purpose, not appearance
Use font-sans for standard UI text (Geist Sans) and font-mono for code, technical content, or monospace needs (DM Mono)
Follow Tailwind's spacing scale (0.25rem increments); for section padding use mobile p-4 (1rem) and desktop p-[60px]
Use appropriate border radius: small elements rounded-lg, medium rounded-xl, large rounded-2xl, buttons rounded-[16px]
Use animation durations: fast duration-100 (0.1s), normal duration-300 (0.3s), slow duration-600 (0.6s)

Files:

  • apps/web/src/app/(main)/(landing)/pricing/page.tsx
  • apps/web/src/components/dashboard/Sidebar.tsx
  • apps/web/src/components/ui/header.tsx
**/*.{tsx,ts}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{tsx,ts}: Prefer functional components with TypeScript and use proper TypeScript types, avoid any
Extract reusable logic into custom hooks
Use descriptive prop names and define prop types using TypeScript interfaces or types
Prefer controlled components over uncontrolled
Use zustand for global state (located in src/store/)
Use absolute imports from @/ prefix when available
Include proper aria labels for accessibility
Ensure keyboard navigation works
Maintain proper heading hierarchy
Provide alt text for images
Avoid unnecessary re-renders

Files:

  • apps/web/src/app/(main)/(landing)/pricing/page.tsx
  • apps/web/src/components/dashboard/Sidebar.tsx
  • apps/web/src/components/ui/header.tsx
**/*.{tsx,ts,jsx,js}

📄 CodeRabbit inference engine (.cursorrules)

Organize imports: react → third-party → local components → utils → types

Files:

  • apps/web/src/app/(main)/(landing)/pricing/page.tsx
  • apps/web/src/components/dashboard/Sidebar.tsx
  • apps/web/src/components/ui/header.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx}: Use PascalCase for types and interfaces with descriptive names
Use dynamic imports for code splitting when appropriate
Memoize expensive computations

Files:

  • apps/web/src/app/(main)/(landing)/pricing/page.tsx
  • apps/web/src/components/dashboard/Sidebar.tsx
  • apps/web/src/components/ui/header.tsx
apps/web/src/**/*.{tsx,ts}

📄 CodeRabbit inference engine (.cursorrules)

Optimize images using next/image

apps/web/src/**/*.{tsx,ts}: Use Zustand for global state, located in src/store/
Use PascalCase for types and interfaces with descriptive names
Use dynamic imports for code splitting when appropriate
Optimize images using next/image
Memoize expensive computations
Define a type when defining const functions

Files:

  • apps/web/src/app/(main)/(landing)/pricing/page.tsx
  • apps/web/src/components/dashboard/Sidebar.tsx
  • apps/web/src/components/ui/header.tsx
**/*.{js,jsx,ts,tsx,py,java,go,rb,php}

📄 CodeRabbit inference engine (.cursor/rules/general_rules.mdc)

**/*.{js,jsx,ts,tsx,py,java,go,rb,php}: Always use lowercase when writing comments
Avoid unnecessary comments; code should be self-documenting when possible
Use comments to explain 'why', not 'what'

Files:

  • apps/web/src/app/(main)/(landing)/pricing/page.tsx
  • apps/web/src/components/dashboard/Sidebar.tsx
  • apps/web/src/components/ui/header.tsx
apps/web/src/**/*.{tsx,ts,jsx,js}

📄 CodeRabbit inference engine (apps/web/.cursor/rules/frontend_rules.mdc)

apps/web/src/**/*.{tsx,ts,jsx,js}: Organize imports in order: React → third-party → local components → utils → types
Use absolute imports from @/ prefix when available
Remove unused imports
Use UPPER_SNAKE_CASE for constants
Use camelCase for functions and variables
Always use Tailwind classes for styling HTML elements; avoid using CSS or style tags
Use descriptive variable and function names; name event functions with a 'handle' prefix (e.g., handleClick, handleKeyDown)
Use const with arrow functions instead of function declarations (e.g., 'const toggle = () =>')

Files:

  • apps/web/src/app/(main)/(landing)/pricing/page.tsx
  • apps/web/src/components/dashboard/Sidebar.tsx
  • apps/web/src/components/ui/header.tsx
**/*[A-Z]*.{tsx,ts}

📄 CodeRabbit inference engine (.cursorrules)

Use PascalCase for component file names (e.g., UserProfile.tsx)

Files:

  • apps/web/src/components/dashboard/Sidebar.tsx
apps/web/src/components/**/*.{tsx,ts,jsx,js}

📄 CodeRabbit inference engine (apps/web/.cursor/rules/frontend_rules.mdc)

apps/web/src/components/**/*.{tsx,ts,jsx,js}: Never use hardcoded hex values directly in components; always reference colors from the design token system using Tailwind classes
Use semantic color names from the design token system that describe purpose, not appearance (e.g., bg-brand-purple, bg-surface-primary, text-text-primary)
Use font-sans for standard UI text (Geist Sans) and font-mono for code, technical content, or monospace needs (DM Mono)
Follow Tailwind's spacing scale for section padding: p-4 (1rem) on mobile, p-[60px] on desktop
Use rounded-lg (0.5rem) for small elements, rounded-xl (1rem) for medium elements, rounded-2xl (1.5rem) for large elements, and rounded-[16px] for buttons
Use duration-100 (0.1s) for fast transitions, duration-300 (0.3s) for normal transitions, and duration-600 (0.6s) for slow transitions
Use available custom animations: animate-accordion-down, animate-accordion-up, animate-scrollRight, animate-scrollLeft, animate-customspin, animate-spin-slow, animate-spin-slow-reverse, animate-marquee, animate-marquee-vertical, animate-shine
Prefer functional components with TypeScript
Extract reusable logic into custom hooks
Prefer controlled components over uncontrolled
Include proper aria labels for accessibility
Ensure keyboard navigation works in interactive components
Maintain proper heading hierarchy in page components
Provide alt text for images
Use 'class:' instead of the ternary operator in class tags whenever possible
Implement accessibility features on interactive elements (e.g., tabindex='0', aria-label, onClick, onKeyDown)
Always follow the design system defined in apps/web/src/lib/design-tokens.ts and apps/web/tailwind.config.ts

Files:

  • apps/web/src/components/dashboard/Sidebar.tsx
  • apps/web/src/components/ui/header.tsx
apps/web/src/components/**/*.{tsx,ts}

📄 CodeRabbit inference engine (apps/web/.cursor/rules/frontend_rules.mdc)

apps/web/src/components/**/*.{tsx,ts}: Use proper TypeScript types and avoid using any type
Use descriptive prop names and define prop types using TypeScript interfaces or types
Name components using PascalCase (e.g., UserProfile.tsx)

Files:

  • apps/web/src/components/dashboard/Sidebar.tsx
  • apps/web/src/components/ui/header.tsx
🧠 Learnings (3)
📚 Learning: 2025-11-25T07:35:19.071Z
Learnt from: CR
Repo: apsinghdev/opensox PR: 0
File: apps/web/.cursor/rules/frontend_rules.mdc:0-0
Timestamp: 2025-11-25T07:35:19.071Z
Learning: Applies to apps/web/src/components/**/*.{tsx,ts,jsx,js} : Maintain proper heading hierarchy in page components

Applied to files:

  • apps/web/src/app/(main)/(landing)/pricing/page.tsx
  • apps/web/src/components/ui/header.tsx
📚 Learning: 2025-11-25T07:34:30.473Z
Learnt from: CR
Repo: apsinghdev/opensox PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T07:34:30.473Z
Learning: Applies to **/*.{tsx,ts} : Maintain proper heading hierarchy

Applied to files:

  • apps/web/src/app/(main)/(landing)/pricing/page.tsx
  • apps/web/src/components/ui/header.tsx
📚 Learning: 2025-11-25T07:35:19.071Z
Learnt from: CR
Repo: apsinghdev/opensox PR: 0
File: apps/web/.cursor/rules/frontend_rules.mdc:0-0
Timestamp: 2025-11-25T07:35:19.071Z
Learning: Applies to apps/web/src/components/**/*.{tsx,ts,jsx,js} : Use available custom animations: animate-accordion-down, animate-accordion-up, animate-scrollRight, animate-scrollLeft, animate-customspin, animate-spin-slow, animate-spin-slow-reverse, animate-marquee, animate-marquee-vertical, animate-shine

Applied to files:

  • apps/web/src/components/dashboard/Sidebar.tsx
🧬 Code graph analysis (1)
apps/web/src/components/dashboard/Sidebar.tsx (1)
apps/web/src/components/ui/IconWrapper.tsx (1)
  • IconWrapper (10-22)
🔇 Additional comments (3)
apps/web/src/app/(main)/(landing)/pricing/page.tsx (1)

115-115: header homeLink usage aligns with updated api

passing homeLink="/dashboard/home" here is consistent with the new Header props and existing dashboard routing; no issues spotted.

apps/web/src/components/dashboard/Sidebar.tsx (2)

24-37: route config and badge typing look good

making badge optional on RouteConfig and using it only where needed in PREMIUM_ROUTES is type-safe and matches current usage; the new AcademicCapIcon in FREE_ROUTES is wired correctly.

Also applies to: 62-75


158-176: isSidebarExpanded wiring and collapsible sections look solid

using isSidebarExpanded = !isCollapsed || isHovered consistently to drive:

  • showing/hiding the desktop logo and collapse chevrons
  • showing labels/badges for free and premium routes
  • conditionally rendering dividers
  • passing collapsed={!isSidebarExpanded} to SidebarItem
  • passing isCollapsed={!isSidebarExpanded} into ProfileMenu and rotating its chevron

results in a coherent experience where the sidebar fully behaves as “expanded” while hovered even if the stored state is collapsed, and all dependent sections respond correctly.

Also applies to: 178-180, 202-203, 225-233, 421-425, 432-433, 437-438, 486-488

Comment on lines +84 to +86
// 🟣 New state for hover expand
const [isHovered, setIsHovered] = useState(false);

Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

tighten hover expand logic to avoid flicker and align comments with guidelines

the new hover-based expand logic is a nice ux improvement, but the current setTimeout on mouse leave can cause the sidebar to collapse even when the pointer has re-entered (the earlier timeout still fires and flips isHovered back to false). the emoji/capitalized comments also violate the “lowercase, why-not-what” comment guideline.

-  // 🟣 New state for hover expand
-  const [isHovered, setIsHovered] = useState(false);
+  // hover expand state
+  const [isHovered, setIsHovered] = useState(false);
+  const hoverTimeoutRef = React.useRef<number | null>(null);
@@
-  // 🟣 Hover handlers
-  const handleMouseEnter = () => {
-    if (isCollapsed) setIsHovered(true);
-  };
-
-  const handleMouseLeave = () => {
-    if (isHovered) setTimeout(() => setIsHovered(false), 150);
-  };
+  // hover handlers
+  const handleMouseEnter = () => {
+    if (hoverTimeoutRef.current !== null) {
+      window.clearTimeout(hoverTimeoutRef.current);
+      hoverTimeoutRef.current = null;
+    }
+    if (isCollapsed) {
+      setIsHovered(true);
+    }
+  };
+
+  const handleMouseLeave = () => {
+    if (isCollapsed && isHovered) {
+      hoverTimeoutRef.current = window.setTimeout(() => {
+        setIsHovered(false);
+        hoverTimeoutRef.current = null;
+      }, 150);
+    }
+  };

this keeps the small delay but prevents stale timeouts from collapsing the sidebar while hovered, and brings the new comments in line with the lowercase/comment-style guidelines. as per coding guidelines, comments should be minimal, lowercase, and explain intent rather than restating behavior.

Also applies to: 111-119, 120-123, 130-137

🤖 Prompt for AI Agents
In apps/web/src/components/dashboard/Sidebar.tsx around lines 84-86 (also apply
to 111-119, 120-123, 130-137): the hover-expand logic currently uses a
setTimeout on mouse leave that can fire after the pointer has re-entered,
causing flicker; replace this by storing the timeout id in a ref,
clearTimeout(ref.current) on mouse enter (and before creating a new timeout),
assign the id to ref.current when scheduling the collapse on mouse leave, and
clear it on unmount so stale timers cannot flip isHovered back to false; also
update the inline comments to be lowercase and minimal intent-focused (no
emoji/capitalized restatements).

 &  added 'use client' directive to Header for framer-motion compatibility
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 (4)
apps/web/src/components/ui/header.tsx (4)

3-8: Reorder imports to follow the project convention.

The imports should be organized as React → third-party → local components → utils → types. Currently React is listed after framer-motion.

Apply this diff to reorder the imports:

-import { motion } from 'framer-motion'
 import React from 'react'
+import { motion } from 'framer-motion'
+import Link from 'next/link'
+import { Home } from 'lucide-react'
 import { FlickeringGrid } from './flickering-grid'
 import { colors } from '@/lib/design-tokens'
-import Link from 'next/link'
-import { Home } from 'lucide-react'

As per coding guidelines, imports should follow a consistent order.


10-10: Define a proper TypeScript interface for component props.

Consider extracting the inline prop types into a separate interface for better maintainability and adherence to the project's TypeScript conventions.

Apply this diff:

+interface HeaderProps {
+    title: string
+    homeLink?: string
+}
+
-const Header = ({ title, homeLink }: { title: string; homeLink?: string }) => {
+const Header = ({ title, homeLink }: HeaderProps) => {

As per coding guidelines, prop types should be defined using TypeScript interfaces or types.


12-12: Consider using standard Tailwind spacing values.

The horizontal padding uses px-[30px] (1.875rem), which is a custom value outside the standard Tailwind spacing scale. Consider using px-8 (2rem) or px-7 (1.75rem) for better consistency with the design system.

As per coding guidelines, components should follow Tailwind's spacing scale in 0.25rem increments.


14-22: Verify color tokens and adjust animation duration.

The home link correctly includes an aria-label (addressing the previous review comment), but there are two styling concerns:

  1. The transition uses duration-200, which is not one of the approved durations (fast: duration-100, normal: duration-300, slow: duration-600).
  2. The opacity-based white colors (white/10, white/20, white/70) may not align with the design token system. Consider using semantic color tokens from @/lib/design-tokens.

Apply this diff to use the standard duration:

-                    className="absolute left-2 top-4 lg:left-8 lg:top-8 z-40 p-1.5 lg:p-2 bg-white/10 hover:bg-white/20 backdrop-blur-md border border-white/10 rounded-full transition-all duration-200 group"
+                    className="absolute left-2 top-4 lg:left-8 lg:top-8 z-40 p-1.5 lg:p-2 bg-white/10 hover:bg-white/20 backdrop-blur-md border border-white/10 rounded-full transition-all duration-300 group"

Run the following script to check available semantic colors in the design system:

#!/bin/bash
# check design token colors to verify if semantic alternatives exist for white/opacity values
cat apps/web/src/lib/design-tokens.ts

As per coding guidelines, components should use approved animation durations and reference colors from the design token system.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 94b02ed and b27b207.

📒 Files selected for processing (1)
  • apps/web/src/components/ui/header.tsx (2 hunks)
🧰 Additional context used
📓 Path-based instructions (10)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx,js,jsx}: Always use lowercase when writing comments
Avoid unnecessary comments; code should be self-documenting when possible
Use comments to explain 'why', not 'what'
Remove unused imports
Use UPPER_SNAKE_CASE for constants
Use camelCase for functions and variables

Files:

  • apps/web/src/components/ui/header.tsx
apps/web/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

apps/web/src/**/*.{ts,tsx}: Always follow the design system defined in apps/web/src/lib/design-tokens.ts and apps/web/tailwind.config.ts
NEVER use hardcoded hex values (e.g., #5519f7) directly in components; ALWAYS reference colors from the design token system using Tailwind classes
Use semantic color names that describe purpose, not appearance
Use font-sans for standard UI text (Geist Sans) and font-mono for code, technical content, or monospace needs (DM Mono)
Follow Tailwind's spacing scale (0.25rem increments); for section padding use mobile p-4 (1rem) and desktop p-[60px]
Use appropriate border radius: small elements rounded-lg, medium rounded-xl, large rounded-2xl, buttons rounded-[16px]
Use animation durations: fast duration-100 (0.1s), normal duration-300 (0.3s), slow duration-600 (0.6s)

Files:

  • apps/web/src/components/ui/header.tsx
**/*.{tsx,ts}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{tsx,ts}: Prefer functional components with TypeScript and use proper TypeScript types, avoid any
Extract reusable logic into custom hooks
Use descriptive prop names and define prop types using TypeScript interfaces or types
Prefer controlled components over uncontrolled
Use zustand for global state (located in src/store/)
Use absolute imports from @/ prefix when available
Include proper aria labels for accessibility
Ensure keyboard navigation works
Maintain proper heading hierarchy
Provide alt text for images
Avoid unnecessary re-renders

Files:

  • apps/web/src/components/ui/header.tsx
**/*.{tsx,ts,jsx,js}

📄 CodeRabbit inference engine (.cursorrules)

Organize imports: react → third-party → local components → utils → types

Files:

  • apps/web/src/components/ui/header.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx}: Use PascalCase for types and interfaces with descriptive names
Use dynamic imports for code splitting when appropriate
Memoize expensive computations

Files:

  • apps/web/src/components/ui/header.tsx
apps/web/src/**/*.{tsx,ts}

📄 CodeRabbit inference engine (.cursorrules)

Optimize images using next/image

apps/web/src/**/*.{tsx,ts}: Use Zustand for global state, located in src/store/
Use PascalCase for types and interfaces with descriptive names
Use dynamic imports for code splitting when appropriate
Optimize images using next/image
Memoize expensive computations
Define a type when defining const functions

Files:

  • apps/web/src/components/ui/header.tsx
**/*.{js,jsx,ts,tsx,py,java,go,rb,php}

📄 CodeRabbit inference engine (.cursor/rules/general_rules.mdc)

**/*.{js,jsx,ts,tsx,py,java,go,rb,php}: Always use lowercase when writing comments
Avoid unnecessary comments; code should be self-documenting when possible
Use comments to explain 'why', not 'what'

Files:

  • apps/web/src/components/ui/header.tsx
apps/web/src/components/**/*.{tsx,ts,jsx,js}

📄 CodeRabbit inference engine (apps/web/.cursor/rules/frontend_rules.mdc)

apps/web/src/components/**/*.{tsx,ts,jsx,js}: Never use hardcoded hex values directly in components; always reference colors from the design token system using Tailwind classes
Use semantic color names from the design token system that describe purpose, not appearance (e.g., bg-brand-purple, bg-surface-primary, text-text-primary)
Use font-sans for standard UI text (Geist Sans) and font-mono for code, technical content, or monospace needs (DM Mono)
Follow Tailwind's spacing scale for section padding: p-4 (1rem) on mobile, p-[60px] on desktop
Use rounded-lg (0.5rem) for small elements, rounded-xl (1rem) for medium elements, rounded-2xl (1.5rem) for large elements, and rounded-[16px] for buttons
Use duration-100 (0.1s) for fast transitions, duration-300 (0.3s) for normal transitions, and duration-600 (0.6s) for slow transitions
Use available custom animations: animate-accordion-down, animate-accordion-up, animate-scrollRight, animate-scrollLeft, animate-customspin, animate-spin-slow, animate-spin-slow-reverse, animate-marquee, animate-marquee-vertical, animate-shine
Prefer functional components with TypeScript
Extract reusable logic into custom hooks
Prefer controlled components over uncontrolled
Include proper aria labels for accessibility
Ensure keyboard navigation works in interactive components
Maintain proper heading hierarchy in page components
Provide alt text for images
Use 'class:' instead of the ternary operator in class tags whenever possible
Implement accessibility features on interactive elements (e.g., tabindex='0', aria-label, onClick, onKeyDown)
Always follow the design system defined in apps/web/src/lib/design-tokens.ts and apps/web/tailwind.config.ts

Files:

  • apps/web/src/components/ui/header.tsx
apps/web/src/components/**/*.{tsx,ts}

📄 CodeRabbit inference engine (apps/web/.cursor/rules/frontend_rules.mdc)

apps/web/src/components/**/*.{tsx,ts}: Use proper TypeScript types and avoid using any type
Use descriptive prop names and define prop types using TypeScript interfaces or types
Name components using PascalCase (e.g., UserProfile.tsx)

Files:

  • apps/web/src/components/ui/header.tsx
apps/web/src/**/*.{tsx,ts,jsx,js}

📄 CodeRabbit inference engine (apps/web/.cursor/rules/frontend_rules.mdc)

apps/web/src/**/*.{tsx,ts,jsx,js}: Organize imports in order: React → third-party → local components → utils → types
Use absolute imports from @/ prefix when available
Remove unused imports
Use UPPER_SNAKE_CASE for constants
Use camelCase for functions and variables
Always use Tailwind classes for styling HTML elements; avoid using CSS or style tags
Use descriptive variable and function names; name event functions with a 'handle' prefix (e.g., handleClick, handleKeyDown)
Use const with arrow functions instead of function declarations (e.g., 'const toggle = () =>')

Files:

  • apps/web/src/components/ui/header.tsx
🧠 Learnings (5)
📚 Learning: 2025-11-25T07:35:19.071Z
Learnt from: CR
Repo: apsinghdev/opensox PR: 0
File: apps/web/.cursor/rules/frontend_rules.mdc:0-0
Timestamp: 2025-11-25T07:35:19.071Z
Learning: Applies to apps/web/src/components/**/*.{tsx,ts,jsx,js} : Maintain proper heading hierarchy in page components

Applied to files:

  • apps/web/src/components/ui/header.tsx
📚 Learning: 2025-11-25T07:35:19.071Z
Learnt from: CR
Repo: apsinghdev/opensox PR: 0
File: apps/web/.cursor/rules/frontend_rules.mdc:0-0
Timestamp: 2025-11-25T07:35:19.071Z
Learning: Applies to apps/web/src/components/**/*.{tsx,ts,jsx,js} : Include proper aria labels for accessibility

Applied to files:

  • apps/web/src/components/ui/header.tsx
📚 Learning: 2025-11-25T07:34:30.473Z
Learnt from: CR
Repo: apsinghdev/opensox PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T07:34:30.473Z
Learning: Applies to **/*.{tsx,ts} : Maintain proper heading hierarchy

Applied to files:

  • apps/web/src/components/ui/header.tsx
📚 Learning: 2025-11-25T07:34:30.473Z
Learnt from: CR
Repo: apsinghdev/opensox PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T07:34:30.473Z
Learning: Applies to **/*.{tsx,ts} : Include proper aria labels for accessibility

Applied to files:

  • apps/web/src/components/ui/header.tsx
📚 Learning: 2025-11-25T07:35:19.071Z
Learnt from: CR
Repo: apsinghdev/opensox PR: 0
File: apps/web/.cursor/rules/frontend_rules.mdc:0-0
Timestamp: 2025-11-25T07:35:19.071Z
Learning: Applies to apps/web/src/components/**/*.{tsx,ts,jsx,js} : Implement accessibility features on interactive elements (e.g., tabindex='0', aria-label, onClick, onKeyDown)

Applied to files:

  • apps/web/src/components/ui/header.tsx

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