Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

fix(sheets-table-ui): hide table entry in Zen mode (#5374)

白熱b96c16db645e
diff --git a/packages/sheets-table-ui/src/views/menu.ts b/packages/sheets-table-ui/src/views/menu.ts
index 07b77b845d..bf6fa462f5 100644
--- a/packages/sheets-table-ui/src/views/menu.ts
+++ b/packages/sheets-table-ui/src/views/menu.ts
@@ -21,7 +21,7 @@ import { IUniverInstanceService, UniverInstanceType } from '@univerjs/core';
import { SheetsSelectionsService } from '@univerjs/sheets';
import { SheetsTableController, SheetTableInsertColCommand, SheetTableInsertRowCommand, SheetTableRemoveColCommand, SheetTableRemoveRowCommand } from '@univerjs/sheets-table';
import { getCurrentRangeDisable$ } from '@univerjs/sheets-ui';
-import { MenuItemType } from '@univerjs/ui';
+import { getMenuHiddenObservable, MenuItemType } from '@univerjs/ui';
import { of, switchMap } from 'rxjs';
import { OpenTableSelectorOperation } from '../commands/operations/open-table-selector.operation';
import { TABLE_TOOLBAR_BUTTON } from '../const';
@@ -36,6 +36,7 @@ export function sheetTableToolbarInsertMenuFactory(accessor: IAccessor): IMenuIt
icon: TABLE_TOOLBAR_BUTTON,
tooltip: 'sheets-table.title',
title: 'sheets-table.title',
+ hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SHEET),
disabled$: getCurrentRangeDisable$(accessor, {}, true),
};
}