[FRONT COMPONENTS] Add loader to command menu items (#18165)

## PR description

- Add a loader to the command menu items when the action is running.
- Add a new method `closeSidePanel` to the front component host api.

## Video QA


https://github.com/user-attachments/assets/c20b592a-6e4c-4cab-b5da-4cb2316acc7c
This commit is contained in:
Raphaël Bosi
2026-02-23 11:15:45 +01:00
committed by GitHub
parent 129d1ede86
commit 22bc3004b9
12 changed files with 117 additions and 5 deletions
@@ -2,6 +2,7 @@ import { Action } from '@/action-menu/actions/components/Action';
import { ActionScope } from '@/action-menu/actions/types/ActionScope';
import { ActionType } from '@/action-menu/actions/types/ActionType';
import { ActionMenuContext } from '@/action-menu/contexts/ActionMenuContext';
import { HeadlessFrontComponentAction } from '@/action-menu/actions/display/components/HeadlessFrontComponentAction';
import { useOpenFrontComponentInCommandMenu } from '@/command-menu/hooks/useOpenFrontComponentInCommandMenu';
import { contextStoreCurrentObjectMetadataItemIdComponentState } from '@/context-store/states/contextStoreCurrentObjectMetadataItemIdComponentState';
import { contextStoreIsPageInEditModeComponentState } from '@/context-store/states/contextStoreIsPageInEditModeComponentState';
@@ -76,11 +77,13 @@ const buildActionFromItem = ({
isPinned,
Icon,
shouldBeRegistered: () => true,
component: (
<Action
component: isHeadless ? (
<HeadlessFrontComponentAction
frontComponentId={item.frontComponentId}
onClick={handleClick}
closeSidePanelOnCommandMenuListActionExecution={isHeadless}
/>
) : (
<Action onClick={handleClick} />
),
};
};