Add search records actions to the command menu (#9892)

Closes https://github.com/twentyhq/core-team-issues/issues/253 and
https://github.com/twentyhq/core-team-issues/issues/256.

- Created `CommandMenuList`, a component used at the root level of the
command menu and inside the search page of the command menu
- Refactored record agnostic actions
- Added shortcuts to the action menu entries (`/` key for the search)
and updated the design of the shortcuts
- Reordered actions at the root level of the command menu


https://github.com/user-attachments/assets/e1339cc4-ef5d-45c5-a159-6817a54b92e9
This commit is contained in:
Raphaël Bosi
2025-01-29 18:23:40 +01:00
committed by GitHub
parent 03f3ccd060
commit ce296fae4f
52 changed files with 1539 additions and 1361 deletions
@@ -21,8 +21,7 @@ export const COMMAND_MENU_NAVIGATE_COMMANDS: { [key: string]: Command } = {
}),
label: 'Go to People',
type: CommandType.Navigate,
firstHotKey: 'G',
secondHotKey: 'P',
hotKeys: ['G', 'P'],
Icon: IconUser,
shouldCloseCommandMenuOnClick: true,
},
@@ -33,8 +32,7 @@ export const COMMAND_MENU_NAVIGATE_COMMANDS: { [key: string]: Command } = {
}),
label: 'Go to Companies',
type: CommandType.Navigate,
firstHotKey: 'G',
secondHotKey: 'C',
hotKeys: ['G', 'C'],
Icon: IconBuildingSkyscraper,
shouldCloseCommandMenuOnClick: true,
},
@@ -45,8 +43,7 @@ export const COMMAND_MENU_NAVIGATE_COMMANDS: { [key: string]: Command } = {
}),
label: 'Go to Opportunities',
type: CommandType.Navigate,
firstHotKey: 'G',
secondHotKey: 'O',
hotKeys: ['G', 'O'],
Icon: IconTargetArrow,
shouldCloseCommandMenuOnClick: true,
},
@@ -55,8 +52,7 @@ export const COMMAND_MENU_NAVIGATE_COMMANDS: { [key: string]: Command } = {
to: getSettingsPath(SettingsPath.ProfilePage),
label: 'Go to Settings',
type: CommandType.Navigate,
firstHotKey: 'G',
secondHotKey: 'S',
hotKeys: ['G', 'S'],
Icon: IconSettings,
shouldCloseCommandMenuOnClick: true,
},
@@ -67,8 +63,7 @@ export const COMMAND_MENU_NAVIGATE_COMMANDS: { [key: string]: Command } = {
}),
label: 'Go to Tasks',
type: CommandType.Navigate,
firstHotKey: 'G',
secondHotKey: 'T',
hotKeys: ['G', 'T'],
Icon: IconCheckbox,
shouldCloseCommandMenuOnClick: true,
},
@@ -2,7 +2,8 @@ import { RightDrawerCalendarEvent } from '@/activities/calendar/right-drawer/com
import { RightDrawerAIChat } from '@/activities/copilot/right-drawer/components/RightDrawerAIChat';
import { RightDrawerEmailThread } from '@/activities/emails/right-drawer/components/RightDrawerEmailThread';
import { CommandMenu } from '@/command-menu/components/CommandMenu';
import { CommandMenuPages } from '@/command-menu/components/CommandMenuPages';
import { CommandMenuSearchRecordsPage } from '@/command-menu/pages/components/CommandMenuSearchRecordsPage';
import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';
import { RightDrawerRecord } from '@/object-record/record-right-drawer/components/RightDrawerRecord';
import { RightDrawerWorkflowEditStep } from '@/workflow/workflow-steps/components/RightDrawerWorkflowEditStep';
import { RightDrawerWorkflowViewStep } from '@/workflow/workflow-steps/components/RightDrawerWorkflowViewStep';
@@ -28,4 +29,5 @@ export const COMMAND_MENU_PAGES_CONFIG = new Map<
],
[CommandMenuPages.WorkflowStepEdit, <RightDrawerWorkflowEditStep />],
[CommandMenuPages.WorkflowStepView, <RightDrawerWorkflowViewStep />],
[CommandMenuPages.SearchRecords, <CommandMenuSearchRecordsPage />],
]);
@@ -0,0 +1 @@
export const RESET_CONTEXT_TO_SELECTION = 'reset-context-to-selection';