Skip to content

Add auto scroll up when page open - privacy, contact, about#500

Merged
mehul-m-prajapati merged 4 commits into
GitMetricsLab:mainfrom
firoziya:main
May 29, 2026
Merged

Add auto scroll up when page open - privacy, contact, about#500
mehul-m-prajapati merged 4 commits into
GitMetricsLab:mainfrom
firoziya:main

Conversation

@firoziya
Copy link
Copy Markdown
Contributor

@firoziya firoziya commented May 25, 2026

Related Issue


Description

Page does not scroll to top when navigating to /contact or /about via footer links.

How Has This Been Tested?

Locally Run.

Type of Change

  • Bug fix

Summary by CodeRabbit

  • New Features
    • Pages now automatically scroll to the top when navigated to (About, Contact, and Privacy Policy sections).

Review Change Stack

@netlify
Copy link
Copy Markdown

netlify Bot commented May 25, 2026

Deploy Preview for github-spy ready!

Name Link
🔨 Latest commit c6d9221
🔍 Latest deploy log https://app.netlify.com/projects/github-spy/deploys/6a19c31812d45e0008ce39f8
😎 Deploy Preview https://deploy-preview-500--github-spy.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 25, 2026

Warning

Review limit reached

@mehul-m-prajapati, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 44 minutes and 45 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2ef94996-55a2-4b0a-bb25-96ab06d7e64c

📥 Commits

Reviewing files that changed from the base of the PR and between 57f9d4e and c6d9221.

📒 Files selected for processing (1)
  • src/pages/Contact/Contact.tsx
📝 Walkthrough

Walkthrough

Three page components (About, Contact, PrivacyPolicy) now import and invoke useEffect to call window.scrollTo(0, 0) on mount. This fixes the bug where navigation via footer links kept the viewport at the footer position instead of scrolling to the top. Contact.tsx also includes Tailwind className reformatting throughout the component.

Changes

Scroll-to-top on page mount

Layer / File(s) Summary
Scroll-to-top in About page
src/pages/About/About.tsx
Add useEffect import and implement mount-time hook to scroll window to top; apply minor JSX formatting to hero and mission sections.
Scroll-to-top in Contact page with className reformatting
src/pages/Contact/Contact.tsx
Add useEffect import and mount-time scroll hook; reformat Tailwind className template literals across page container, logo, text, contact cards, form fields, and success popup while preserving all dark/light conditional styling logic.
Scroll-to-top in PrivacyPolicy page with import cleanup
src/pages/Privacy/PrivacyPolicy.tsx
Add useEffect import (as named import) and implement mount-time scroll hook; reformat react-icons import list and add minor whitespace adjustments.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • GitMetricsLab/github_tracker#173: Both PRs modify src/pages/About/About.tsx structure—this PR adds useEffect scroll-to-top while the related PR refactors the page with framer-motion animations, creating an overlap in the same component.

Suggested labels

gssoc25, level2

Poem

🐰 When footers beckon and users click,
Our pages now dart to the top, quick and slick,
No more scrolling from down at the floor,
Just useEffect magic—a scroll-to-top tour!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding auto-scroll functionality to the About, Contact, and Privacy pages when they open.
Description check ✅ Passed The description follows the template and includes the related issue, a clear problem statement, testing method, and change type, though the 'Bug fix' checkbox is not marked.
Linked Issues check ✅ Passed The PR successfully implements the auto-scroll fix described in issue #497 by adding useEffect with window.scrollTo(0, 0) to About, Contact, and PrivacyPolicy components.
Out of Scope Changes check ✅ Passed Minor formatting and whitespace changes to JSX and className declarations are present but are incidental to the core functionality and do not introduce unrelated features.
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 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.

@mehul-m-prajapati mehul-m-prajapati merged commit eec69f2 into GitMetricsLab:main May 29, 2026
3 of 5 checks passed
@github-actions
Copy link
Copy Markdown

🎉🎉 Thank you for your contribution! Your PR #500 has been merged! 🎉🎉

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 Bug Report: Page does not scroll to top when navigating to /contact or /about via footer links

2 participants