Skip to content

Add dashboard back-to-top button with scroll threshold and theme supp…#2512

Open
Honey-pg wants to merge 1 commit into
Umbrella-io:mainfrom
Honey-pg:feat/dashboard-back-to-top
Open

Add dashboard back-to-top button with scroll threshold and theme supp…#2512
Honey-pg wants to merge 1 commit into
Umbrella-io:mainfrom
Honey-pg:feat/dashboard-back-to-top

Conversation

@Honey-pg

Copy link
Copy Markdown
Contributor

Summary

Scope the floating button to dashboard routes, show it after 400px scroll with smooth return-to-top, and fix React style shorthand warnings in CustomCursor and LandingPage.

Adds a floating back-to-top button on dashboard routes that appears after scrolling 400px and smoothly returns the user to the top. Also fixes React console warnings from mixing CSS shorthand and longhand style properties in CustomCursor and LandingPage.

Closes #2509


Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that changes existing behavior)
  • 📝 Documentation update
  • ♻️ Refactor / code cleanup (no functional change)
  • ⚡ Performance improvement
  • 🔒 Security fix
  • 🧪 Tests only

What Changed

  • Updated BackToTopButton.tsx — simplified floating button with 400px scroll threshold, ArrowUp icon, smooth scroll, theme-aware bg-accent styling, and bottom-6 right-6 positioning
  • Updated dashboard/layout.tsx — renders BackToTopButton on all dashboard routes
  • Updated providers.tsx — removed global back-to-top button so it only appears on the dashboard
  • Updated CustomCursor.tsx — replaced border shorthand with longhand (borderWidth, borderStyle, borderColor) to fix React style warning
  • Updated LandingPage.tsx — merged transitionDelay into transition shorthand in FeatureCard to fix React style warning
  • Updated test/components/BackToTopButton.test.tsx — tests for 400px threshold, smooth scroll, and keyboard activation

How to Test

  1. Run npm run dev and open /dashboard while signed in.
  2. Scroll down past ~400px — a round ↑ button should appear in the bottom-right corner.
  3. Click the button — the page should smooth-scroll to the top and the button should disappear.
  4. Press Tab to focus the button and press Enter or Space — it should also scroll to top.
  5. Toggle light/dark theme — button colors should follow the active theme via accent CSS variables.
  6. Open the landing page and dashboard — confirm no React console warnings about border/borderColor or transition/transitionDelay.

Expected result: Back-to-top button appears only on dashboard routes after 400px scroll, scrolls smoothly to top on click/keyboard, respects theme, and does not overlap top-right toasts.

Automated checks:

npm run type-check
npm run lint
npm test -- test/components/BackToTopButton.test.tsx

@github-actions github-actions Bot added type:bug GSSoC type bonus: bug fix type:feature GSSoC type bonus: new feature type:testing GSSoC type bonus: tests (+10 pts) type:design GSSoC type bonus: UI/design (+10 pts) type:performance GSSoC type bonus: performance (+15 pts) gssoc26 GSSoC 2026 contribution labels Jun 17, 2026
@github-actions

Copy link
Copy Markdown

GSSoC Label Checklist 🏷️

@Umbrella-io — please apply the appropriate labels before merging:

Difficulty (pick one):

  • level:beginner — 20 pts
  • level:intermediate — 35 pts
  • level:advanced — 55 pts
  • level:critical — 80 pts

Quality (optional):

  • quality:clean — ×1.2 multiplier
  • quality:exceptional — ×1.5 multiplier

Validation (required to score):

  • gssoc:approved — counts for points
  • gssoc:invalid / gssoc:spam / gssoc:ai-slop — does not score

Type labels (type:*) are auto-detected from files and title. Review and adjust if needed.
Points formula: (difficulty × quality_multiplier) + type_bonus

@Honey-pg Honey-pg force-pushed the feat/dashboard-back-to-top branch from 02f5fa9 to 13fc7e1 Compare June 17, 2026 01:43
Add a dashboard-scoped floating back-to-top control after 400px scroll, and repair upstream type-check failures in dashboard page, middleware, auth route, issues API, and leaderboard skeleton path.
@Honey-pg Honey-pg force-pushed the feat/dashboard-back-to-top branch from 8ca2d8f to 6812460 Compare June 17, 2026 01:57
@Priyanshu-byte-coder

Copy link
Copy Markdown
Member

This PR has merge conflicts with main. Please rebase or resolve conflicts and push again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc26 GSSoC 2026 contribution type:bug GSSoC type bonus: bug fix type:design GSSoC type bonus: UI/design (+10 pts) type:feature GSSoC type bonus: new feature type:performance GSSoC type bonus: performance (+15 pts) type:testing GSSoC type bonus: tests (+10 pts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Add floating "Scroll to Top" button on Dashboard

2 participants