From f66c7d00b8336f712bb38e2dea6ba7982b89c7ec Mon Sep 17 00:00:00 2001 From: AutumnNazi <104422820+AutumnNazi@users.noreply.github.com> Date: Mon, 10 Aug 2026 14:46:50 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(sidebar):=20=E5=BB=B6?= =?UTF-8?q?=E9=95=BF=E8=BF=9E=E6=8E=A5=E6=A0=91=E6=BB=9A=E5=8A=A8=E6=9D=A1?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/Sidebar.locate-toolbar.test.tsx | 2 ++ frontend/src/components/Sidebar.tsx | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/Sidebar.locate-toolbar.test.tsx b/frontend/src/components/Sidebar.locate-toolbar.test.tsx index 533212dc..338884aa 100644 --- a/frontend/src/components/Sidebar.locate-toolbar.test.tsx +++ b/frontend/src/components/Sidebar.locate-toolbar.test.tsx @@ -1186,6 +1186,8 @@ describe('Sidebar locate toolbar', () => { expect(source).toContain('onWheelCapture={handleTreeWheel}'); expect(source).toContain('onTouchMoveCapture={markTreeScrollActivity}'); expect(source).toContain('setIsTreeScrolling(false)'); + expect(source).toContain('SIDEBAR_TREE_SCROLL_IDLE_DELAY_MS = 2000'); + expect(source).toContain('}, SIDEBAR_TREE_SCROLL_IDLE_DELAY_MS);'); const idleScrollbarCss = readCssRuleBlock( css, diff --git a/frontend/src/components/Sidebar.tsx b/frontend/src/components/Sidebar.tsx index c5b3e5ed..f3bfaeaf 100644 --- a/frontend/src/components/Sidebar.tsx +++ b/frontend/src/components/Sidebar.tsx @@ -335,6 +335,7 @@ const SIDEBAR_LOCATE_LOAD_WAIT_ATTEMPTS = 160; const SIDEBAR_CACHED_DATABASE_TREE_LIMIT = 12; const NACOS_SERVICES_CHANGED_EVENT = 'gonavi:nacos-services-changed'; const SIDEBAR_GROUP_HOVER_EXPAND_DELAY_MS = 500; +const SIDEBAR_TREE_SCROLL_IDLE_DELAY_MS = 2000; type SidebarTreeDragEventLike = { dataTransfer?: DataTransfer | null; @@ -1048,7 +1049,7 @@ const Sidebar: React.FC<{ treeScrollIdleTimerRef.current = window.setTimeout(() => { treeScrollIdleTimerRef.current = null; setIsTreeScrolling(false); - }, 500); + }, SIDEBAR_TREE_SCROLL_IDLE_DELAY_MS); }, [isV2Ui]); const handleTreeWheel = useCallback((event: React.WheelEvent) => {