google-labs-jules[bot] 1f21b7bcb9 Optimize Navbar resize handler with debounce
*   💡 **What:** Implemented a generic `debounce` utility and applied it to the `Navbar` component's window resize event listener (150ms delay). Added a `.cancel()` method to the debounce utility to prevent memory leaks/errors on unmount.
*   🎯 **Why:** The `resize` event fires rapidly, causing `getBoundingClientRect` (a layout-thrashing operation) to run excessively, impacting performance.
*   📊 **Measured Improvement:** In a benchmark test simulating 100 rapid resize events:
    *   **Baseline:** 200 calls to `getBoundingClientRect`.
    *   **Optimized:** 2 calls to `getBoundingClientRect`.
    *   **Result:** ~99% reduction in layout calculations during rapid resizing.
    *   Added `src/components/layout/Navbar.perf.test.tsx` to prevent regression.
2026-01-24 10:07:28 +00:00
2026-01-23 17:19:35 +01:00
2026-01-21 21:38:41 +01:00
2026-01-22 00:37:45 +01:00
2026-01-23 12:24:45 +01:00
Description
No description provided
1.3 MiB
Languages
TypeScript 79.1%
CSS 20.3%
HTML 0.6%