Skip to content

Conversation

@OfficialSubham
Copy link

@OfficialSubham OfficialSubham commented Feb 11, 2026

User can scroll to top by clicking in the logo in landing page

Summary by CodeRabbit

  • New Features
    • Clicking the logo now smoothly scrolls the page to the top.

@vercel
Copy link

vercel bot commented Feb 11, 2026

@OfficialSubham 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 Feb 11, 2026

📝 Walkthrough

Walkthrough

The navbar component now includes a scrollToTop function that executes smooth scrolling to the page top. The logo container is enhanced with click handler functionality and pointer cursor styling, enabling users to return to the top by clicking the logo. All other navbar features remain unmodified.

Changes

Cohort / File(s) Summary
Navbar Scroll-to-Top Feature
apps/web/src/components/landing-sections/navbar.tsx
Added scrollToTop function and integrated it as an onClick handler on the logo container with pointer cursor styling. Existing navbar toggle and link rendering logic preserved.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A logo touched, the page ascends,
Smooth scrolling where the journey bends,
From top to bottom, now we climb back,
With just a click, we're on track!
The navbar hops, ears held up high! 🎪

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding scroll-to-top functionality when clicking the logo, directly matching the PR objectives and code changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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

Caution

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

⚠️ Outside diff range comments (1)
apps/web/src/components/landing-sections/navbar.tsx (1)

91-94: ⚠️ Potential issue | 🟡 Minor

Alt text "background" is incorrect for a logo image.

This is the site logo, not a background image. A meaningful alt text like "Opensox AI logo" improves accessibility.

🤖 Fix all issues with AI agents
In `@apps/web/src/components/landing-sections/navbar.tsx`:
- Line 88: The logo container is interactive (onClick={scrollToTop}) but lacks
keyboard and ARIA semantics; replace the <div> used in Navbar (the element with
class "text-xl md:text-2xl ... cursor-pointer") with an accessible control
(preferably a <button>) or add tabindex="0", role="button", aria-label="Scroll
to top", and an onKeyDown handler that calls scrollToTop on Enter/Space; ensure
the element uses the same class names and that the scrollToTop function is
invoked from both onClick and onKeyDown so keyboard and screen-reader users can
activate it.
🧹 Nitpick comments (1)
apps/web/src/components/landing-sections/navbar.tsx (1)

51-56: Rename to handleScrollToTop and add a type annotation.

Per coding guidelines, event handler functions should use the handle prefix, and const functions should have a type defined.

♻️ Proposed rename
-  const scrollToTop = () => {
+  const handleScrollToTop: () => void = () => {
     window.scrollTo({
       top: 0,
-      behavior: "smooth"
-    })
-  }
+      behavior: "smooth",
+    });
+  };

As per coding guidelines: "name event functions with a 'handle' prefix" and "Define a type when defining const functions."

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