Optimize Navbar scroll listener with requestAnimationFrame #7

Merged
google-labs-jules[bot] merged 1 commits from perf/navbar-scroll-throttling-16938841465799544697 into main 2026-01-23 09:06:58 +00:00

1 Commits

Author SHA1 Message Date
google-labs-jules[bot]
8592775485 perf: throttle scroll event listener in Navbar
Implemented `requestAnimationFrame` throttling for the scroll event listener in `Navbar` to reduce the frequency of state updates and logic execution.

- Wrapped scroll handler in `requestAnimationFrame`.
- Added performance test `src/components/layout/Navbar.test.tsx` verifying logic runs once per frame instead of per event.
- Verified functional correctness of scroll state updates.
- Fixed `useTypingEffect` test environment.
2026-01-22 08:24:10 +00:00