-
-
Notifications
You must be signed in to change notification settings - Fork 284
Added scroll-to-top button feature on home page #4743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Added scroll-to-top button feature successfully. Please review my PR. |
WalkthroughA Scroll to Top feature is added to the homepage: a Back to Top button appears after scrolling past a threshold and smoothly scrolls the page to the top when clicked. The button, its styles, and the script are present in two duplicated locations within the template, creating two independent instances. Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant Page as Home Page
participant Scroll as Scroll Event
participant Button as Back to Top Button
User->>Page: Scrolls down
Page->>Scroll: Window scroll event
Scroll->>Button: Evaluate scrollY vs threshold
alt scrollY > threshold
Button->>Button: set visible (show)
else
Button->>Button: set hidden (hide)
end
User->>Button: Click
Button->>Page: window.scrollTo({ top: 0, behavior: "smooth" })
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Knowledge base: Disabled due to 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting
📒 Files selected for processing (1)
website/templates/home.html(2 hunks)
🔇 Additional comments (1)
website/templates/home.html (1)
1155-1157: The duplication claim is incorrect; only one backToTop button instance exists in the entire template.The comprehensive search confirms exactly one button with
id="backToTop"at line 1175, with its associated JavaScript handlers at lines 1182 and 1190. No duplicate implementations or alternative naming patterns were found. The AI summary's claim of duplication is factually inconsistent with the actual codebase.Likely an incorrect or invalid review comment.
gojo-satorou-v7
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sanghmitra12 This does not fix the issues #4730 , you have to fix the embedded code.
you have instead added a scroll to top button feature.
|
Hi @gojo-satorou-v7, This was my first open-source contribution, and I added this feature mainly to understand the complete contribution process and workflow better. 😊 |
|
Hello @Sanghmitra12 please go through the issue before opening a PR and understand the underlying code causing the issue. In case you want to add new features in the project please ask DonnieBLT on the slack channel first. |
|
Hi @gojo-satorou-v7, Thanks again for your help and feedback! 🙌 |
…or scroll-to-top button
Implemented scroll-to-top button on home page for better user navigation experience.
Summary by CodeRabbit