From 08b8a0cc60a82807983146bc7a9badc08ae0a6d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Bosi?= <71827178+bosiraphael@users.noreply.github.com> Date: Fri, 7 Feb 2025 15:33:02 +0100 Subject: [PATCH] Do not display back button at the root level of the command menu (#10073) Do not display back button at the root level of the command menu --- .../components/CommandMenuTopBar.tsx | 16 +++++++++------- .../__stories__/CommandMenu.stories.tsx | 11 ----------- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/packages/twenty-front/src/modules/command-menu/components/CommandMenuTopBar.tsx b/packages/twenty-front/src/modules/command-menu/components/CommandMenuTopBar.tsx index 0eb0598a5..4d1355657 100644 --- a/packages/twenty-front/src/modules/command-menu/components/CommandMenuTopBar.tsx +++ b/packages/twenty-front/src/modules/command-menu/components/CommandMenuTopBar.tsx @@ -126,13 +126,15 @@ export const CommandMenuTopBar = () => { {isCommandMenuV2Enabled && ( <> - ]} - onClick={() => { - goBackFromCommandMenu(); - }} - testId="command-menu-go-back-button" - /> + {commandMenuPage !== CommandMenuPages.Root && ( + ]} + onClick={() => { + goBackFromCommandMenu(); + }} + testId="command-menu-go-back-button" + /> + )} {isDefined(contextStoreCurrentObjectMetadataId) && commandMenuPage !== CommandMenuPages.SearchRecords ? ( { - const canvas = within(document.body); - const goBackButton = await canvas.findByTestId( - 'command-menu-go-back-button', - ); - await userEvent.click(goBackButton); - await expect(goBackButton).not.toBeVisible(); - }, -}; - export const ClickOnSearchRecordsAndGoBack: Story = { play: async () => { const canvas = within(document.body);