From 99ec41bd870c9195ba18831e4275ed90fbc0b635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Guti=C3=A9rrez?= <35082514+alezmad@users.noreply.github.com> Date: Sat, 28 Feb 2026 16:55:24 +0000 Subject: [PATCH] fix: improve mobile scroll performance and accessibility Remove global smooth scroll (caused laggy feel), use solid header bg on mobile instead of backdrop-blur, respect prefers-reduced-motion, and add targeted smooth scroll only for anchor nav clicks. Co-Authored-By: Claude Opus 4.6 --- apps/web/src/modules/common/turbo-link.tsx | 17 +++++++++++++++++ .../modules/marketing/layout/header/header.tsx | 2 +- packages/ui/web/src/styles/globals.css | 15 +++++++++++++-- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/apps/web/src/modules/common/turbo-link.tsx b/apps/web/src/modules/common/turbo-link.tsx index e8ab1c6..8fc731a 100644 --- a/apps/web/src/modules/common/turbo-link.tsx +++ b/apps/web/src/modules/common/turbo-link.tsx @@ -8,6 +8,7 @@ import type { ComponentProps } from "react"; type TurboLinkProps = ComponentProps; export const TurboLink = ({ + onClick, onMouseEnter, onPointerEnter, onTouchStart, @@ -25,10 +26,26 @@ export const TurboLink = ({ } }; + const handleClick = (e: React.MouseEvent) => { + onClick?.(e); + if (e.defaultPrevented) return; + + const hash = strHref?.split("#")[1]; + if (hash) { + const el = document.getElementById(hash); + if (el) { + e.preventDefault(); + el.scrollIntoView({ behavior: "smooth" }); + window.history.pushState(null, "", `#${hash}`); + } + } + }; + return ( { conditionalPrefetch(); onMouseEnter?.(e); diff --git a/apps/web/src/modules/marketing/layout/header/header.tsx b/apps/web/src/modules/marketing/layout/header/header.tsx index a467573..3e4dba2 100644 --- a/apps/web/src/modules/marketing/layout/header/header.tsx +++ b/apps/web/src/modules/marketing/layout/header/header.tsx @@ -35,7 +35,7 @@ export const Header = () => { const { t } = useTranslation("marketing"); return ( -
+