Conversation
📝 WalkthroughWalkthroughModified the Header component to always render the Home element containing the Aossie logo, regardless of current page location. Previously, the logo was conditionally hidden on the homepage. Added pathname detection and a scroll-to-top handler to restore navigation consistency across all pages. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/components/shared/Header.jsx (1)
239-255:⚠️ Potential issue | 🟠 MajorWire the new scroll handler into the logo link.
Line 241 defines
handleClick, but Line 251 never passes it to the renderedLink, so the homepage logo still won’t perform the smooth scroll described in this PR.Proposed fix
function Home({ large = false, className, ...props }) { const pathname = usePathname() function handleClick(e) { if (pathname === '/') { e.preventDefault() window.scrollTo({ top: 0, behavior: 'smooth', }) } } return ( <Link href="/" aria-label="Home" className={clsx(className, 'pointer-events-auto')} + onClick={handleClick} {...props} > <Image src='/logo1.png' width={100} height={100} className='scale-125' alt='Aossie Logo' /> </Link> ) }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/components/shared/Header.jsx` around lines 239 - 255, The click handler handleClick defined in this component isn't wired to the rendered Link, so the logo link won't trigger the smooth scroll; attach the handler to the Link by adding the onClick prop (onClick={handleClick}) to the Link element (the same Link that currently has href="/" and className uses clsx), ensuring the function name handleClick is used and imported hooks like usePathname remain unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@src/components/shared/Header.jsx`:
- Around line 239-255: The click handler handleClick defined in this component
isn't wired to the rendered Link, so the logo link won't trigger the smooth
scroll; attach the handler to the Link by adding the onClick prop
(onClick={handleClick}) to the Link element (the same Link that currently has
href="/" and className uses clsx), ensuring the function name handleClick is
used and imported hooks like usePathname remain unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 6bdfbfd4-acc7-486a-bba2-8d0fae3e3815
📒 Files selected for processing (1)
src/components/shared/Header.jsx
Addressed Issues:
Fixes #646
Currently, the AOSSIE logo (which also acts as a Home button) is hidden on the landing homepage.
This creates a UX inconsistency because users expect the logo to be present in the navbar at all times.
Additionally, users often click the logo to quickly return to the top of the page.
(The sticky property of Navbar would be implemented after this PR is merged properly because this issues scopes only for the homepage logo visibility and scrolling to top at home functionality)
Screenshots/Recordings:
Before:


After:

Additional Notes:
AI Usage Disclosure:
We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact. AI slop is strongly discouraged and may lead to banning and blocking. Do not spam our repos with AI slop.
Check one of the checkboxes below:
I have used the following AI models and tools: TODO
Checklist
Summary by CodeRabbit