Skip to content

Conversation

@ssscharan149
Copy link
Contributor

@ssscharan149 ssscharan149 commented Oct 21, 2025

New users can directly navigate to the FAQ section, can see the frequently asked questions.
In other words, updated navigation bar with FAQ, making it look more complete that is, provides navigation across the whole landing page.

Changes done in 2 files.
apps/web/src/components/faq/FaqSection.tsx
apps/web/src/components/landing-sections/navbar.tsx

Recording.2025-10-22.162252.mp4

Summary by CodeRabbit

  • New Features

    • Responsive mobile navigation with toggle button, animated dropdown, and improved mobile layout.
    • FAQ added to navigation for quicker access.
    • Mobile menu closes when selecting items; includes Contribute and Get Started actions.
  • Chores

    • Added an FAQ anchor (id="faq") to enable direct linking.

@vercel
Copy link

vercel bot commented Oct 21, 2025

@ssscharan149 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.

@cla-assistant
Copy link

cla-assistant bot commented Oct 21, 2025

CLA assistant check
All committers have signed the CLA.

@apsinghdev
Copy link
Owner

@ssscharan149 hey, is it mobile responsive?

@ssscharan149
Copy link
Contributor Author

ssscharan149 commented Oct 22, 2025

No sir.
It was just my first contribution to open source so started small (by watching your content on yt), if you want me to implement it, I will give it a try.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 22, 2025

Walkthrough

Added id="faq" to the FAQ section and implemented a mobile-responsive navbar: imported Menu/X icons, added isOpen state with Escape-key handling, a mobile toggle button, and a motion-animated mobile dropdown containing nav links, Contribute, and Get Started actions.

Changes

Cohort / File(s) Summary
Mobile Navigation Enhancement
apps/web/src/components/landing-sections/navbar.tsx
Imported Menu and X icons; added isOpen state and Escape-key handling; added mobile toggle button (hidden on md+); conditionally renders a motion-animated mobile menu with nav links (including FAQ), Contribute link, and Get Started button; menu closes when items are clicked or on Escape; desktop nav unchanged.
FAQ Section Identifier
apps/web/src/components/faq/FaqSection.tsx
Added id="faq" to the root <div> to enable anchor linking.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Btn as Menu Button
    participant State as React State (isOpen)
    participant Nav as Navbar UI
    participant Doc as Document (Escape)

    User->>Btn: click
    Btn->>State: toggle isOpen
    State->>Nav: re-render
    alt isOpen == true
        Nav-->>User: show mobile menu (X icon) with nav items
    else isOpen == false
        Nav-->>User: hide mobile menu (Menu icon)
    end

    User->>Nav: click nav item (e.g., FAQ / Get Started / Contribute)
    Nav->>State: set isOpen = false
    State->>Nav: re-render (menu closes)

    Doc->>State: Escape key pressed
    State->>Nav: set isOpen = false & blur active element
    Nav-->>User: menu closed
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I tapped the bar and watched it spring,
Icons swapped, the mobile menu sings,
A tiny #faq carrot waits,
Links hop out through open gates,
Code nibbled, hopped — the nav now swings.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "add FAQ section to nav bar" accurately reflects the primary objective of the changeset, which is to add a FAQ navigation entry to the landing page navbar as stated in the PR description. The title is concise, clear, and directly describes the main feature addition. While the implementation also includes mobile responsiveness enhancements (mobile menu toggle, Escape key handling, etc.), these are implementation details supporting the core objective rather than separate features. The title does not use vague terms and accurately represents the changes present in the repository.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

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 (3)
apps/web/src/components/faq/FaqSection.tsx (1)

12-12: Remove spaces around the equals sign in JSX attribute.

The id attribute has spaces around the = operator, which is not idiomatic in JSX. While it works functionally, it's inconsistent with standard JSX formatting.

Apply this diff to fix the formatting:

-    <div className="flex flex-col border-b border-[#252525]" id = "faq">
+    <div className="flex flex-col border-b border-[#252525]" id="faq">
apps/web/src/components/landing-sections/navbar.tsx (2)

16-16: Add space after comma for consistency.

The state declaration is missing a space after the comma, which is inconsistent with standard JavaScript formatting conventions.

Apply this diff:

-  const [isOpen,setIsOpen] = useState(false);
+  const [isOpen, setIsOpen] = useState(false);

46-50: Consider removing the unnecessary wrapper div.

