🐛 fix(sidebar): 延长连接树滚动条显示时间

This commit is contained in:
AutumnNazi
2026-08-10 14:46:50 +08:00
parent 5c96d4a466
commit f66c7d00b8
2 changed files with 4 additions and 1 deletions

View File

@@ -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,

View File

@@ -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<HTMLDivElement>) => {