There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.
TypeScript appcrdteditorelectronknowledge-basemarkdownmironotesnotionnotion-alternativerustrust-langrust-languagetabletableviewwhiteboardwikiworkspace
feat(core): hide sidebar when sidebar is not visible (#11560)
EYHNe7d468453108
diff --git a/packages/frontend/core/src/modules/workbench/view/view-islands.tsx b/packages/frontend/core/src/modules/workbench/view/view-islands.tsxindex 87fa9d7a5f..259422cf03 100644--- a/packages/frontend/core/src/modules/workbench/view/view-islands.tsx+++ b/packages/frontend/core/src/modules/workbench/view/view-islands.tsx@@ -45,6 +45,7 @@ import {} from 'react';import { ViewService } from '../services/view';+import { WorkbenchService } from '../services/workbench';interface ViewIslandRegistry {[key: string]: Island | undefined;@@ -167,7 +168,12 @@ export const ViewSidebarTab = ({unmountOnInactive?: boolean;}>) => {const view = useService(ViewService).view;+ const workbench = useService(WorkbenchService).workbench;+ const sidebarOpened = useLiveData(workbench.sidebarOpen$);const activeTab = useLiveData(view.activeSidebarTab$);++ const isActive = activeTab?.id === tabId && sidebarOpened;+useEffect(() => {view.addSidebarTab(tabId);return () => {@@ -179,7 +185,7 @@ export const ViewSidebarTab = ({<><ViewIsland id={`${view.id}:sidebar:${tabId}:icon`}>{icon}</ViewIsland><ViewIsland id={`${view.id}:sidebar:${tabId}:body`}>- {unmountOnInactive && activeTab?.id !== tabId ? null : children}+ {unmountOnInactive && !isActive ? null : children}</ViewIsland></>);