Skip to content

Fix footer navigation scroll behavior for Contact and other links#336

Merged
Sachinchaurasiya360 merged 3 commits into
Sachinchaurasiya360:mainfrom
panicAtTheCompile:fix/harshita-contact-button
May 21, 2026
Merged

Fix footer navigation scroll behavior for Contact and other links#336
Sachinchaurasiya360 merged 3 commits into
Sachinchaurasiya360:mainfrom
panicAtTheCompile:fix/harshita-contact-button

Conversation

@panicAtTheCompile
Copy link
Copy Markdown

@panicAtTheCompile panicAtTheCompile commented May 19, 2026

Description

This PR improves the footer navigation UX by ensuring users are redirected to the top of the destination page when clicking footer navigation links such as Contact, Blog, Terms, Privacy, and other internal routes.

Previously, navigation preserved the existing scroll position, which made it appear as though the Contact page was not opening correctly because users landed near the footer section instead of the top of the page.

Changes Made

  • Added scroll-to-top behavior for internal footer navigation links
  • Improved consistency of footer-based page navigation
  • Enhanced overall user experience during route transitions

Issue Fixed

Fixes #152

Summary by CodeRabbit

  • New Features
    • Footer navigation links (Start free, Sign in, Blog, and Contact) now trigger a smooth scroll to the top of the page when clicked, including the contact link in the footer's legal/links row, improving navigation flow and consistency.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 19, 2026

Warning

Rate limit exceeded

@panicAtTheCompile has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 52 minutes and 31 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 461f37fd-4d08-4ec8-973c-fd3403499dbf

📥 Commits

Reviewing files that changed from the base of the PR and between e23d695 and 0390f4e.

📒 Files selected for processing (1)
  • client/src/components/Footer.tsx
📝 Walkthrough

Walkthrough

The Footer component adds a smooth scroll-to-top handler and applies it to several navigation links. A new internal handleNavigation function scrolls the page to the top with smooth behavior. Navigation links in the Account section and footer bottom row now trigger this scroll on click.

Changes

Smooth scroll-to-top on footer navigation

Layer / File(s) Summary
Scroll-to-top handler definition
client/src/components/Footer.tsx
Internal handleNavigation function is defined to call window.scrollTo({ top: 0, behavior: "smooth" }).
Apply handler to navigation links
client/src/components/Footer.tsx
Account section links (Start free, Sign in, Blog, Contact) and footer bottom "Contact" link receive the onClick={handleNavigation} handler; Contact links are reformatted to multiline elements.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • Sachinchaurasiya360/InternHack#254: Both PRs update client/src/components/Footer.tsx footer links to call a click handler that performs window.scrollTo({ top: 0, behavior: "smooth" }), changing the navigation scroll behavior.

Suggested labels

enhancement, level:beginner

Poem

🐰 I hop to the footer, a gentle click and cheer,
The page glides upward, the top now near,
No jolt, no tumble, just velvet flight,
A tiny scroll that feels just right,
Happy hops — navigation clear!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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 clearly summarizes the main change: adding scroll-to-top behavior to footer navigation links including the Contact button.
Linked Issues check ✅ Passed The PR successfully addresses issue #152 by implementing click handlers on footer navigation links that trigger smooth scroll-to-top behavior, ensuring the Contact button now functions properly.
Out of Scope Changes check ✅ Passed All changes are scoped to Footer.tsx and directly address the linked issue by adding scroll functionality to navigation links without introducing unrelated modifications.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@client/src/components/Footer.tsx`:
- Around line 130-141: The footer has inconsistent use of the scroll-reset
handler: ensure every internal Link in the Footer component uses the existing
handleNavigation handler (and retains className={linkClass}) so clicks reset
scroll; update all footer links including Terms, Privacy, Refunds, Shipping and
any other internal routes to include onClick={handleNavigation} (and remove it
only for external links), locating them by the Footer component and the
handleNavigation identifier.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 377834f4-6ce5-45e8-b941-59e084200f3c

📥 Commits

Reviewing files that changed from the base of the PR and between 3552efa and 1696de8.

📒 Files selected for processing (1)
  • client/src/components/Footer.tsx

Comment on lines +130 to +141
<li><Link to="/register" className={linkClass} onClick={handleNavigation}>Start free</Link></li>
<li><Link to="/login" className={linkClass} onClick={handleNavigation}>Sign in</Link></li>
<li><Link to="/blog" className={linkClass} onClick={handleNavigation}>Blog</Link></li>
<li>
<Link
to="/contact"
className={linkClass}
onClick={handleNavigation}
>
Contact
</Link>
</li>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Apply scroll reset consistently to all internal footer links.

Right now only some internal links call handleNavigation; links like Terms, Privacy, Refunds, Shipping, and other internal footer routes still preserve prior scroll position. This leaves the original UX issue partially unresolved.

Suggested fix
-            <Link to="/terms" className="hover:text-stone-400 transition-colors no-underline">Terms</Link>
-            <Link to="/privacy" className="hover:text-stone-400 transition-colors no-underline">Privacy</Link>
-            <Link to="/refund" className="hover:text-stone-400 transition-colors no-underline">Refunds</Link>
-            <Link to="/shipping" className="hover:text-stone-400 transition-colors no-underline">Shipping</Link>
+            <Link to="/terms" className="hover:text-stone-400 transition-colors no-underline" onClick={handleNavigation}>Terms</Link>
+            <Link to="/privacy" className="hover:text-stone-400 transition-colors no-underline" onClick={handleNavigation}>Privacy</Link>
+            <Link to="/refund" className="hover:text-stone-400 transition-colors no-underline" onClick={handleNavigation}>Refunds</Link>
+            <Link to="/shipping" className="hover:text-stone-400 transition-colors no-underline" onClick={handleNavigation}>Shipping</Link>

Also applies to: 203-213

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@client/src/components/Footer.tsx` around lines 130 - 141, The footer has
inconsistent use of the scroll-reset handler: ensure every internal Link in the
Footer component uses the existing handleNavigation handler (and retains
className={linkClass}) so clicks reset scroll; update all footer links including
Terms, Privacy, Refunds, Shipping and any other internal routes to include
onClick={handleNavigation} (and remove it only for external links), locating
them by the Footer component and the handleNavigation identifier.

@panicAtTheCompile
Copy link
Copy Markdown
Author

Updated the PR by resolving the merge conflicts and applying the scroll reset behavior consistently across all internal footer navigation links. The footer navigation now redirects users to the top of the destination page for a smoother UX experience.

Looking forward to the review. Thanks!

@Sachinchaurasiya360 Sachinchaurasiya360 added good first issue Good for newcomers level:beginner Good for first-time contributors quality:clean Clean and well-structured contribution type:design UI/UX or design-related updates gssoc:approved Approved for GSSoC scoring labels May 21, 2026
@Sachinchaurasiya360 Sachinchaurasiya360 merged commit f4052e6 into Sachinchaurasiya360:main May 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

good first issue Good for newcomers gssoc:approved Approved for GSSoC scoring level:beginner Good for first-time contributors quality:clean Clean and well-structured contribution type:design UI/UX or design-related updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Contact button is not working

2 participants