feat: add back to top button#102
Conversation
|
@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. |
|
Warning Review limit reached
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 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
Warning
|
| 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 | 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.
Comment @coderabbitai help to get the list of available commands and usage tips.
There was a problem hiding this comment.
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
📒 Files selected for processing (2)
src/App.tsxsrc/components/BackToTopButton.tsx
|
@jpdevhub I've resolved the conflicts from Code rabbit, also it would be great if add the Ssoc'26 label on the issue. |
|
@jpdevhub can you please review my PR. |
|
Bro are you testing the project its terrible ui changes. |
|
@jpdevhub I understood your requirements and commited the changes, |
|
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. |
41705c1 to
2a3d2dc
Compare
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Fixes Issue #101
Description
Added a floating Back-to-Top button to improve page navigation.
Changes Made
Testing
Summary by CodeRabbit