Skip to content

fix: resolved the navigation bar for desktop and mobile and also adde…#21

Open
akashmeapen wants to merge 1 commit intoAOSSIE-Org:mainfrom
akashmeapen:fix/hamburger-menu-navigation
Open

fix: resolved the navigation bar for desktop and mobile and also adde…#21
akashmeapen wants to merge 1 commit intoAOSSIE-Org:mainfrom
akashmeapen:fix/hamburger-menu-navigation

Conversation

@akashmeapen
Copy link

@akashmeapen akashmeapen commented Mar 11, 2026

Description

  • This PR adds the items on the navigation bar and ensures access even while scrolling on both desktop and mobile.
  • It adds the hamburger menu for the mobile view.

Related Issue

Closes #19

Screenshots/Recordings:

image image image

Testing

  1. Clone the repo and run npm install and npm run dev
  2. Open http://localhost:5173
  3. Check the navigation bar.
  4. If you are using a mobile, click on the hamburger navigation bar and select accordingly.

Checklist

  • My code follows the project's code style and conventions
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contributing Guidelines

Summary by CodeRabbit

  • New Features
    • Desktop navigation menu now includes direct links to Features, About, and Download sections.
    • Mobile menu redesigned with improved header containing logo and close button for better usability.
    • Navigation menu automatically closes when users select destination links on mobile devices.

@github-actions github-actions bot added bug Something isn't working configuration Configuration file changes frontend Changes to frontend code javascript JavaScript/TypeScript code changes size/M Medium PR (51-200 lines changed) first-time-contributor First PR of an external contributor pending-coderabbit-review labels Mar 11, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 11, 2026

Walkthrough

The Navbar component has been refactored to add missing navigation links on desktop and fix the mobile menu by restructuring its UI with proper header, close functionality, and visible navigation items. Mobile menu now renders as an overlay with PictoPy branding and proper link handlers.

Changes

Cohort / File(s) Summary
Navigation Menu Refactor
src/Pages/Landing page/Navbar.tsx
Added Features, About, and Download hash links to desktop navigation. Restructured mobile menu as an external overlay sibling with header (logo + close button), proper navigation links, and close handlers. Updated positioning, z-index, and styling for mobile panel.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested labels

Typescript Lang

Poem

🐰 Whiskers twitched with glee today,
The mobile menu's here to stay!
Links now dance where once was void,
Navigation—no longer cloyed!
Features, About, Download too—
A navbar reborn, fresh and new!

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is truncated and vague—it uses incomplete phrasing ('also adde…') and doesn't clearly describe the main changes made to the navigation bar. Complete and clarify the PR title to accurately reflect the changes, such as 'fix: resolve hamburger menu and add navigation links to desktop and mobile views'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The pull request successfully addresses all coding requirements from issue #19: rendering navigation links in the mobile hamburger menu, adding navigation items to desktop, and ensuring consistent navigation accessibility.
Out of Scope Changes check ✅ Passed All changes are directly related to resolving the navigation issues specified in #19; no unrelated modifications were introduced.

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

✨ Finishing Touches
🧪 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.

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: 4

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

