From 949a251553731fa481d140cc399d685f47d9b6bc Mon Sep 17 00:00:00 2001 From: vvzvlad Date: Sat, 20 Jun 2026 17:39:34 +0300 Subject: [PATCH] fix(tree): close the space menu after Expand all Expand all kept the menu open (closeMenuOnClick={false}) while Collapse all closed it. Make both close on click for consistent behavior, and drop the now-pointless in-menu isExpanding loading state. Co-Authored-By: Claude Opus 4.8 --- .../space/components/sidebar/space-sidebar.tsx | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/apps/client/src/features/space/components/sidebar/space-sidebar.tsx b/apps/client/src/features/space/components/sidebar/space-sidebar.tsx index 9ee98a50..b5b9a9c8 100644 --- a/apps/client/src/features/space/components/sidebar/space-sidebar.tsx +++ b/apps/client/src/features/space/components/sidebar/space-sidebar.tsx @@ -161,15 +161,11 @@ function SpaceMenu({ treeRef, }: SpaceMenuProps) { const { t } = useTranslation(); - const [isExpanding, setIsExpanding] = React.useState(false); - - const handleExpandAll = async () => { - setIsExpanding(true); - try { - await treeRef.current?.expandAll(); - } finally { - setIsExpanding(false); - } + const handleExpandAll = () => { + // Fire-and-forget: expandAll already surfaces its own error notification. + // The menu closes on click (consistent with Collapse all), so there is no + // in-menu loading state to track here. + treeRef.current?.expandAll(); }; const handleCollapseAll = () => { @@ -226,8 +222,6 @@ function SpaceMenu({ } > {t("Expand all")}