From 72975abef09a9aa0ccda506b44c009f4ef11e32b Mon Sep 17 00:00:00 2001 From: Sychev Andrey <44414066+SychevAndrey@users.noreply.github.com> Date: Thu, 25 Sep 2025 12:17:23 +0200 Subject: [PATCH] dbeaver/pro#6142 fix: can't expand nodes using filter (#3773) If folder node had not been loaded before the filter is used, we would get into situation that filtering manually expanding this node without children and we would loose the ability to load them by expanding by click(our main flow is to load on expand). This fix removes the auto expanding on filtering. Now it works similarly to the main navigation tree with filters --- .../src/TreeNew/useTreeFilter.ts | 14 +++++++++----- .../src/TreeNew/useTreeMenu.ts | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/webapp/packages/plugin-navigation-tree/src/TreeNew/useTreeFilter.ts b/webapp/packages/plugin-navigation-tree/src/TreeNew/useTreeFilter.ts index 1f83e46b20..88e238fb12 100644 --- a/webapp/packages/plugin-navigation-tree/src/TreeNew/useTreeFilter.ts +++ b/webapp/packages/plugin-navigation-tree/src/TreeNew/useTreeFilter.ts @@ -29,8 +29,12 @@ export function useTreeFilter(options: ITreeFilterOptions = {}): Readonly(); - function hasMatchingDescendant( - treeData: ITreeData, nodeId: string, filter: string, matchFn: (treeData: ITreeData, nodeId: string) => boolean): boolean { + function matchesOrHasMatchingDescendant( + treeData: ITreeData, + nodeId: string, + filter: string, + matchFn: (treeData: ITreeData, nodeId: string) => boolean, + ): boolean { const cacheKey = `${nodeId}:${filter}`; if (matchCache.has(cacheKey)) { return matchCache.get(cacheKey)!; @@ -43,7 +47,7 @@ export function useTreeFilter(options: ITreeFilterOptions = {}): Readonly { const state = useObservableRef( () => ({ - openMenu(event: React.MouseEvent, nodeId: string) { + openMenu(event: React.MouseEvent, nodeId: string) { this.menu.context.deleteForId(this.id); this.menu.context.set(DATA_CONTEXT_NAV_NODE_ID, nodeId, this.id);