Inline comments:
In `@src/Pages/Landing` page/Navbar.tsx:
- Around line 148-149: NavLink items pointing to "#features" and "#about" are
no-ops because no matching anchors exist; update either the target anchors or
the links: add corresponding section elements with id="features" and id="about"
in the landing page component (e.g., in pictopy-landing's JSX near the
downloads-section) or change the NavLink to point to real routes/anchors that
exist, and make the same fix for the duplicate NavLink instances around the
221-225 area so both desktop and mobile NavLink sets reference valid ids or
routes; ensure you update the NavLink usage rather than leaving orphan fragment
targets.
- Around line 148-150: The NavLink elements in Navbar.tsx (e.g., the NavLink
instances rendering "Features", "About", "Download" as well as the other
hardcoded labels at the referenced locations) use hardcoded user-visible
strings; externalize these into the i18n/resource layer by adding keys (for
example navbar.features, navbar.about, navbar.download) to your translation
files and replacing the literal strings with translated values via the project
i18n API (e.g., import/use the existing useTranslation or t function) in the
NavLink JSX and the other occurrences (lines around 212 and 221-228), ensuring
the same keys are reused for desktop/mobile variants for consistency.
- Around line 191-232: The mobile panel remains in the DOM when closed so its
links are still focusable; update the container that uses isOpen (the outer div
around the mobile menu) to either unmount when closed (render the panel only
when isOpen is true) or make it inert/hidden when isOpen is false (add
aria-hidden="true" and disable focusability on inner NavLink items by setting
tabIndex=-1 or using an inert attribute/polyfill), and ensure setIsOpen and the
X button behavior still works when remounted.
- Around line 206-211: The close control button in the Navbar JSX (the button
that calls setIsOpen(false)) is missing an explicit type and may default to
"submit"; update that button element to include type="button" to prevent
accidental form submissions if the navbar is ever rendered inside a form and to
follow best practices for accessibility and intent.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 85609926-13be-4802-b1e3-c4f1a236c058

📥 Commits

Reviewing files that changed from the base of the PR and between 1496367 and ccc4f9f.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • src/Pages/Landing page/Navbar.tsx

Comment on lines +148 to +149
<NavLink to="#features" isScrollLink={true}>Features</NavLink>
<NavLink to="#about" isScrollLink={true}>About</NavLink>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

#features and #about still point at missing sections.

These links only work when document.getElementById(...) finds a matching anchor, but the provided landing-page snippet only defines id="downloads-section" in src/Pages/pictopy-landing.tsx:88-92. Right now, Features and About are still no-ops on both desktop and mobile. Add matching section ids or point these items at real routes/anchors instead.

Also applies to: 221-225

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/Pages/Landing` page/Navbar.tsx around lines 148 - 149, NavLink items
pointing to "#features" and "#about" are no-ops because no matching anchors
exist; update either the target anchors or the links: add corresponding section
elements with id="features" and id="about" in the landing page component (e.g.,
in pictopy-landing's JSX near the downloads-section) or change the NavLink to
point to real routes/anchors that exist, and make the same fix for the duplicate
NavLink instances around the 221-225 area so both desktop and mobile NavLink
sets reference valid ids or routes; ensure you update the NavLink usage rather
than leaving orphan fragment targets.

Comment on lines +148 to +150
<NavLink to="#features" isScrollLink={true}>Features</NavLink>
<NavLink to="#about" isScrollLink={true}>About</NavLink>
<NavLink to="#downloads-section" isScrollLink={true}>Download</NavLink>
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Externalize the new navigation labels instead of hardcoding them.

The newly added visible strings here are embedded directly in JSX, which makes the navbar harder to localize and keep consistent across desktop/mobile. Move these labels into the project’s i18n/resource layer and render them from there. As per coding guidelines, "User-visible strings should be externalized to resource files (i18n)".

Also applies to: 212-212, 221-228

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/Pages/Landing` page/Navbar.tsx around lines 148 - 150, The NavLink
elements in Navbar.tsx (e.g., the NavLink instances rendering "Features",
"About", "Download" as well as the other hardcoded labels at the referenced
locations) use hardcoded user-visible strings; externalize these into the
i18n/resource layer by adding keys (for example navbar.features, navbar.about,
navbar.download) to your translation files and replacing the literal strings
with translated values via the project i18n API (e.g., import/use the existing
useTranslation or t function) in the NavLink JSX and the other occurrences
(lines around 212 and 221-228), ensuring the same keys are reused for
desktop/mobile variants for consistency.

