Skip to content

fix: logo and text now navigate to home/top on click#18

Open
RohitKumar717 wants to merge 6 commits intoAOSSIE-Org:mainfrom
RohitKumar717:fix/logo-navigation-shadow
Open

fix: logo and text now navigate to home/top on click#18
RohitKumar717 wants to merge 6 commits intoAOSSIE-Org:mainfrom
RohitKumar717:fix/logo-navigation-shadow

Conversation

@RohitKumar717
Copy link

@RohitKumar717 RohitKumar717 commented Mar 7, 2026

#Description -

  • Wrapped the PictoPy logo image and text in <Link to="/"> with window.scrollTo({ top: 0, behavior: "smooth" }) so clicking either navigates back to the home/top of the page
  • Added pointer-events-none to the tooltip so it no longer blocks clicks on the PictoPy text link
  • Fixed tooltip position from bottom-12 (above text) to top-full mt-2 (below text) so the shadow appears correctly beneath the icon

#Related issue -
Closes #15

#Recording -

Recording.2026-03-07.211550.mp4

Testing -

  1. Clone the repo and run npm install && npm run dev
  2. Open http://localhost:5173
  3. Scroll down the page
  4. Click the PictoPy logo image → page should smoothly scroll to top ✅
  5. Click the PictoPy text → page should smoothly scroll to top ✅
  6. Hover over the PictoPy logo → tooltip should appear below the text with shadow underneath ✅

Checklist -

  • Code follows style guidelines
  • Self-review completed
  • Tests added/updated

Summary by CodeRabbit

  • New Features

    • Clickable logo scrolls to top; gradient app title with hover tooltip.
    • Desktop nav: Home, Feature, About (scroll targets) and Download button (opens releases).
    • Slide-in mobile menu with overlay; selecting items closes the menu.
  • Refactor

    • Reorganized navbar layout for clearer logo, desktop and mobile sections.
    • Simplified shadow/spacing behavior and scroll handling.
  • Accessibility

    • Added ARIA labels for the mobile menu toggle and improved menu semantics.

@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 7, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 7, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Navbar consolidates the logo into a single clickable Link that scrolls to top, adds desktop links (Home, Features, About) and a Download button, implements a slide-in mobile menu with overlay and explicit isOpen state, adds aria attributes, and adjusts dark-mode and scroll-shadow handling.

Changes

Cohort / File(s) Summary
Navigation Bar Refactor
src/Pages/Landing page/Navbar.tsx
Replaced separate logo block with one clickable Link that scrolls to top; introduced gradient title and tooltip on hover; rebuilt desktop nav to use NavLink and scroll targets; added Download button (opens releases); preserved dark-mode toggle and localStorage handling; simplified shadow logic and updated comments.
Mobile Menu & Accessibility
src/Pages/Landing page/Navbar.tsx
Moved mobile menu outside <nav> to avoid overflow clipping; added slide-in panel, overlay, explicit isOpen state, aria-label on menu button, close-on-select behavior for mobile items, and external-link handling for Download button; added END NAVBAR / END MOBILE MENU markers.

Sequence Diagram(s)

sequenceDiagram
    participant User as User
    participant Nav as Navbar
    participant Menu as MobileMenu
    participant Overlay as Overlay
    participant Router as Router/Scroll

    User->>Nav: Click logo
    Nav->>Router: scrollToTop()/navigate('/')
    Router-->>User: page scrolled

    User->>Nav: Click mobile menu button
    Nav->>Menu: set isOpen = true
    Nav->>Overlay: show overlay
    Menu-->>User: slide-in menu visible

    User->>Menu: Select nav item
    Menu->>Nav: onClick -> set isOpen = false
    Nav->>Overlay: hide overlay
    Nav->>Router: navigate to section or open external link
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

Typescript Lang

Poem

🐇 I tapped the logo, up we hop,
PictoPy gleams — a gradient pop.
Menus slide like tunnels true,
Overlays dim, the links renew.
I nibble code and sing — hooray, view!

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: logo and text now navigate to home/top on click' accurately describes the primary change made in this PR, focusing on the main logo navigation fix.
Linked Issues check ✅ Passed The PR successfully addresses both requirements from issue #15: implements logo navigation to home/top on click and fixes tooltip/shadow positioning below text.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the logo navigation and tooltip positioning issues. Mobile menu improvements and accessibility enhancements support the core objectives without introducing unrelated scope.

