Skip to content

feat: add back to top button#102

Open
krishnendu07-code wants to merge 2 commits into
jpdevhub:mainfrom
krishnendu07-code:feature/back-to-top-button
Open

feat: add back to top button#102
krishnendu07-code wants to merge 2 commits into
jpdevhub:mainfrom
krishnendu07-code:feature/back-to-top-button

Conversation

@krishnendu07-code

@krishnendu07-code krishnendu07-code commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Fixes Issue #101

Description

Added a floating Back-to-Top button to improve page navigation.

Changes Made

  • Added reusable BackToTopButton component
  • Button appears after scrolling down
  • Smoothly scrolls back to top when clicked
  • Styled to match the existing FreshScan AI theme
  • Added accessible aria-label

Testing

  • npm run lint
  • npm run build

Summary by CodeRabbit

  • New Features
    • Added a back-to-top button that appears when scrolling down the page, enabling users to quickly return to the top with a smooth scroll animation.

@vercel

vercel Bot commented Jun 13, 2026

Copy link
Copy Markdown

@krishnendu07-code is attempting to deploy a commit to the karan3431's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@krishnendu07-code, we couldn't start this review because you've reached your PR review rate limit.

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

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

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

Run ID: 9da5569a-4b98-41b2-9d64-8925c313e0b5

📥 Commits

Reviewing files that changed from the base of the PR and between b0ec45a and 35560d2.

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

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Validation error: Invalid input: expected object, received boolean at "reviews.auto_review"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
📝 Walkthrough

Walkthrough

This PR introduces a BackToTopButton component that appears when users scroll past 300 pixels, allowing them to smoothly return to the top of the page. The component is integrated into the main App layout, and import statements are reorganized to reflect the new routing and component usage.

Changes

Back to Top Button

Layer / File(s) Summary
BackToTopButton component
src/components/BackToTopButton.tsx
New fixed-position button component that uses scroll event listener to toggle visibility when scrollY > 300, smoothly animates to top on click, includes ArrowUp icon and accessibility label.
App integration
src/App.tsx
Imports BackToTopButton and renders it alongside existing UI components; imports reorganized to align with routing dependencies; minor formatting adjustments to blank lines and braces.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🐰 A button hops into view,
When scrolling grows too weighty,
One click, one smooth flow—
Back to the top, oh so neatly!
✨🔝

🚥 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
Title check ✅ Passed The title 'feat: add back to top button' clearly and concisely summarizes the main change—introducing a new BackToTopButton component that is integrated into the App router layout.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 `@src/components/BackToTopButton.tsx`:
- Around line 26-34: The BackToTopButton component currently only hides visually
but remains keyboard-focusable; update the button element in BackToTopButton so
when isVisible is false it is removed from tab order and inert: add disabled={
!isVisible }, aria-hidden={ !isVisible } and tabIndex={ isVisible ? 0 : -1 }
(and keep or remove the visual "pointer-events-none" class as you prefer); also
ensure scrollToTop is a no-op when disabled (or rely on disabled preventing
clicks) so the hidden button cannot be activated via keyboard or mouse.
🪄 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 Plus

Run ID: 1cce4a99-8539-423c-be74-c2c50df92668

📥 Commits

Reviewing files that changed from the base of the PR and between b748bcf and b0ec45a.

📒 Files selected for processing (2)
  • src/App.tsx
  • src/components/BackToTopButton.tsx

Comment thread src/components/BackToTopButton.tsx
@krishnendu07-code

Copy link
Copy Markdown
Contributor Author

@jpdevhub I've resolved the conflicts from Code rabbit, also it would be great if add the Ssoc'26 label on the issue.

@krishnendu07-code

Copy link
Copy Markdown
Contributor Author

@jpdevhub can you please review my PR.

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.

1 participant