Skip to content

nce web dashboard with new hooks and layout improvements - #320

Merged
yash-pouranik merged 3 commits into
geturbackend:mainfrom
Ingole712521:fix/perf-responsiveness-landing-page-319
Jun 18, 2026
Merged

nce web dashboard with new hooks and layout improvements#320
yash-pouranik merged 3 commits into
geturbackend:mainfrom
Ingole712521:fix/perf-responsiveness-landing-page-319

Conversation

@Ingole712521

@Ingole712521 Ingole712521 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Improves landing and pricing page performance, responsiveness, and navigation UX on mobile and low-end devices.

  1. Lazy-loads heavy hero effects (Hyperspeed, MagicBento) and defers below-fold sections with useInView
  2. Pauses WebGL when off-screen/hidden tab; respects prefers-reduced-motion
  3. Adds ScrollToTop on route change so /pricing no longer opens at the footer
  4. Fixes navbar layout: centered desktop links, cleaner mobile hamburger menu (includes Docs), auto-close on scroll
  5. Fixes hero spacing and vertical centering
  6. Hides scrollbar while keeping scroll behavior
  7. Extracts memoized FaqSection / OrbitSection and throttles scroll handlers to reduce re-renders

fix : #319

Summary by CodeRabbit

Release Notes

  • New Features

    • Added automatic “scroll to top” on route navigation (with hash handling)
  • Performance

    • Reduced-motion and in-view optimizations for animation-heavy sections
    • Pauses background animation when the page/tab or component isn’t visible
    • Caps WebGL rendering pixel density for more consistent performance
  • Improvements

    • Refined landing and pricing layouts, including responsive navigation and spacing
    • Improved scrollbar hiding for a cleaner cross-browser experience
    • Enhanced mobile menu overlay behavior and hover interactions

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

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

More reviews will be available in 58 minutes and 1 second. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ 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

Run ID: ecb945ba-dcdd-403e-ae16-9f0a5b37d4d6

📥 Commits

Reviewing files that changed from the base of the PR and between 820f09a and 7d3fcc8.

📒 Files selected for processing (2)
  • apps/web-dashboard/src/pages/LandingPage/style.css
  • apps/web-dashboard/src/pages/Pricing.css
📝 Walkthrough

Walkthrough

Adds ScrollToTop navigation component, useInView and usePrefersReducedMotion hooks, and WebGL pause/resume with pixel-ratio capping to Hyperspeed. Refactors LandingPage with lazy-loaded components, extracted FaqSection/OrbitSection, centralized nav rendering, and responsive/reduced-motion effects. Updates CSS for LandingPage and Pricing pages.

Changes

Landing Page Performance, Responsiveness & Navigation