✏️ 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: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/Pages/Landing page/Navbar.tsx (1)

178-184: ⚠️ Potential issue | 🟠 Major

This mobile drawer is mounted inside a transformed, overflow-hidden nav.

Because the parent <nav> at Lines 96-102 has -translate-x-1/2 and overflow-hidden, the fixed inset-0 panel at Line 180 can be contained/clipped by the navbar instead of the viewport. That turns the “full-screen” menu into a nav-bounded panel on mobile. Render this drawer outside <nav>, or switch it to an absolute top-full left-0 right-0 dropdown if that is the intended behavior.

🤖 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 178 - 184, The mobile drawer
div that uses fixed inset-0 and isOpen is currently rendered inside the
transformed/overflow-hidden <nav>, which causes the full-screen panel to be
clipped; fix by moving the MOBILE MENU markup (the div using isOpen and classes
`fixed inset-0 ... translate-x-0/-translate-x-full`) out of the <nav> so it
mounts as a sibling (root-level) element so fixed positioning targets the
viewport, or if the intended behavior is a dropdown change the panel to use
`absolute top-full left-0 right-0` positioning (replace fixed inset-0 with
absolute top-full left-0 right-0 and adjust transform/translate classes) and
ensure it is not inside any element with overflow-hidden/transform; update
references to isOpen only (no logic change) and keep existing transition
classes.
🤖 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 144-149: Add an explicit type attribute to the navbar toggle
buttons so they don't default to submit when rendered inside a form: update the
button that calls setDarkMode(!darkMode) (and the other similar toggle button
around lines 156–161) to include type="button". Locate the elements by the
onClick handlers (setDarkMode and the other toggle onClick) and add the
attribute to each <button> element.
- Around line 130-133: The tooltip div inside the Navbar component is anchored
above the label because it uses "bottom-12"; update its positioning to render
below the "PictoPy" label by replacing "bottom-12" with "top-12" (or "top-full"
plus a small margin if you prefer) in the className on that tooltip div so the
tooltip/shadow appears beneath the label; keep the existing "absolute left-1/2
transform -translate-x-1/2" classes intact.
- Around line 165-171: The menu toggle button rendering inside the Navbar uses
only an icon (isOpen state toggled by setIsOpen) and lacks accessibility
attributes; update the button element in the Navbar component to include
type="button" and an appropriate aria-label (e.g., aria-label={isOpen ? "Close
menu" : "Open menu"}) so assistive tech can identify its purpose while
preserving the existing onClick handler and icon rendering (X/Menu).

---

Outside diff comments:
In `@src/Pages/Landing` page/Navbar.tsx:
- Around line 178-184: The mobile drawer div that uses fixed inset-0 and isOpen
is currently rendered inside the transformed/overflow-hidden <nav>, which causes
the full-screen panel to be clipped; fix by moving the MOBILE MENU markup (the
div using isOpen and classes `fixed inset-0 ...
translate-x-0/-translate-x-full`) out of the <nav> so it mounts as a sibling
(root-level) element so fixed positioning targets the viewport, or if the
intended behavior is a dropdown change the panel to use `absolute top-full
left-0 right-0` positioning (replace fixed inset-0 with absolute top-full left-0
right-0 and adjust transform/translate classes) and ensure it is not inside any
element with overflow-hidden/transform; update references to isOpen only (no
logic change) and keep existing transition classes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 09938941-93a2-498c-8a80-6b86dd60c80a

📥 Commits

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

⛔ 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

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/Pages/Landing page/Navbar.tsx (2)

96-102: ⚠️ Potential issue | 🟠 Major

overflow-hidden can still clip the tooltip and its shadow.

The tooltip is now intentionally rendered below the label, but the navbar container still clips overflow. That can cut off the tooltip box or shadow as soon as it extends past the navbar bounds, so the shadow-positioning bug is not fully resolved.

Also applies to: 130-133

🤖 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 96 - 102, The nav element in
the Navbar component is using the utility overflow-hidden which clips tooltips
and shadows; remove or conditionally disable overflow-hidden (or move tooltip
out of the nav stacking context) in the JSX rendering the nav (the element with
className containing "overflow-hidden" in Navbar.tsx) so the tooltip can render
without being clipped; ensure any other occurrences (the second occurrence
around lines 130–133) are updated similarly or that tooltips are portal-mounted
(e.g., render via a Tooltip/Portal component) so shadows and positioned popovers
are not truncated by the navbar container.

209-218: ⚠️ Potential issue | 🟠 Major

This Download button no longer matches its label.

The visible text says Download, but the click handler only closes the drawer, and the aria-label exposes it as a menu toggle. That is both a broken CTA and an accessibility mismatch.

🤖 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 209 - 218, The Button showing
"Download" is inconsistent: it uses aria-label tied to isOpen and onClick={() =>
setIsOpen(false)} which only closes the drawer; decide the intended behavior and
make the label, aria-label, and handler consistent. If the button should perform
a download, replace onClick={() => setIsOpen(false)} with a download handler
(e.g., handleDownload) and update aria-label to "Download [resource]" while
keeping visible text "Download"; if it should close the drawer, change the
visible text to "Close" and set aria-label to "Close navigation menu" (or
similar) while keeping onClick={() => setIsOpen(false)}. Ensure you update the
Button element and any newly referenced function names (handleDownload or
similar) accordingly.
♻️ Duplicate comments (2)
src/Pages/Landing page/Navbar.tsx (2)

166-173: ⚠️ Potential issue | 🟠 Major

Label the icon-only menu toggle and give it an explicit button type.

This button still renders only Menu/X, so assistive tech gets no stable name, and it still defaults to submit in a form subtree.

Suggested fix
               <button
+                type="button"
+                aria-label={isOpen ? "Close navigation menu" : "Open navigation menu"}
                 onClick={() => setIsOpen(!isOpen)}
                 className="text-gray-800 dark:text-gray-300 
                 hover:text-black dark:hover:text-white 
                 transition-colors duration-300"
               >
🤖 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 166 - 173, The menu toggle
button in Navbar.tsx renders only the Menu/X icons and lacks an explicit type,
so update the button (the one using isOpen, setIsOpen and rendering <Menu /> /
<X />) to include type="button" and an accessible label (e.g. aria-label or
aria-expanded) that changes with isOpen (e.g. "Open menu" vs "Close menu") so
assistive tech has a stable name and state.

157-162: ⚠️ Potential issue | 🟡 Minor

Add type="button" to the mobile theme toggle.

This control still defaults to submit if the navbar is ever rendered inside a form subtree.

🤖 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 157 - 162, The mobile theme
toggle button (the JSX button that calls setDarkMode(!darkMode) in Navbar.tsx)
currently has no type and will default to submit inside forms; update that
button element to include type="button" to prevent form submission when toggled
while preserving the existing onClick, className, and behavior.
🤖 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 140-153: The desktop nav currently only renders <NavLink
to="/">Home</NavLink> and the theme toggle (using darkMode/setDarkMode),
dropping the other landing-page links present in the mobile drawer; restore
parity by adding the same navigation items (e.g., "Features"/"Feature", "About",
"Download") to the md+ branch within the div that contains NavLink and the
toggle (or better, extract the link list used by the mobile drawer into a shared
array and map it into the desktop <div>), ensuring the desktop JSX renders the
same NavLink components or equivalent Link elements as the mobile drawer so
desktop users can access those pages.
- Around line 107-138: The tooltip is only triggered when hovering the inner
text wrapper because the "group" class is on the inner div; move the group class
to the outer Link element so the entire clickable logo (the Link that contains
the img and the div) becomes the hover parent; keep the inner tooltip div using
"group-hover:block" (and leave the span with the gradient text unchanged) so
hovering the image or text shows the tooltip as intended.

---

Outside diff comments:
In `@src/Pages/Landing` page/Navbar.tsx:
- Around line 96-102: The nav element in the Navbar component is using the
utility overflow-hidden which clips tooltips and shadows; remove or
conditionally disable overflow-hidden (or move tooltip out of the nav stacking
context) in the JSX rendering the nav (the element with className containing
"overflow-hidden" in Navbar.tsx) so the tooltip can render without being
clipped; ensure any other occurrences (the second occurrence around lines
130–133) are updated similarly or that tooltips are portal-mounted (e.g., render
via a Tooltip/Portal component) so shadows and positioned popovers are not
truncated by the navbar container.
- Around line 209-218: The Button showing "Download" is inconsistent: it uses
aria-label tied to isOpen and onClick={() => setIsOpen(false)} which only closes
the drawer; decide the intended behavior and make the label, aria-label, and
handler consistent. If the button should perform a download, replace onClick={()
=> setIsOpen(false)} with a download handler (e.g., handleDownload) and update
aria-label to "Download [resource]" while keeping visible text "Download"; if it
should close the drawer, change the visible text to "Close" and set aria-label
to "Close navigation menu" (or similar) while keeping onClick={() =>
setIsOpen(false)}. Ensure you update the Button element and any newly referenced
function names (handleDownload or similar) accordingly.

---

Duplicate comments:
In `@src/Pages/Landing` page/Navbar.tsx:
- Around line 166-173: The menu toggle button in Navbar.tsx renders only the
Menu/X icons and lacks an explicit type, so update the button (the one using
isOpen, setIsOpen and rendering <Menu /> / <X />) to include type="button" and
an accessible label (e.g. aria-label or aria-expanded) that changes with isOpen
(e.g. "Open menu" vs "Close menu") so assistive tech has a stable name and
state.
- Around line 157-162: The mobile theme toggle button (the JSX button that calls
setDarkMode(!darkMode) in Navbar.tsx) currently has no type and will default to
submit inside forms; update that button element to include type="button" to
prevent form submission when toggled while preserving the existing onClick,
className, and behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 991964b9-93fd-4f7a-ad9c-0f414612e1ad

📥 Commits

Reviewing files that changed from the base of the PR and between 6641ed2 and 5088a72.

📒 Files selected for processing (1)
  • src/Pages/Landing page/Navbar.tsx

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/Pages/Landing page/Navbar.tsx (1)

195-200: ⚠️ Potential issue | 🟠 Major

Move the mobile drawer outside the transformed navbar or portal it.

The parent <nav> uses left-1/2 -translate-x-1/2 (transform) with overflow-hidden. When a parent element has a transform, it creates a new stacking context and causes children with fixed positioning to be positioned relative to the transformed parent instead of the viewport. The drawer at lines 195-238 is nested inside this nav, so it will be clipped and positioned incorrectly. Either render it as a sibling outside the <nav> element (similar to the overlay at line 242) or portal it to document.body.

🤖 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 195 - 200, The mobile drawer
div that uses fixed positioning is currently nested inside the transformed
<nav>, causing clipping and incorrect positioning; move the drawer div (the
element controlled by isOpen) out of the <nav> as a sibling (like the overlay
element) or render it via a portal to document.body (ReactDOM.createPortal) so
the fixed positioning is relative to the viewport rather than the transformed
parent; update any state/props used by the drawer (isOpen, close handlers) to
ensure behavior remains the same after moving or portaling.
♻️ Duplicate comments (2)
src/Pages/Landing page/Navbar.tsx (2)

169-174: ⚠️ Potential issue | 🟡 Minor

Add type="button" to the mobile dark-mode toggle.

This button still defaults to submit if the navbar is ever rendered inside a form subtree.

Suggested fix
               <button
+                type="button"
                 onClick={() => setDarkMode(!darkMode)}
                 className="text-gray-800 dark:text-gray-300 
                 hover:text-black dark:hover:text-white 
                 transition-colors duration-300"
               >
🤖 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 169 - 174, The mobile
dark-mode toggle button in the Navbar component defaults to type="submit" when
inside a form; update the button element in Navbar.tsx (the button that calls
setDarkMode(!darkMode)) to include type="button" so it no longer submits
enclosing forms—locate the button using the setDarkMode and darkMode identifiers
and add the type attribute.

178-189: ⚠️ Potential issue | 🟠 Major

Label and type the mobile menu toggle.

This is still an icon-only button with no accessible name, and it also defaults to submit.

Suggested fix
               <button
+                type="button"
+                aria-label={isOpen ? "Close navigation menu" : "Open navigation menu"}
                 onClick={() => setIsOpen(!isOpen)}
                 className="text-gray-800 dark:text-gray-300 
                 hover:text-black dark:hover:text-white 
                 transition-colors duration-300"
               >
🤖 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 178 - 189, The mobile menu
toggle button is icon-only and defaults to type="submit", causing accessibility
and form-submission issues; update the button (the element using onClick={() =>
setIsOpen(!isOpen)} and referencing isOpen, X, and Menu) to include
type="button", provide an accessible name (e.g., aria-label or visually-hidden
text that toggles between "Open menu" and "Close menu" based on isOpen), and add
aria-expanded={isOpen} to reflect state for screen readers. Ensure the label
text or aria-label updates when setIsOpen flips so the control is correctly
described in both states.
🤖 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 129-154: The hardcoded user-visible strings in Navbar.tsx (tooltip
"Ready to sort images", NavLink labels "Home", "Feature", "About", Button text
"Download" and any aria strings) must be extracted into the shared i18n resource
files and replaced with translation keys in the component; add keys (e.g.
navbar.tooltip, navbar.home, navbar.feature, navbar.about, navbar.download) to
your i18n JSON/locale files and update the Navbar component to use the project
translation helper (e.g. useTranslation/t) to render those keys for both desktop
and mobile variants (also update the other hardcoded strings referenced around
lines 203-235) so the same localized keys are used consistently across NavLink,
Button and tooltip/aria attributes.
- Around line 148-154: The desktop Download Button in Navbar is missing type and
an action: set type="button" on the Download <Button> (desktop variant) and wire
its onClick to the actual download behavior (or render as an <a> with
href/download) so it doesn't submit forms; the mobile drawer Download button
should either be given a real download handler or have its misleading aria-label
removed/changed to reflect "Download" instead of "Close/Open navigation menu";
also add type="button" and a descriptive aria-label to the icon-only mobile menu
toggle (the icon toggle component) to make it accessible. Fix the drawer
clipping by moving the fixed drawer element out of the transformed navbar
container or remove the transform CSS classes (e.g., -translate-x-1/2 and
overflow-hidden) from the nav so position:fixed is relative to the viewport.
Finally, extract hardcoded UI strings ("PictoPy", "Ready to sort images",
"Home", "Feature", "About", "Download") into i18n resource keys and consume them
via the app's localization utility in Navbar/Drawer components.

---

Outside diff comments:
In `@src/Pages/Landing` page/Navbar.tsx:
- Around line 195-200: The mobile drawer div that uses fixed positioning is
currently nested inside the transformed <nav>, causing clipping and incorrect
positioning; move the drawer div (the element controlled by isOpen) out of the
<nav> as a sibling (like the overlay element) or render it via a portal to
document.body (ReactDOM.createPortal) so the fixed positioning is relative to
the viewport rather than the transformed parent; update any state/props used by
the drawer (isOpen, close handlers) to ensure behavior remains the same after
moving or portaling.

---

Duplicate comments:
In `@src/Pages/Landing` page/Navbar.tsx:
- Around line 169-174: The mobile dark-mode toggle button in the Navbar
component defaults to type="submit" when inside a form; update the button
element in Navbar.tsx (the button that calls setDarkMode(!darkMode)) to include
type="button" so it no longer submits enclosing forms—locate the button using
the setDarkMode and darkMode identifiers and add the type attribute.
- Around line 178-189: The mobile menu toggle button is icon-only and defaults
to type="submit", causing accessibility and form-submission issues; update the
button (the element using onClick={() => setIsOpen(!isOpen)} and referencing
isOpen, X, and Menu) to include type="button", provide an accessible name (e.g.,
aria-label or visually-hidden text that toggles between "Open menu" and "Close
menu" based on isOpen), and add aria-expanded={isOpen} to reflect state for
screen readers. Ensure the label text or aria-label updates when setIsOpen flips
so the control is correctly described in both states.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 7a5517a7-5d36-465d-9134-3b42dc54636c

📥 Commits

Reviewing files that changed from the base of the PR and between 5088a72 and 9804648.

📒 Files selected for processing (1)
  • src/Pages/Landing page/Navbar.tsx

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

♻️ Duplicate comments (3)
src/Pages/Landing page/Navbar.tsx (3)

171-178: ⚠️ Potential issue | 🟡 Minor

Add type="button" to this toggle.

This still defaults to submit inside a form subtree, and Biome is already flagging it on Line 171.

🤖 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 171 - 178, The toggle button
currently uses the onClick handler setDarkMode(!darkMode) but lacks an explicit
type, so inside forms it defaults to "submit"; update the <button> that uses
darkMode and setDarkMode to include type="button" to prevent unintended form
submission and satisfy the Biome warning.

134-155: 🛠️ Refactor suggestion | 🟠 Major

Extract the new navbar copy into i18n resources.

The added tooltip text, nav labels, button copy, and aria strings are hardcoded in JSX, so the desktop and mobile variants cannot be localized consistently.

As per coding guidelines, "Internationalization: User-visible strings should be externalized to resource files (i18n)".

Also applies to: 182-239

🤖 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 134 - 155, The navbar
contains hardcoded user-visible strings (e.g., "Ready to sort images", "Home",
"Feature", "About", "Download" and any aria/tooltip text) inside the Navbar
component and its uses of NavLink and Button; extract all these strings into
your i18n resource files and replace the literals with the appropriate
translation lookups (e.g., t('navbar.home'), t('navbar.download'), etc.) for
both desktop and mobile variants (also update the corresponding mobile block
around lines referenced 182-239) so both variants reference the same keys and
aria labels for consistent localization.

228-239: ⚠️ Potential issue | 🟠 Major

Make the mobile Download CTA do the same thing as desktop.

This button only closes the drawer, and its aria-label still announces the menu toggle instead of the download action. Mobile users lose the releases link entirely here, and assistive tech gets the wrong control name.

💡 Suggested fix
+  const openDownloads = () =>
+    window.open(
+      "https://github.com/AOSSIE-Org/PictoPy/releases",
+      "_blank",
+      "noopener,noreferrer"
+    );
@@
               <Button
                 type="button"
-                aria-label={
-                  isOpen ? "Close navigation menu" : "Open navigation menu"
-                }
+                aria-label="Download PictoPy releases"
                 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)}
+                onClick={() => {
+                  setIsOpen(false);
+                  openDownloads();
+                }}
               >
🤖 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 228 - 239, The mobile
"Download" Button in Navbar.tsx currently only calls setIsOpen(false) and has an
aria-label for toggling the menu; update this Button so it performs the same
action as the desktop Download CTA: call the same handler or navigation used by
the desktop Download button (e.g., the download/navigateToReleases function or
link target used elsewhere), while still closing the drawer (setIsOpen(false))
after initiating the action, and change the aria-label to reflect the actual
action (e.g., "Download releases" or "Open releases page") so assistive tech
announces the correct control name.
🤖 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 142-146: Navbar's NavLink components for the scroll links (NavLink
to="#features" and to="#about") point to IDs that don't exist on the landing
page causing no-ops; either add id="features" and id="about" to the
corresponding section components (e.g., the Features and About section
components in the landing page) or update the NavLink targets to match existing
section IDs used elsewhere, then verify both desktop and mobile menu render the
same anchor targets; locate NavLink usage in Navbar.tsx and the corresponding
section components to make the IDs consistent.
- Around line 148-150: The Button in the Navbar component currently calls
window.open("https://github.com/AOSSIE-Org/PictoPy/releases", "_blank") which
leaves window.opener exposed; update the onClick to harden the external link by
either using an anchor element with target="_blank" and rel="noopener
noreferrer" or, if keeping window.open, add the third argument
"noopener,noreferrer" (and optionally set newWindow.opener = null) in the
onClick handler for the Button to prevent opener access.
- Around line 151-153: Fix the Tailwind utility typos in the Navbar button's
className string: change "transition-colours" to "transition-colors", change
"duration 300" to "duration-300", and replace the invalid
"dark:hover:bg-screen-800" with a valid color token from our Tailwind config
(for example use "dark:hover:bg-primary" or "dark:hover:bg-accent" or add a
proper shade like "-800" only if that shade exists for the chosen token); update
the className where it's defined in Navbar (the className string on the button)
accordingly.

