From ee57a19866174dc82ab2b40e36c6b2bc26c5b889 Mon Sep 17 00:00:00 2001 From: Abdul Rahman Date: Thu, 5 Feb 2026 10:53:21 +0530 Subject: [PATCH] Remove CommandMenuEditFolderRenameSubView Component - Deleted the `CommandMenuEditFolderRenameSubView` component from the command menu, streamlining the editing interface. - Updated `CommandMenuNavigationMenuItemEditPage` to remove references to the deleted component, enhancing code clarity and maintainability. These changes simplify the command menu structure and improve overall code organization. --- .../CommandMenuEditFolderRenameSubView.tsx | 47 ------------------- ...mmandMenuEditObjectPickerSystemSubView.tsx | 1 - .../CommandMenuNavigationMenuItemEditPage.tsx | 15 ------ 3 files changed, 63 deletions(-) delete mode 100644 packages/twenty-front/src/modules/command-menu/pages/navigation-menu-item/components/CommandMenuEditFolderRenameSubView.tsx diff --git a/packages/twenty-front/src/modules/command-menu/pages/navigation-menu-item/components/CommandMenuEditFolderRenameSubView.tsx b/packages/twenty-front/src/modules/command-menu/pages/navigation-menu-item/components/CommandMenuEditFolderRenameSubView.tsx deleted file mode 100644 index b8f844a2b9a..00000000000 --- a/packages/twenty-front/src/modules/command-menu/pages/navigation-menu-item/components/CommandMenuEditFolderRenameSubView.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import { useLingui } from '@lingui/react/macro'; -import { useState } from 'react'; - -import { CommandMenuSubViewWithSearch } from '@/command-menu/components/CommandMenuSubViewWithSearch'; -import { useUpdateNavigationMenuItemsDraft } from '@/navigation-menu-item/hooks/useUpdateNavigationMenuItemsDraft'; - -type CommandMenuEditFolderRenameSubViewProps = { - folderId: string; - onBack: () => void; - onSuccess: () => void; -}; - -export const CommandMenuEditFolderRenameSubView = ({ - folderId, - onBack, - onSuccess, -}: CommandMenuEditFolderRenameSubViewProps) => { - const { t } = useLingui(); - const [folderRenameInput, setFolderRenameInput] = useState(''); - const { updateFolderNameInDraft } = useUpdateNavigationMenuItemsDraft(); - - const handleRename = () => { - const trimmed = folderRenameInput.trim(); - if (trimmed.length > 0) { - updateFolderNameInDraft(folderId, trimmed); - setFolderRenameInput(''); - onSuccess(); - } - }; - - return ( - { - if (event.key === 'Enter' && folderRenameInput.trim().length > 0) { - handleRename(); - } - }, - }} - /> - ); -}; diff --git a/packages/twenty-front/src/modules/command-menu/pages/navigation-menu-item/components/CommandMenuEditObjectPickerSystemSubView.tsx b/packages/twenty-front/src/modules/command-menu/pages/navigation-menu-item/components/CommandMenuEditObjectPickerSystemSubView.tsx index 17443a72acd..6bd8c17688f 100644 --- a/packages/twenty-front/src/modules/command-menu/pages/navigation-menu-item/components/CommandMenuEditObjectPickerSystemSubView.tsx +++ b/packages/twenty-front/src/modules/command-menu/pages/navigation-menu-item/components/CommandMenuEditObjectPickerSystemSubView.tsx @@ -1,5 +1,4 @@ import { useLingui } from '@lingui/react/macro'; -import { IconSettings } from 'twenty-ui/display'; import { CommandGroup } from '@/command-menu/components/CommandGroup'; import { CommandMenuList } from '@/command-menu/components/CommandMenuList'; diff --git a/packages/twenty-front/src/modules/command-menu/pages/navigation-menu-item/components/CommandMenuNavigationMenuItemEditPage.tsx b/packages/twenty-front/src/modules/command-menu/pages/navigation-menu-item/components/CommandMenuNavigationMenuItemEditPage.tsx index a69839791dd..69be771a416 100644 --- a/packages/twenty-front/src/modules/command-menu/pages/navigation-menu-item/components/CommandMenuNavigationMenuItemEditPage.tsx +++ b/packages/twenty-front/src/modules/command-menu/pages/navigation-menu-item/components/CommandMenuNavigationMenuItemEditPage.tsx @@ -11,7 +11,6 @@ import { import { CommandMenuEditDefaultView } from '@/command-menu/pages/navigation-menu-item/components/CommandMenuEditDefaultView'; import { CommandMenuEditFolderItemView } from '@/command-menu/pages/navigation-menu-item/components/CommandMenuEditFolderItemView'; import { CommandMenuEditFolderPickerSubView } from '@/command-menu/pages/navigation-menu-item/components/CommandMenuEditFolderPickerSubView'; -import { CommandMenuEditFolderRenameSubView } from '@/command-menu/pages/navigation-menu-item/components/CommandMenuEditFolderRenameSubView'; import { CommandMenuEditLinkItemView } from '@/command-menu/pages/navigation-menu-item/components/CommandMenuEditLinkItemView'; import { CommandMenuEditObjectItemView } from '@/command-menu/pages/navigation-menu-item/components/CommandMenuEditObjectItemView'; import { CommandMenuEditObjectPickerSubView } from '@/command-menu/pages/navigation-menu-item/components/CommandMenuEditObjectPickerSubView'; @@ -55,7 +54,6 @@ export const CommandMenuNavigationMenuItemEditPage = () => { | 'object-picker-system' | 'folder-picker' | 'view-picker' - | 'folder-rename' | null >(null); const [ @@ -340,19 +338,6 @@ export const CommandMenuNavigationMenuItemEditPage = () => { ); } - if (editSubView === 'folder-rename' && selectedItem?.type === 'folder') { - return ( - setEditSubView(null)} - onSuccess={() => { - setEditSubView(null); - closeCommandMenu(); - }} - /> - ); - } - if (isObjectItem && selectedItem?.type === 'objectView') { return (