Link command menu items to specific page layout (#19706)

- Add a `pageLayoutId` foreign key to `CommandMenuItem`, allowing
command menu items to be scoped to a specific page layout instead of
being globally available
- Filter command menu items by the current page layout on the frontend.
Items with a `pageLayoutId` only appear when viewing that layout, while
items without one remain globally visible
- Create an effect to track the current page layout ID
- Include a seed example: a "Show Notification" command pinned to the
Star history standalone page layout

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Raphaël Bosi
2026-04-16 14:07:36 +02:00
committed by GitHub
parent 7af82fb6a4
commit 2b5b8a8b13
39 changed files with 342 additions and 51 deletions
@@ -30,7 +30,7 @@ export class CreateCommandMenuItemActionHandlerService extends WorkspaceMigratio
flatApplication,
workspaceId,
}: WorkspaceMigrationActionRunnerArgs<UniversalCreateCommandMenuItemAction>): Promise<FlatCreateCommandMenuItemAction> {
const { availabilityObjectMetadataId, frontComponentId } =
const { availabilityObjectMetadataId, frontComponentId, pageLayoutId } =
resolveUniversalRelationIdentifiersToIds({
flatEntityMaps: allFlatEntityMaps,
metadataName: action.metadataName,
@@ -48,6 +48,7 @@ export class CreateCommandMenuItemActionHandlerService extends WorkspaceMigratio
...action.flatEntity,
availabilityObjectMetadataId,
frontComponentId,
pageLayoutId,
applicationId: flatApplication.id,
id: action.id ?? v4(),
workspaceId,