diff --git a/services/web/frontend/js/features/ide-react/context/outline-context.tsx b/services/web/frontend/js/features/ide-react/context/outline-context.tsx index 05409cf075..f69250a332 100644 --- a/services/web/frontend/js/features/ide-react/context/outline-context.tsx +++ b/services/web/frontend/js/features/ide-react/context/outline-context.tsx @@ -15,6 +15,7 @@ import { isValidTeXFile } from '@/main/is-valid-tex-file' import localStorage from '@/infrastructure/local-storage' import { useProjectContext } from '@/shared/context/project-context' import { useEditorOpenDocContext } from '@/features/ide-react/context/editor-open-doc-context' +import { useFileTreeOpenContext } from './file-tree-open-context' export type PartialFlatOutline = { level: number @@ -126,6 +127,9 @@ export const OutlineProvider: FC = ({ children }) => { [openDocName] ) + const { selectedEntityCount } = useFileTreeOpenContext() + const hasSingleEntityOpen = selectedEntityCount === 1 + const { projectId } = useProjectContext() const storageKey = `file_outline.expanded.${projectId}` @@ -133,7 +137,7 @@ export const OutlineProvider: FC = ({ children }) => { () => localStorage.getItem(storageKey) !== false ) - const canShowOutline = isTexFile && !binaryFileOpened + const canShowOutline = hasSingleEntityOpen && isTexFile && !binaryFileOpened const expandOutline = useCallback(() => { if (canShowOutline) {