Layer / File(s) Summary
New utility hooks: useInView and usePrefersReducedMotion
src/hooks/useInView.js, src/hooks/usePrefersReducedMotion.js
useInView sets up a one-shot IntersectionObserver returning [ref, inView]; usePrefersReducedMotion reads and reactively tracks the prefers-reduced-motion media query.
ScrollToTop component and App wiring
src/components/Layout/ScrollToTop.jsx, src/App.jsx
ScrollToTop calls window.scrollTo(0,0) on route pathname/hash changes (skipping hash anchors) and is rendered inside AppContent.
Hyperspeed pause/resume and pixel ratio cap
src/components/Hyperspeed/Hyperspeed.jsx
Caps WebGL pixel ratio to 1.5, adds paused flag with pause()/resume() methods and tick() short-circuit, and auto-pauses via IntersectionObserver and visibilitychange.
LandingPage data constants and nav helpers
src/pages/LandingPage/index.jsx
Splits orbit tech tiers, centralizes NAV_ITEMS/MOBILE_MENU_ITEMS, adds mobile hyperspeed overrides, and introduces renderNavItem for unified link rendering with active-state logic.
Extracted FaqSection and OrbitSection components
src/pages/LandingPage/index.jsx
Memoized FaqSection implements accordion open/close; memoized OrbitSection maps ORBIT_* arrays into Framer Motion orbit wrappers.
LandingPage state, effects, and render updates
src/pages/LandingPage/index.jsx
Adds isNarrowViewport, servicesInView, reduced-motion checks, rAF-throttled scroll handler, and studio replay state; lazy-loads Hyperspeed/MagicBento conditionally; replaces inline orbit and FAQ markup with extracted components.
LandingPage CSS: scrollbar, navbar, hero, orbit, mobile menu, reduced-motion
src/pages/LandingPage/style.css
Hides scrollbars cross-browser; adds 3-column grid nav at ≥1201px; rewrites navbar breakpoints; uses --hero-nav-offset + 100svh for hero; switches orbit hover to :has(); rebuilds mobile overlay with opacity/visibility transitions; adds prefers-reduced-motion animation disable block.
Pricing page scroll reset and CSS fixes
src/pages/Pricing.jsx, src/pages/Pricing.css
Mount-only effect resets body overflow and scrolls to top; CSS switches to 100svh, hides scrollbars, and recalculates .pricing-main padding with --nav-height.

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant LandingPage
  participant usePrefersReducedMotion
  participant useInView
  participant Hyperspeed
  participant MagicBento

  LandingPage->>usePrefersReducedMotion: query prefers-reduced-motion
  usePrefersReducedMotion-->>LandingPage: prefersReducedMotion=false
  LandingPage->>LandingPage: matchMedia → isNarrowViewport
  LandingPage->>useInView: attach servicesRef
  Browser->>useInView: IntersectionObserver fires (servicesInView=true)
  useInView-->>LandingPage: servicesInView=true
  alt not prefersReducedMotion and not isNarrowViewport
    LandingPage->>Hyperspeed: lazy import + Suspense mount
    Browser->>Hyperspeed: visibilitychange / IntersectionObserver
    Hyperspeed->>Hyperspeed: pause() / resume()
  end
  alt servicesInView
    LandingPage->>MagicBento: lazy import + Suspense mount
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related issues

Possibly related PRs

  • geturbackend/urBackend#315: Both PRs directly modify Hyperspeed.jsx; PR #315 introduces the component while this PR adds pause/resume and pixel-ratio capping on top of it.

Suggested labels

enhancement, level:intermediate, quality:clean, type:refactor, frontend

Suggested reviewers

  • yash-pouranik
  • Nitin-kumar-yadav1307

Poem

