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: fix the sorting menu item display position (#3314)

白熱3f18a4f61c02
diff --git a/packages/sheets-sort-ui/src/controllers/menu.schema.ts b/packages/sheets-sort-ui/src/controllers/menu.schema.ts
index 35684ed489..0219d53505 100644
--- a/packages/sheets-sort-ui/src/controllers/menu.schema.ts
+++ b/packages/sheets-sort-ui/src/controllers/menu.schema.ts
@@ -15,7 +15,7 @@
*/
import type { MenuSchemaType } from '@univerjs/ui';
-import { ContextMenuGroup, RibbonStartGroup } from '@univerjs/ui';
+import { ContextMenuGroup, ContextMenuPosition, RibbonStartGroup } from '@univerjs/ui';
import {
SortRangeAscCommand,
SortRangeAscExtCommand,
@@ -70,29 +70,31 @@ export const menuSchema: MenuSchemaType = {
},
},
},
- [ContextMenuGroup.DATA]: {
- [SHEETS_SORT_CTX_MENU_ID]: {
- order: 0,
- menuItemFactory: sortRangeCtxMenuFactory,
- [SortRangeAscInCtxMenuCommand.id]: {
+ [ContextMenuPosition.MAIN_AREA]: {
+ [ContextMenuGroup.DATA]: {
+ [SHEETS_SORT_CTX_MENU_ID]: {
order: 0,
- menuItemFactory: sortRangeAscCtxMenuFactory,
- },
- [SortRangeAscExtInCtxMenuCommand.id]: {
- order: 1,
- menuItemFactory: sortRangeAscExtCtxMenuFactory,
- },
- [SortRangeDescInCtxMenuCommand.id]: {
- order: 2,
- menuItemFactory: sortRangeDescCtxMenuFactory,
- },
- [SortRangeDescExtInCtxMenuCommand.id]: {
- order: 3,
- menuItemFactory: sortRangeDescExtCtxMenuFactory,
- },
- [SortRangeCustomInCtxMenuCommand.id]: {
- order: 4,
- menuItemFactory: sortRangeCustomCtxMenuFactory,
+ menuItemFactory: sortRangeCtxMenuFactory,
+ [SortRangeAscInCtxMenuCommand.id]: {
+ order: 0,
+ menuItemFactory: sortRangeAscCtxMenuFactory,
+ },
+ [SortRangeAscExtInCtxMenuCommand.id]: {
+ order: 1,
+ menuItemFactory: sortRangeAscExtCtxMenuFactory,
+ },
+ [SortRangeDescInCtxMenuCommand.id]: {
+ order: 2,
+ menuItemFactory: sortRangeDescCtxMenuFactory,
+ },
+ [SortRangeDescExtInCtxMenuCommand.id]: {
+ order: 3,
+ menuItemFactory: sortRangeDescExtCtxMenuFactory,
+ },
+ [SortRangeCustomInCtxMenuCommand.id]: {
+ order: 4,
+ menuItemFactory: sortRangeCustomCtxMenuFactory,
+ },
},
},
},
diff --git a/packages/sheets-ui/src/controllers/menu.schema.ts b/packages/sheets-ui/src/controllers/menu.schema.ts
index 83bc488f22..52a2c7be20 100644
--- a/packages/sheets-ui/src/controllers/menu.schema.ts
+++ b/packages/sheets-ui/src/controllers/menu.schema.ts
@@ -41,7 +41,7 @@ import {
SetTextRotationCommand,
SetTextWrapCommand,
SetVerticalTextAlignCommand, SetWorksheetHideCommand,
- SetWorksheetRowIsAutoHeightCommand, SetWorksheetShowCommand,
+ SetWorksheetRowIsAutoHeightCommand,
} from '@univerjs/sheets';
import { SetOnceFormatPainterCommand } from '../commands/commands/set-format-painter.command';
import {
@@ -164,7 +164,7 @@ import {
HideSheetMenuItemFactory,
RenameSheetMenuItemFactory,
ShowMenuItemFactory,
- UnHideSheetMenuItemFactory,
+ // UnHideSheetMenuItemFactory,
} from './menu/sheet.menu';
export const menuSchema: MenuSchemaType = {
@@ -672,10 +672,10 @@ export const menuSchema: MenuSchemaType = {
order: 4,
menuItemFactory: HideSheetMenuItemFactory,
},
- [SetWorksheetShowCommand.id]: {
- order: 5,
- menuItemFactory: UnHideSheetMenuItemFactory,
- },
+ // [SetWorksheetShowCommand.id]: {
+ // order: 5,
+ // menuItemFactory: UnHideSheetMenuItemFactory,
+ // },
[ShowMenuListCommand.id]: {
order: 6,
menuItemFactory: ShowMenuItemFactory,