The button is wrapped in a <div> that serves no styling or layout purpose. You can simplify by removing it.

Apply this diff:

-      <div>
-        <button className="md:hidden text-white" onClick={()=> setIsOpen(!isOpen)}>
+      <button className="md:hidden text-white" onClick={() => setIsOpen(!isOpen)}>
-          {isOpen ? <X size={28}/> : <Menu size={28}/>}
-        </button>
-      </div>
+        {isOpen ? <X size={28} /> : <Menu size={28} />}
+      </button>

Note: Also adds spaces before /> for consistency with JSX formatting conventions.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a10539e and 9f62bd0.

📒 Files selected for processing (2)
  • apps/web/src/components/faq/FaqSection.tsx (1 hunks)
  • apps/web/src/components/landing-sections/navbar.tsx (6 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
apps/web/src/components/landing-sections/navbar.tsx (1)
apps/web/src/components/icons/icons.tsx (2)
  • Github (195-197)
  • Terminal (1-5)
🔇 Additional comments (2)
apps/web/src/components/landing-sections/navbar.tsx (2)

6-6: LGTM!

The additional icon imports (Menu and X) are correctly added for the mobile menu toggle functionality.


79-79: LGTM!

Correctly hides the desktop navigation buttons on mobile, as they are now included in the mobile menu.

Comment on lines 97 to 129
{isOpen && (
<motion.div
initial={{opacity:0,y:-10}}
animate={{opacity:1,y:0}}
transition={{duration:0.25}}
className="absolute top-full left-0 w-full bg-neutral-900/90 backdrop-blur-xl border-t border-white/10 md:hidden flex flex-col items-center py-5 space-y-4 z-50"
>
{links.map((link,index)=>(
<Link key={index} href={link.href} onClick={()=>setIsOpen(false)} className="text-white hover:text-gray-300 text-lg">{link.name}
</Link>

))}

<Link
href="https://github.com/apsinghdev/opensox"
target="_blank"
rel="noopener noreferrer"
onClick={()=>setIsOpen(false)}
className="flex items-center gap-2 px-4 py-2 bg-[0#d1117] hover:bg-[#161b22] rounded-lg border border-[#30363d] text-white transition-colors"
>
<Github className="w-5 h-5" />
<span className="text-sm font-medium">Contribute</span>
</Link>

<Link href="/dashboard/home" onClick={()=> setIsOpen(false)} className="cursor-pointer z-30">
<PrimaryButtom>
<Terminal />
Get Started
</PrimaryButtom>
</Link>


</motion.div>)}
Copy link
Contributor

@coderabbitai coderabbitai bot Oct 22, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Critical: Fix typo in background color class.

Line 115 has a typo in the Tailwind class: bg-[0#d1117] should be bg-[#0d1117]. The current value is invalid and won't apply the intended background color.

Apply this diff:

-          className="flex items-center gap-2 px-4 py-2 bg-[0#d1117] hover:bg-[#161b22] rounded-lg border border-[#30363d] text-white transition-colors"
+          className="flex items-center gap-2 px-4 py-2 bg-[#0d1117] hover:bg-[#161b22] rounded-lg border border-[#30363d] text-white transition-colors"
📝 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
{isOpen && (
<motion.div
initial={{opacity:0,y:-10}}
animate={{opacity:1,y:0}}
transition={{duration:0.25}}
className="absolute top-full left-0 w-full bg-neutral-900/90 backdrop-blur-xl border-t border-white/10 md:hidden flex flex-col items-center py-5 space-y-4 z-50"
>
{links.map((link,index)=>(
<Link key={index} href={link.href} onClick={()=>setIsOpen(false)} className="text-white hover:text-gray-300 text-lg">{link.name}
</Link>
))}
<Link
href="https://github.com/apsinghdev/opensox"
target="_blank"
rel="noopener noreferrer"
onClick={()=>setIsOpen(false)}
className="flex items-center gap-2 px-4 py-2 bg-[0#d1117] hover:bg-[#161b22] rounded-lg border border-[#30363d] text-white transition-colors"
>
<Github className="w-5 h-5" />
<span className="text-sm font-medium">Contribute</span>
</Link>
<Link href="/dashboard/home" onClick={()=> setIsOpen(false)} className="cursor-pointer z-30">
<PrimaryButtom>
<Terminal />
Get Started
</PrimaryButtom>
</Link>
</motion.div>)}
{isOpen && (
<motion.div
initial={{opacity:0,y:-10}}
animate={{opacity:1,y:0}}
transition={{duration:0.25}}
className="absolute top-full left-0 w-full bg-neutral-900/90 backdrop-blur-xl border-t border-white/10 md:hidden flex flex-col items-center py-5 space-y-4 z-50"
>
{links.map((link,index)=>(
<Link key={index} href={link.href} onClick={()=>setIsOpen(false)} className="text-white hover:text-gray-300 text-lg">{link.name}
</Link>
))}
<Link
href="https://github.com/apsinghdev/opensox"
target="_blank"
rel="noopener noreferrer"
onClick={()=>setIsOpen(false)}
className="flex items-center gap-2 px-4 py-2 bg-[#0d1117] hover:bg-[#161b22] rounded-lg border border-[#30363d] text-white transition-colors"
>
<Github className="w-5 h-5" />
<span className="text-sm font-medium">Contribute</span>
</Link>
<Link href="/dashboard/home" onClick={()=> setIsOpen(false)} className="cursor-pointer z-30">
<PrimaryButtom>
<Terminal />
Get Started
</PrimaryButtom>
</Link>
</motion.div>)}
🤖 Prompt for AI Agents
In apps/web/src/components/landing-sections/navbar.tsx around lines 97 to 129,
there is a typo in the Tailwind background class on line ~115: replace the
invalid class `bg-[0#d1117]` with the correct `bg-[#0d1117]` so the intended
background color is applied; update the className string accordingly and run a
quick dev build to verify Tailwind recognizes the corrected utility.

✅ Addressed in commit b134511

@ssscharan149
Copy link
Contributor Author

Added mobile responsiveness to the navbar. Also fixed a small typo mistake with a new commit .

nav-mobile-responsive.mp4
new-nav.mp4

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (4)
apps/web/src/components/landing-sections/navbar.tsx (4)

6-6: Polish the import statement spacing.

The import has inconsistent spacing around commas: missing space after Github, and extra space in ,Menu ,.

Apply this diff:

-import { Terminal, Github,Menu ,X } from "lucide-react";
+import { Terminal, Github, Menu, X } from "lucide-react";

31-31: Add space before closing brace for consistency.

The FAQ link is missing a space before the closing brace, making it inconsistent with the other link objects in the array.

Apply this diff:

-    { name: "FAQ", href: "/#faq"}
+    { name: "FAQ", href: "/#faq" }

96-123: Consider adding Escape key support to close the mobile menu.

The mobile menu currently only closes via the toggle button or clicking a link. Adding Escape key support would improve the user experience and align with common accessibility patterns.

Add this effect after the isOpen state declaration:

React.useEffect(() => {
  const handleEscape = (e: KeyboardEvent) => {
    if (e.key === 'Escape' && isOpen) {
      setIsOpen(false);
    }
  };
  
  document.addEventListener('keydown', handleEscape);
  return () => document.removeEventListener('keydown', handleEscape);
}, [isOpen]);

97-117: Refine spacing in object literals and arrow functions.

There are several formatting inconsistencies with missing spaces in object literals and arrow functions throughout the mobile menu code.

Apply this diff to improve consistency:

         <motion.div 
-        initial={{opacity:0,y:-10}} 
-        animate={{opacity:1,y:0}}
-        transition={{duration:0.25}}
+        initial={{ opacity: 0, y: -10 }} 
+        animate={{ opacity: 1, y: 0 }}
+        transition={{ duration: 0.25 }}
         className="absolute top-full left-0 w-full bg-neutral-900/90 backdrop-blur-xl border-t border-white/10 md:hidden flex flex-col items-center py-5 space-y-4 z-50"
         >
-          {links.map((link,index)=>(
-            <Link key={index} href={link.href} onClick={()=>setIsOpen(false)} className="text-white hover:text-gray-300 text-lg">{link.name}
+          {links.map((link, index) => (
+            <Link key={index} href={link.href} onClick={() => setIsOpen(false)} className="text-white hover:text-gray-300 text-lg">{link.name}
             </Link>
           ))}
           <Link
           href="https://github.com/apsinghdev/opensox"
           target="_blank"
           rel="noopener noreferrer"
-          onClick={()=>setIsOpen(false)}
+          onClick={() => setIsOpen(false)}
           className="flex items-center gap-2 px-4 py-2 bg-[#0d1117] hover:bg-[#161b22] rounded-lg border border-[#30363d] text-white transition-colors"
           >
             <Github className="w-5 h-5" />
             <span className="text-sm font-medium">Contribute</span>
           </Link>
-          <Link href="/dashboard/home" onClick={()=> setIsOpen(false)} className="cursor-pointer z-30">
+          <Link href="/dashboard/home" onClick={() => setIsOpen(false)} className="cursor-pointer z-30">
             <PrimaryButtom>
               <Terminal />
               Get Started
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b134511 and 8331ed0.

📒 Files selected for processing (2)
  • apps/web/src/components/faq/FaqSection.tsx (1 hunks)
  • apps/web/src/components/landing-sections/navbar.tsx (6 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/web/src/components/faq/FaqSection.tsx
🧰 Additional context used
🧬 Code graph analysis (1)
apps/web/src/components/landing-sections/navbar.tsx (1)
apps/web/src/components/icons/icons.tsx (2)
  • Github (195-197)
  • Terminal (1-5)
🔇 Additional comments (1)
apps/web/src/components/landing-sections/navbar.tsx (1)

11-123: Great work implementing mobile responsiveness!

The mobile menu implementation is solid and functional. The collapsible navigation with smooth animations using framer-motion works well, and the responsive breakpoints are correctly applied. The FAQ link is now accessible on both desktop and mobile views, achieving the PR objectives.

The main improvement needed is adding accessibility attributes to the toggle button (flagged separately), while the formatting suggestions are optional polish items.

Nice job on your first open-source contribution! 🎉

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/landing-sections/navbar.tsx (4)

18-28: Good accessibility addition, but consider improving focus management.

The Escape key handler correctly closes the mobile menu, which is good for keyboard navigation. However, blurring the active element may leave keyboard users without a clear focus indicator.

Consider moving focus back to the toggle button instead of blurring:

  React.useEffect(() => {
    const handleEscape = (e: KeyboardEvent) => {
      if (e.key === 'Escape' && isOpen) {
        setIsOpen(false);
-       (document.activeElement as HTMLElement)?.blur();
      }
    };

    document.addEventListener('keydown', handleEscape);
    return () => document.removeEventListener('keydown', handleEscape);
  }, [isOpen]);

This way, keyboard users know where they are in the document after closing the menu.


58-65: Consider repositioning the mobile menu toggle to the right.

The accessibility attributes (aria-label and aria-expanded) are correctly implemented. However, the toggle button is positioned on the left side of the navbar, which is unconventional. Most mobile UIs place the menu toggle on the right for better thumb accessibility and user expectations.

Consider reordering the navbar children or using flexbox order utilities:

-      <button 
-        className="md:hidden text-white" 
+      <button 
+        className="md:hidden text-white order-last" 
         onClick={() => setIsOpen(!isOpen)}
         aria-label="Toggle navigation menu"
         aria-expanded={isOpen}
       >

Also consider adding aria-controls to link the button to the menu:

       <button 
         className="md:hidden text-white order-last" 
         onClick={() => setIsOpen(!isOpen)}
         aria-label="Toggle navigation menu"
         aria-expanded={isOpen}
+        aria-controls="mobile-menu"
       >

Then add id="mobile-menu" to the mobile menu container.


111-138: Add exit animation for better UX.

The mobile menu has an entrance animation but no exit animation—it will abruptly disappear when closed. Wrap the menu in AnimatePresence from framer-motion to enable smooth exit transitions.

+import { motion, useScroll, useMotionValueEvent, AnimatePresence } from "framer-motion";
-      {isOpen && (
-        <motion.div 
+      <AnimatePresence>
+        {isOpen && (
+          <motion.div 
-        initial={{ opacity: 0, y: -10 }} 
-        animate={{ opacity: 1, y: 0}}
-        transition={{ duration: 0.25 }}
+            initial={{ opacity: 0, y: -10 }} 
+            animate={{ opacity: 1, y: 0}}
+            exit={{ opacity: 0, y: -10 }}
+            transition={{ duration: 0.25 }}
-        className="absolute top-full left-0 w-full bg-neutral-900/90 backdrop-blur-xl border-t border-white/10 md:hidden flex flex-col items-center py-5 space-y-4 z-50"
-        >
+            className="absolute top-full left-0 w-full bg-neutral-900/90 backdrop-blur-xl border-t border-white/10 md:hidden flex flex-col items-center py-5 space-y-4 z-50"
+          >
-          {links.map((link, index)=>(
+            {links.map((link, index)=>(
-            <Link key={index} href={link.href} onClick={() => setIsOpen(false)} className="text-white hover:text-gray-300 text-lg">{link.name}
-            </Link>
-          ))}
+              <Link key={index} href={link.href} onClick={() => setIsOpen(false)} className="text-white hover:text-gray-300 text-lg">{link.name}
+              </Link>
+            ))}
-          <Link
-          href="https://github.com/apsinghdev/opensox"
-          target="_blank"
-          rel="noopener noreferrer"
-          onClick={() => setIsOpen(false)}
-          className="flex items-center gap-2 px-4 py-2 bg-[#0d1117] hover:bg-[#161b22] rounded-lg border border-[#30363d] text-white transition-colors"
-          >
-            <Github className="w-5 h-5" />
-            <span className="text-sm font-medium">Contribute</span>
-          </Link>
+            <Link
+              href="https://github.com/apsinghdev/opensox"
+              target="_blank"
+              rel="noopener noreferrer"
+              onClick={() => setIsOpen(false)}
+              className="flex items-center gap-2 px-4 py-2 bg-[#0d1117] hover:bg-[#161b22] rounded-lg border border-[#30363d] text-white transition-colors"
+            >
+              <Github className="w-5 h-5" />
+              <span className="text-sm font-medium">Contribute</span>
+            </Link>
-          <Link href="/dashboard/home" onClick={() => setIsOpen(false)} className="cursor-pointer z-30">
-            <PrimaryButtom>
-              <Terminal />
-              Get Started
-            </PrimaryButtom>
-          </Link>
-        </motion.div>)}
+            <Link href="/dashboard/home" onClick={() => setIsOpen(false)} className="cursor-pointer">
+              <PrimaryButtom>
+                <Terminal />
+                Get Started
+              </PrimaryButtom>
+            </Link>
+          </motion.div>
+        )}
+      </AnimatePresence>

Note: The z-30 on the Get Started link is redundant since it's already inside a z-50 container.


111-138: Consider adding click-outside-to-close functionality.

Many users expect to be able to close a mobile menu by tapping outside of it. You can implement this by adding a click handler on a backdrop overlay or by using a ref with a click-outside hook.

Example using a backdrop:

{isOpen && (
  <>
    <div 
      className="fixed inset-0 bg-black/20 z-40 md:hidden" 
      onClick={() => setIsOpen(false)}
      aria-hidden="true"
    />
    <motion.div 
      initial={{ opacity: 0, y: -10 }} 
      animate={{ opacity: 1, y: 0}}
      transition={{ duration: 0.25 }}
      className="absolute top-full left-0 w-full bg-neutral-900/90 backdrop-blur-xl border-t border-white/10 md:hidden flex flex-col items-center py-5 space-y-4 z-50"
    >
      {/* menu content */}
    </motion.div>
  </>
)}

This improves the mobile UX by providing an intuitive way to dismiss the menu.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8331ed0 and 3bc600c.

📒 Files selected for processing (1)
  • apps/web/src/components/landing-sections/navbar.tsx (6 hunks)
🔇 Additional comments (4)
apps/web/src/components/landing-sections/navbar.tsx (4)

6-6: LGTM: Mobile menu icons imported correctly.

The Menu and X icons from lucide-react are appropriate choices for the mobile navigation toggle.


16-16: LGTM: Mobile menu state initialized properly.

The isOpen state correctly manages mobile menu visibility with an appropriate initial value.


43-43: LGTM: FAQ link added correctly.

The FAQ navigation entry is properly formatted and consistent with other links in the array.


94-94: LGTM: Desktop actions correctly hidden on mobile.

The responsive utility properly hides desktop action buttons on mobile, with mobile versions provided in the dropdown menu.

@apsinghdev apsinghdev mentioned this pull request Oct 24, 2025
@apsinghdev
Copy link
Owner

@ssscharan149 you did a good work but you've pushed changes directly to main branch. please create a new branch each time you push any changes to remote repo. ive tranferred your commits to this pr #129

@apsinghdev apsinghdev closed this Oct 24, 2025
@ssscharan149
Copy link
Contributor Author

Sorry sir, I dont know that I pushed it directly, but I have created a feature branch say nav-change in my local repo,
did all commits inside it, merged it with main branch and pushed main branch onto remote repo. But instead of that, do I need to push the nav-change branch without merging it to the main branch? Please clarify

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