feat: add Back to Top button for better navigation on long pages - #222
Conversation
Signed-off-by: Vaishnavi Thakur <vaaishnavi4713@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughA new ChangesBack to Top Navigation Feature
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@apps/web-dashboard/src/components/Layout/BackToTop.jsx`:
- Around line 27-30: The icon-only button rendered in BackToTop.jsx (the button
with onClick={handleClick} and content "↑") lacks an explicit accessible name;
add aria-label="Back to Top" to that button element (and the second similar
button instance around line 49) so assistive technologies receive a reliable
name; locate the button elements that use handleClick and add the aria-label
attribute without changing visual text or behavior.
- Around line 4-16: The effect currently registers handleScroll but never runs
it on mount, so BackToTop can remain hidden if the page loads with
window.scrollY > 300; after adding the scroll listener in the useEffect, call
the existing handleScroll() once to initialize visibility (i.e., invoke
handleScroll right after window.addEventListener('scroll', handleScroll)) so
setIsVisible is set correctly on mount; keep the existing cleanup that removes
the listener.
🪄 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: c41caf8f-3d3d-41c6-9082-3e429e518c75
📒 Files selected for processing (3)
apps/web-dashboard/src/components/Layout/BackToTop.jsxapps/web-dashboard/src/components/Layout/MainLayout.jsxapps/web-dashboard/src/pages/LandingPage/index.jsx
Signed-off-by: Vaishnavi Thakur <vaaishnavi4713@gmail.com>
|
BRo @coderabbitai
|
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
echo "=== BackToTop.jsx ==="
cat apps/web-dashboard/src/components/Layout/BackToTop.jsx
echo ""
echo "=== MainLayout.jsx ==="
cat apps/web-dashboard/src/components/Layout/MainLayout.jsx
echo ""
echo "=== LandingPage/index.jsx ==="
cat apps/web-dashboard/src/pages/LandingPage/index.jsx
echo ""
echo "=== Layout folder structure ==="
tree apps/web-dashboard/src/components/Layout/ 2>/dev/null || ls -la apps/web-dashboard/src/components/Layout/Length of output: 58232 PR description image 1 (production at urbackend.bitbros.in): Shows the dark landing page "Build Anything." with three use-case cards — button not visible because the page hasn't been scrolled, which is correct expected behavior. PR description image 2 (localhost:5173): Shows the dev server with the cyan/teal circular back-to-top button visibly rendered in the bottom-right corner with an upward arrow — feature working correctly.
✅ Feature — Implemented CorrectlyAll requirements from issue
✅ File Placement — Correct
|
| Check | Result |
|---|---|
Feature works as per issue #219 |
✅ |
| File placed correctly | ✅ |
| Code structure | ✅ Clean |
| Scroll performance | |
| Icon consistency (Lucide) | ↑ |
| Hover feedback |
Overall solid work — the core feature is well done. The three
|
please fix then will merge |
|
@Vaishnavi22Thakur ?????/ |
…d hover effect Signed-off-by: Vaishnavi Thakur <vaaishnavi4713@gmail.com>
|
Actionable comments posted: 0 |
|
@yash-pouranik Fixed all 3 CodeRabbit suggestions:
|
|
Thank you for the PR @Vaishnavi22Thakur |
🚀 Pull Request Description
Fixes #219
🛠️ Type of Change
🧪 Testing & Validation
Backend Verification:
Frontend Verification:
📸 Screenshots / Recordings
✅ Checklist
📝 Changes Made
BackToTop.jsxcomponent inapps/web-dashboard/src/components/Layout/<BackToTop />toMainLayout.jsxfor dashboard pages<BackToTop />toLandingPage/index.jsxfor the landing pageSummary by CodeRabbit