Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 43 additions & 1 deletion Frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions Frontend/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,39 @@ import CookiePolicy from "./pages/CookiePolicy";
import ScrollToTopOnRouteChange from "./components/shared/ScrollToTopOnRouteChange";
import Navbar from "./components/Navbar";
import { useEffect } from "react";
import Lenis from "@studio-freight/lenis";

Copilot AI Feb 20, 2026

Copy link

Choose a reason for hiding this comment

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

@studio-freight/lenis is marked deprecated in the lockfile; it has been renamed to lenis. Consider migrating the dependency/import to lenis to avoid relying on a deprecated package and to stay aligned with upstream docs/support.

Suggested change
import Lenis from "@studio-freight/lenis";
import Lenis from "lenis";

Copilot uses AI. Check for mistakes.

function App() {
const location = useLocation();

const hideFooterRoutes = ["/login", "/register"];
const hideFooter = hideFooterRoutes.includes(location.pathname);

// Initialize smooth scrolling with Lenis
useEffect(() => {
const lenis = new Lenis({
duration: 1.2,
easing: (t) => Math.min(1, 1.001 - Math.pow(2, -10 * t)),
Comment on lines +49 to +53

Copilot AI Feb 20, 2026

Copy link

Choose a reason for hiding this comment

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

This introduces a global Lenis instance, but several pages already create their own Lenis + RAF loop (e.g. Landing/AboutUs/ContactUs/PricingPage). Multiple simultaneous instances can fight over scroll state and create multiple RAF loops. Consider centralizing Lenis in one place (App/context/hook) and removing per-page initializations, or guarding so only one instance exists.

Copilot uses AI. Check for mistakes.
direction: "vertical",
gestureDirection: "vertical",
smooth: true,
Comment on lines +54 to +56

Copilot AI Feb 20, 2026

Copy link

Choose a reason for hiding this comment

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

The Lenis options here (e.g. direction, gestureDirection, smooth) don’t match the option keys used elsewhere in this repo for the same library (orientation, gestureOrientation, smoothWheel). If these keys are incorrect for the installed Lenis version they’ll be ignored, causing scrolling not to be configured as intended. Please align the option names with the working usage used in other pages.

Suggested change
direction: "vertical",
gestureDirection: "vertical",
smooth: true,
orientation: "vertical",
gestureOrientation: "vertical",
smoothWheel: true,

Copilot uses AI. Check for mistakes.
smoothTouch: false,
touchMultiplier: 2,
});

function raf(time) {
lenis.raf(time);
requestAnimationFrame(raf);
}

requestAnimationFrame(raf);

return () => {
Comment on lines +61 to +68

Copilot AI Feb 20, 2026

Copy link

Choose a reason for hiding this comment

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

The RAF loop isn’t cancellable. After unmount, requestAnimationFrame(raf) will keep running and may call lenis.raf after lenis.destroy(), causing leaks or errors. Store the RAF id (or use a running flag) and cancel/stop the loop in the cleanup.

Suggested change
function raf(time) {
lenis.raf(time);
requestAnimationFrame(raf);
}
requestAnimationFrame(raf);
return () => {
let rafId;
function raf(time) {
lenis.raf(time);
rafId = requestAnimationFrame(raf);
}
rafId = requestAnimationFrame(raf);
return () => {
if (rafId) {
cancelAnimationFrame(rafId);
}

Copilot uses AI. Check for mistakes.
lenis.destroy();
};
}, []);

useEffect(() => {
const hideNavbarRoutes = ["/dashboard", "/settings", "/pricing", "/career", "/terms", "/privacy", "/cookie-policy", "/interview-setup", "/auth/callback"];
const hideNavbar =
hideNavbarRoutes.includes(location.pathname) ||
Expand Down
Loading