Comment on lines +191 to +232
<div
className={`md:hidden fixed inset-0 z-[60]
bg-white dark:bg-black
transform transition-transform duration-300 ease-in-out
${isOpen ? "translate-x-0" : "-translate-x-full"}`}
>
<div className="pt-16 pb-6 px-4 space-y-6">
<div className="space-y-4 flex flex-col items-start">
<NavLink to="/" onClick={() => setIsOpen(false)}>
Home
</NavLink>
<NavLink to="#features" isScrollLink={true} onClick={() => setIsOpen(false)}>
Feature
</NavLink>
<NavLink to="#about" isScrollLink={true} onClick={() => setIsOpen(false)}>
About
</NavLink>
<Button
className="w-full bg-gray-800 dark:bg-black
text-white
hover:bg-green-700 dark:hover:bg-green-800
transition-colors duration-300 mt-4"
onClick={() => setIsOpen(false)}
>
Download
</Button>
</div>
>
<div className="flex justify-between items-center px-4 pt-4">
<Link
to="/"
className="text-2xl font-bold
bg-gradient-to-r from-yellow-500 to-green-500
bg-clip-text text-transparent"
>
PictoPy
</Link>
<button
onClick={() => setIsOpen(false)}
className="text-gray-800 dark:text-gray-300
hover:text-black dark:hover:text-white
transition-colors duration-300"
>
<span className="sr-only">Close menu</span>
<X className="h-6 w-6" />
</button>
</div>
<div className="flex flex-col items-center justify-center h-[calc(100%-60px)] px-4">
<div className="space-y-8 flex flex-col items-center text-center">
<NavLink to="/" onClick={() => setIsOpen(false)}>
Home
</NavLink>
<NavLink to="#features" isScrollLink={true} onClick={() => setIsOpen(false)}>
Features
</NavLink>
<NavLink to="#about" isScrollLink={true} onClick={() => setIsOpen(false)}>
About
</NavLink>
<NavLink to="#downloads-section" isScrollLink={true} onClick={() => setIsOpen(false)}>
Download
</NavLink>
</div>
</div>
</nav>
</div>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Hide or unmount the mobile panel when it is closed.

Moving the menu off-canvas with -translate-x-full does not make its links non-focusable. On small viewports, keyboard users can still tab into invisible controls while isOpen is false. Please unmount the panel when closed, or mark it hidden/inert until it opens.

🧰 Tools
🪛 Biome (2.4.6)

[error] 206-211: Provide an explicit type prop for the button element.

