Skip to content

feat: add back to top button#102

Merged
jpdevhub merged 5 commits into
jpdevhub:mainfrom
krishnendu07-code:feature/back-to-top-button
Jun 18, 2026
Merged

feat: add back to top button#102
jpdevhub merged 5 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 and smoothly scrolls to the top when clicked.

@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

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

More reviews will be available in 47 minutes and 47 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.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

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: 493d57dd-ffa3-49e8-9f50-307c1abde6b0

📥 Commits

Reviewing files that changed from the base of the PR and between 2a3d2dc and 495023c.

📒 Files selected for processing (4)
  • src/components/shared/ScanSkeleton.tsx
  • src/index.css
  • src/pages/AnalysisDashboard.tsx
  • src/pages/LandingPage.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

A new BackToTopButton React component is added that tracks scroll position with multiple DOM fallbacks and renders a fixed-position accessible button with smooth-scroll behavior. It is integrated at the bottom of LandingPage, which also receives import reorganization, quote normalization, hero section attribute additions, and minor JSX formatting updates.

Changes

Back to Top Button Feature

Layer / File(s) Summary
BackToTopButton component implementation
src/components/BackToTopButton.tsx
New component initializes isVisible state, registers/removes a scroll event listener via useEffect, computes scroll position using window.scrollY with documentElement, document.body, and main element fallbacks, and toggles visibility at a 300px threshold. Renders a fixed-position button with conditional Tailwind classes, aria-hidden, tabIndex=-1 when hidden, an ArrowUp icon, and a smooth-scroll click handler.
LandingPage formatting and BackToTopButton integration
src/pages/LandingPage.tsx
Reorganizes icon imports to include ChevronDown, normalizes string quotes across features/steps/faqs constants, adds id="landing-top" and overflow-hidden to the hero section, renders the subtitle as a dedicated italic <span>, updates module label to use padStart(2, "0"), reformats "HOW IT WORKS" and FAQ className strings, rewraps the bottom CTA paragraph, and renders <BackToTopButton /> at the end of the page.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 Hop, hop, I scroll so far down,
Past features and FAQs of renown.
But fear not, dear reader, don't fret —
A button appears, the best one yet!
↑ Click it once, smooth as a breeze,
Back to the top with the greatest of ease! 🌿

🚥 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 a back-to-top button component to the application.
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.

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

@jpdevhub

Copy link
Copy Markdown
Owner

Bro are you testing the project its terrible ui changes.
Styling: We don't use bg-primary in this project. Please change the Tailwind classes to use our custom theme (e.g., text-neon, border-neon/40, bg-surface-mid, hover:bg-neon, hover:text-on-primary).
Placement: You placed the button globally in App.tsx, which means it hovers over the Scanner camera and Dashboard. Please remove it from App.tsx and place it inside src/pages/LandingPage.tsx so it only appears on the long landing page.
And dont just push the ai slop i am not going to accept that.

@krishnendu07-code

Copy link
Copy Markdown
Contributor Author

@jpdevhub I understood your requirements and commited the changes,
-Moved BackToTopButton from App.tsx to LandingPage.tsx.
-Updated styling to use project theme classes.
-Fixed button behavior and accessibility.
-Verified with lint and build checks.
If you still expect improvement, I'm willing to change it all again.
and i don't push AI slops , never say that again.

@jpdevhub

Copy link
Copy Markdown
Owner

I see you fixed the button placement and styling—thank you, the button looks great now. However, your branch is still fundamentally out of sync with main. If I merge this PR right now, your branch will delete the offlineScanResult bug fixes we just merged in ScannerPage.tsx. Also, please revert the unnecessary formatting changes (single vs double quotes) in App.tsx and LandingPage.tsx that are cluttering the diff. You must run git fetch upstream && git rebase upstream/main (or sync your fork) and resolve your conflicts without deleting other contributors' code. We cannot merge PRs that revert recent bug fixes.
If you are not pushing the ai slops, you should have given the screen shot once it was not at all sync with the ui previously.

@krishnendu07-code krishnendu07-code force-pushed the feature/back-to-top-button branch from 41705c1 to 2a3d2dc Compare June 17, 2026 15:53
@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
fresh-scan-ai Ready Ready Preview, Comment Jun 18, 2026 4:18pm

@jpdevhub jpdevhub left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks for contributing

@jpdevhub jpdevhub merged commit cab18cd into jpdevhub:main Jun 18, 2026
10 checks passed
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.

2 participants