---

Duplicate comments:
In `@src/Pages/Landing` page/Navbar.tsx:
- Around line 171-178: The toggle button currently uses the onClick handler
setDarkMode(!darkMode) but lacks an explicit type, so inside forms it defaults
to "submit"; update the <button> that uses darkMode and setDarkMode to include
type="button" to prevent unintended form submission and satisfy the Biome
warning.
- Around line 134-155: The navbar contains hardcoded user-visible strings (e.g.,
"Ready to sort images", "Home", "Feature", "About", "Download" and any
aria/tooltip text) inside the Navbar component and its uses of NavLink and
Button; extract all these strings into your i18n resource files and replace the
literals with the appropriate translation lookups (e.g., t('navbar.home'),
t('navbar.download'), etc.) for both desktop and mobile variants (also update
the corresponding mobile block around lines referenced 182-239) so both variants
reference the same keys and aria labels for consistent localization.
- Around line 228-239: The mobile "Download" Button in Navbar.tsx currently only
calls setIsOpen(false) and has an aria-label for toggling the menu; update this
Button so it performs the same action as the desktop Download CTA: call the same
handler or navigation used by the desktop Download button (e.g., the
download/navigateToReleases function or link target used elsewhere), while still
closing the drawer (setIsOpen(false)) after initiating the action, and change
the aria-label to reflect the actual action (e.g., "Download releases" or "Open
releases page") so assistive tech announces the correct control name.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 59a38687-18db-40f5-ad09-446c0e66548f

📥 Commits

Reviewing files that changed from the base of the PR and between 9804648 and 6d5d21a.

📒 Files selected for processing (1)
  • src/Pages/Landing page/Navbar.tsx

Comment on lines +148 to +150
<Button
type="button"
onClick={() => window.open("https://github.com/AOSSIE-Org/PictoPy/releases", "_blank")}
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

Harden the external window.open call.

Opening a third-party page with "_blank" leaves window.opener available to the new tab. Pass noopener,noreferrer here, or render this as an <a target="_blank" rel="noopener noreferrer">.

🔒 Suggested fix
               <Button
                type="button"
-               onClick={() => window.open("https://github.com/AOSSIE-Org/PictoPy/releases", "_blank")}
+               onClick={() =>
+                 window.open(
+                   "https://github.com/AOSSIE-Org/PictoPy/releases",
+                   "_blank",
+                   "noopener,noreferrer"
+                 )
+               }
                className="bg-gray-800 dark:bg-black text-white
🤖 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 Button in the
Navbar component currently calls
window.open("https://github.com/AOSSIE-Org/PictoPy/releases", "_blank") which
leaves window.opener exposed; update the onClick to harden the external link by
either using an anchor element with target="_blank" and rel="noopener
noreferrer" or, if keeping window.open, add the third argument
"noopener,noreferrer" (and optionally set newWindow.opener = null) in the
onClick handler for the Button to prevent opener access.

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.

♻️ Duplicate comments (3)
src/Pages/Landing page/Navbar.tsx (3)

127-137: 🛠️ Refactor suggestion | 🟠 Major

Externalize user-visible strings to i18n resources.

Hardcoded strings throughout the component ("PictoPy", "Ready to sort images", "Home", "Feature", "About", "Download", and aria-labels) should be moved to i18n resource files for localization support.

As per coding guidelines, "Internationalization: User-visible strings should be externalized to resource files (i18n)".

🤖 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 127 - 137, The JSX in the
Navbar component contains hardcoded user-facing strings (e.g., "PictoPy", "Ready
to sort images", "Home", "Feature", "About", "Download" and aria-label values)
which must be externalized; locate the Navbar React component in Navbar.tsx and
replace those literals with calls to your i18n lookup (e.g., t('navbar.title'),
t('navbar.tooltip'), etc.), add corresponding keys to the i18n resource files,
and update any aria-label attributes to use the same i18n keys so all visible
text and accessibility labels are localized.

151-164: ⚠️ Potential issue | 🟠 Major

Harden the external window.open call with noopener,noreferrer.

Opening a third-party page with "_blank" leaves window.opener available to the new tab, which is a security risk (reverse tabnabbing).

🔒 Suggested fix
               <Button
                type="button"
                onClick={() =>
                  window.open(
                    "https://github.com/AOSSIE-Org/PictoPy/releases",
-                   "_blank"
+                   "_blank",
+                   "noopener,noreferrer"
                  )
                }
🤖 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 151 - 164, The onClick
handler for the Download Button uses window.open(..., "_blank") and should be
hardened against reverse tabnabbing; update the handler in the Navbar Button
(the onClick that calls window.open) to pass a features string including
"noopener,noreferrer" as the third argument (or switch to an <a> with
target="_blank" and rel="noopener noreferrer") so that the opened tab cannot
access window.opener or leak referrer information.

234-249: ⚠️ Potential issue | 🟠 Major

Apply the same noopener,noreferrer fix to the mobile Download button.

This has the same security concern as the desktop variant.

🔒 Suggested fix
             <Button
               type="button"
               onClick={() => {
                 setIsOpen(false);
                 window.open(
                   "https://github.com/AOSSIE-Org/PictoPy/releases",
-                  "_blank"
+                  "_blank",
+                  "noopener,noreferrer"
                 );
               }}
🤖 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 234 - 249, The mobile
Download Button's onClick handler opens the release URL with window.open without
preventing the new tab from accessing window.opener; update the onClick in the
Button (the arrow function that calls setIsOpen(false) and window.open(...)) to
open the link securely by either passing 'noopener,noreferrer' as the third
argument to window.open or by setting the returned window's opener to null
(e.g., const w = window.open(...); if (w) w.opener = null), ensuring the same
security fix as the desktop variant.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@src/Pages/Landing` page/Navbar.tsx:
- Around line 127-137: The JSX in the Navbar component contains hardcoded
user-facing strings (e.g., "PictoPy", "Ready to sort images", "Home", "Feature",
"About", "Download" and aria-label values) which must be externalized; locate
the Navbar React component in Navbar.tsx and replace those literals with calls
to your i18n lookup (e.g., t('navbar.title'), t('navbar.tooltip'), etc.), add
corresponding keys to the i18n resource files, and update any aria-label
attributes to use the same i18n keys so all visible text and accessibility
labels are localized.
- Around line 151-164: The onClick handler for the Download Button uses
window.open(..., "_blank") and should be hardened against reverse tabnabbing;
update the handler in the Navbar Button (the onClick that calls window.open) to
pass a features string including "noopener,noreferrer" as the third argument (or
switch to an <a> with target="_blank" and rel="noopener noreferrer") so that the
opened tab cannot access window.opener or leak referrer information.
- Around line 234-249: The mobile Download Button's onClick handler opens the
release URL with window.open without preventing the new tab from accessing
window.opener; update the onClick in the Button (the arrow function that calls
setIsOpen(false) and window.open(...)) to open the link securely by either
passing 'noopener,noreferrer' as the third argument to window.open or by setting
the returned window's opener to null (e.g., const w = window.open(...); if (w)
w.opener = null), ensuring the same security fix as the desktop variant.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0fba6855-35af-48c8-9fcf-6f9810c408ed

📥 Commits

Reviewing files that changed from the base of the PR and between 6d5d21a and 1afc877.

📒 Files selected for processing (1)
  • src/Pages/Landing page/Navbar.tsx

Copy link
Author

@RohitKumar717 RohitKumar717 left a comment

Choose a reason for hiding this comment

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

done

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]: Logo Navigation and Text Shadow

1 participant