(lint/a11y/useButtonType)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/Pages/Landing` page/Navbar.tsx around lines 191 - 232, The mobile panel
remains in the DOM when closed so its links are still focusable; update the
container that uses isOpen (the outer div around the mobile menu) to either
unmount when closed (render the panel only when isOpen is true) or make it
inert/hidden when isOpen is false (add aria-hidden="true" and disable
focusability on inner NavLink items by setting tabIndex=-1 or using an inert
attribute/polyfill), and ensure setIsOpen and the X button behavior still works
when remounted.

Comment on lines +206 to +211
<button
onClick={() => setIsOpen(false)}
className="text-gray-800 dark:text-gray-300
hover:text-black dark:hover:text-white
transition-colors duration-300"
>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# First, find the file in the repository
find . -name "Navbar.tsx" -type f 2>/dev/null

Repository: AOSSIE-Org/PictoPy-Website

Length of output: 105


🏁 Script executed:

# Check if the file exists and read the specific lines
if [ -f "./src/Pages/Landing page/Navbar.tsx" ]; then
  echo "File found. Reading lines 200-220 for context:"
  sed -n '200,220p' "./src/Pages/Landing page/Navbar.tsx"
else
  echo "Checking alternative path patterns..."
  find . -path "*/Pages/*" -name "Navbar.tsx" 2>/dev/null | head -5
fi

Repository: AOSSIE-Org/PictoPy-Website

Length of output: 950


🏁 Script executed:

# Read more of the Navbar.tsx file to see the full context
wc -l "./src/Pages/Landing page/Navbar.tsx"

Repository: AOSSIE-Org/PictoPy-Website

Length of output: 109


🏁 Script executed:

# Check the beginning of the file to understand the component structure
head -50 "./src/Pages/Landing page/Navbar.tsx"

Repository: AOSSIE-Org/PictoPy-Website

Length of output: 1416


🏁 Script executed:

# Check for Biome configuration files
find . -name "biome.json" -o -name ".biome.json" -o -name "biome.jsonc" 2>/dev/null

Repository: AOSSIE-Org/PictoPy-Website

Length of output: 82


🏁 Script executed:

# Search for form elements in the Navbar file
rg -n "form\|<form" "./src/Pages/Landing page/Navbar.tsx"

Repository: AOSSIE-Org/PictoPy-Website

Length of output: 52


🏁 Script executed:

# Check the Biome configuration
cat ./biome.json

Repository: AOSSIE-Org/PictoPy-Website

Length of output: 1852


🏁 Script executed:

# Also check around lines 206-211 more carefully to see the full button structure
sed -n '205,215p' "./src/Pages/Landing page/Navbar.tsx"

Repository: AOSSIE-Org/PictoPy-Website

Length of output: 448


🏁 Script executed:

# Check Biome documentation or search for references to button type rules
rg -i "useButtonType|buttontype" . --type json --type md 2>/dev/null || echo "No explicit references found"

Repository: AOSSIE-Org/PictoPy-Website

Length of output: 98


🏁 Script executed:

# Verify the exact HTML spec behavior for button elements
# and check if there are any other buttons in the codebase with type attributes
rg -n "<button" "./src/Pages/Landing page/Navbar.tsx" -A 2

Repository: AOSSIE-Org/PictoPy-Website

Length of output: 656


🏁 Script executed:

# Check all buttons in the file to see if any have explicit type attributes
rg -n 'type\s*=\s*["\']button["\']' "./src/Pages/Landing page/Navbar.tsx"

Repository: AOSSIE-Org/PictoPy-Website

Length of output: 138


🏁 Script executed:

# Look for any other button-related type attributes in the codebase
rg -n '<button' . -A 3 --type tsx --type jsx | grep -E 'type\s*=' | head -10

Repository: AOSSIE-Org/PictoPy-Website

Length of output: 97


🏁 Script executed:

# Check all buttons in the file to see if any have explicit type attributes
rg -n 'type="button"' "./src/Pages/Landing page/Navbar.tsx"

Repository: AOSSIE-Org/PictoPy-Website

Length of output: 52


🏁 Script executed:

# Look for buttons with explicit type attributes in the codebase
rg -n 'type="button"' . --type js --type ts 2>/dev/null | head -20

Repository: AOSSIE-Org/PictoPy-Website

Length of output: 52


Add type="button" to the close control.

This button lacks an explicit type attribute and currently relies on the implicit submit default. While this button is not inside a form in the current context, it's a best practice to be explicit about button types to prevent unexpected behavior if the navbar is ever rendered within a form subtree, and to align with accessibility standards.

Suggested fix
           <button
+            type="button"
             onClick={() => setIsOpen(false)}
             className="text-gray-800 dark:text-gray-300 
               hover:text-black dark:hover:text-white 
               transition-colors duration-300"
           >
📝 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
<button
onClick={() => setIsOpen(false)}
className="text-gray-800 dark:text-gray-300
hover:text-black dark:hover:text-white
transition-colors duration-300"
>
<button
type="button"
onClick={() => setIsOpen(false)}
className="text-gray-800 dark:text-gray-300
hover:text-black dark:hover:text-white
transition-colors duration-300"
>
🧰 Tools
🪛 Biome (2.4.6)

[error] 206-211: Provide an explicit type prop for the button element.

(lint/a11y/useButtonType)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/Pages/Landing` page/Navbar.tsx around lines 206 - 211, The close control
button in the Navbar JSX (the button that calls setIsOpen(false)) is missing an
explicit type and may default to "submit"; update that button element to include
type="button" to prevent accidental form submissions if the navbar is ever
rendered inside a form and to follow best practices for accessibility and
intent.

Copy link
Author

@akashmeapen akashmeapen left a comment

Choose a reason for hiding this comment

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

I can add the id's as a later feature for now the code is indeed correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working configuration Configuration file changes first-time-contributor First PR of an external contributor frontend Changes to frontend code javascript JavaScript/TypeScript code changes pending-coderabbit-review size/M Medium PR (51-200 lines changed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Hamburger menu opens but renders no navigation items on mobile and the menu does not exist on the desktop.

1 participant