From f35900d8623907abeb3cfac3132ea3c28ae80e70 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 27 Oct 2026 19:37:06 +0000 Subject: [PATCH 1/2] fix(nav): Do not reset click counter when reaching 5 to allow for >5 rapid clicks to route to debug. --- app/src/layouts/NavBar.test.tsx | 18 ++++++++++++++++++ app/src/layouts/NavBar.tsx | 2 -- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/src/layouts/NavBar.test.tsx b/app/src/layouts/NavBar.test.tsx index c9f70d45ea3..9fc91706241 100644 --- a/app/src/layouts/NavBar.test.tsx +++ b/app/src/layouts/NavBar.test.tsx @@ -61,4 +61,22 @@ describe('NavBar', () => { }); expect(navigate).toHaveBeenCalledWith('/plots?focus=search'); }); + + it('navigates to debug on 5 clicks and stays there on 6', async () => { + const user = userEvent.setup(); + const { container } = render(); + + // 5 clicks + for (let i = 0; i < 5; i++) { + await user.click(container.querySelector('a[href="/"]')!); + } + expect(navigate).toHaveBeenCalledWith('/debug'); + navigate.mockClear(); + + // 1 more click (6 total) within the time window + await user.click(container.querySelector('a[href="/"]')!); + + // should still navigate to debug, preventing default link to / + expect(navigate).toHaveBeenCalledWith('/debug'); + }); }); diff --git a/app/src/layouts/NavBar.tsx b/app/src/layouts/NavBar.tsx index 16475be33f7..f01a51285d6 100644 --- a/app/src/layouts/NavBar.tsx +++ b/app/src/layouts/NavBar.tsx @@ -102,8 +102,6 @@ export function NavBar() { }, DEBUG_CLICK_WINDOW_MS); if (clickCountRef.current >= DEBUG_CLICK_COUNT) { e.preventDefault(); - clickCountRef.current = 0; - if (clickTimerRef.current) clearTimeout(clickTimerRef.current); navigate(paths.debug); } }, From 654b373dcc5adb96a3bd685c1564e8cdc69db407 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 27 Oct 2026 19:42:18 +0000 Subject: [PATCH 2/2] chore: Add changelog fragment for nav bar click bug fix --- changelog.d/navbar-debug-click-fix.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changelog.d/navbar-debug-click-fix.md diff --git a/changelog.d/navbar-debug-click-fix.md b/changelog.d/navbar-debug-click-fix.md new file mode 100644 index 00000000000..35493935eb1 --- /dev/null +++ b/changelog.d/navbar-debug-click-fix.md @@ -0,0 +1,3 @@ +### Fixed + +- **NavBar debug rapid clicks.** Fixed an issue where clicking the logo a 6th time rapidly navigated to home instead of staying in debug. The counter no longer resets when reaching 5 clicks.