🐇 Hop, hop — the page now scrolls back to the top!
WebGL rests when hidden, no frames to drop.
Lazy sections wake only when in view,
Reduced-motion respected, accessibility grew.
The orbit spins on :has(), the menu fades in light —
A rabbit approves: this landing page feels right! ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title 'nce web dashboard with new hooks and layout improvements' is incomplete and vague, appears to be truncated (missing initial characters), and fails to clearly summarize the main changes. Revise the title to be complete and descriptive, such as 'Improve web dashboard performance with lazy loading, pause mechanics, and layout fixes' or similar, clearly conveying the primary optimization goals.
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 (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
apps/web-dashboard/src/pages/LandingPage/index.jsx (1)

715-726: 💤 Low value

Consider using a stable key instead of array index.

While FAQ_ITEMS is a static array that won't be reordered, using the question text or adding an id field would be more idiomatic and guard against future changes.

-{FAQ_ITEMS.map((faq, index) => (
-    <div key={index} className="faq-item">
+{FAQ_ITEMS.map((faq) => (
+    <div key={faq.q} className="faq-item">
🤖 Prompt for 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.

In `@apps/web-dashboard/src/pages/LandingPage/index.jsx` around lines 715 - 726,
The FAQ list rendering in the faq-list div is using the array index as the React
key when mapping over FAQ_ITEMS, which is not a stable identifier. Replace the
key={index} prop with a more stable key based on the FAQ data itself, such as
key={faq.q} if the question text is guaranteed to be unique, or preferably add
an id field to each item in the FAQ_ITEMS array and use key={faq.id} instead.
This will prevent potential issues if the FAQ items are reordered or modified in
the future.

Source: Linters/SAST tools

apps/web-dashboard/src/pages/LandingPage/style.css (1)

493-517: 💤 Low value

Consider adding vh fallback before svh for older browsers.

100svh is well-supported in modern browsers but lacks fallback for older versions. Adding 100vh before it ensures graceful degradation.

 .hero-section {
     --hero-nav-offset: calc(1.5rem + var(--nav-height, 70px) + 0.5rem);
     position: relative;
+    min-height: 100vh;
     min-height: 100svh;
🤖 Prompt for 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.

In `@apps/web-dashboard/src/pages/LandingPage/style.css` around lines 493 - 517,
Add a fallback for the svh (small viewport height) values used in the
.hero-section class to ensure compatibility with older browsers. Specifically,
for the min-height property in the main .hero-section rule where 100svh is used,
add 100vh as a fallback declaration before it. Similarly, in the max-width:
768px media query where min-height uses calc(100svh - 1rem), add a fallback of
calc(100vh - 1rem) before the svh version. This can be done by declaring the
fallback property first, followed by the modern svh version, allowing older
browsers to gracefully degrade to the vh-based calculation.
🤖 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/Hyperspeed/Hyperspeed.jsx`:
- Around line 592-597: The requestAnimationFrame loop is continuing to run even
when the Hyperspeed component is paused, causing unnecessary CPU wake-ups on
mobile devices. In the pause() method, you need to cancel the active
requestAnimationFrame by storing its ID and canceling it when paused becomes
true. In the resume() method (which currently only sets this.paused to false and
calls this.clock.getDelta()), you must explicitly restart the animation loop by
calling requestAnimationFrame again. Additionally, review the animation loop
code around lines 657-659 and 691-692 to ensure they check the this.paused state
before scheduling the next frame, preventing self-scheduling while paused.

In `@apps/web-dashboard/src/pages/Pricing.css`:
- Line 79: The `--nav-height` CSS variable used in the padding calculation for
`.pricing-main` is defined on `.nav-glass` in a different file, but since
`.pricing-main` is not a descendant of that element, the variable is out of
scope and the fallback value of 70px is always used. To fix this, move the
`--nav-height` variable definition to a parent container or root-level scope
that is accessible to both `.nav-glass` and `.pricing-main` so the variable can
be properly inherited and used consistently throughout the application.

---

Nitpick comments:
In `@apps/web-dashboard/src/pages/LandingPage/index.jsx`:
- Around line 715-726: The FAQ list rendering in the faq-list div is using the
array index as the React key when mapping over FAQ_ITEMS, which is not a stable
identifier. Replace the key={index} prop with a more stable key based on the FAQ
data itself, such as key={faq.q} if the question text is guaranteed to be
unique, or preferably add an id field to each item in the FAQ_ITEMS array and
use key={faq.id} instead. This will prevent potential issues if the FAQ items
are reordered or modified in the future.

In `@apps/web-dashboard/src/pages/LandingPage/style.css`:
- Around line 493-517: Add a fallback for the svh (small viewport height) values
used in the .hero-section class to ensure compatibility with older browsers.
Specifically, for the min-height property in the main .hero-section rule where
100svh is used, add 100vh as a fallback declaration before it. Similarly, in the
max-width: 768px media query where min-height uses calc(100svh - 1rem), add a
fallback of calc(100vh - 1rem) before the svh version. This can be done by
declaring the fallback property first, followed by the modern svh version,
allowing older browsers to gracefully degrade to the vh-based calculation.
🪄 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: 46885357-7082-4390-a967-ff944834c2d2

📥 Commits

Reviewing files that changed from the base of the PR and between 9ccebb3 and 1b22f81.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (9)
  • apps/web-dashboard/src/App.jsx
  • apps/web-dashboard/src/components/Hyperspeed/Hyperspeed.jsx
  • apps/web-dashboard/src/components/Layout/ScrollToTop.jsx
  • apps/web-dashboard/src/hooks/useInView.js
  • apps/web-dashboard/src/hooks/usePrefersReducedMotion.js
  • apps/web-dashboard/src/pages/LandingPage/index.jsx
  • apps/web-dashboard/src/pages/LandingPage/style.css
  • apps/web-dashboard/src/pages/Pricing.css
  • apps/web-dashboard/src/pages/Pricing.jsx

Comment thread apps/web-dashboard/src/components/Hyperspeed/Hyperspeed.jsx
Comment thread apps/web-dashboard/src/pages/Pricing.css Outdated
@yash-pouranik

Copy link
Copy Markdown
Member

please resolve coderabbit comments
@Ingole712521

@Ingole712521

Copy link
Copy Markdown
Contributor Author

i will resolved it soon

@yash-pouranik
yash-pouranik merged commit e9103f8 into geturbackend:main Jun 18, 2026
8 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.

fix: perf and responsiveness in Landing page.

2 participants