Feat: Agent chat multi thread support (#13216)
Co-authored-by: Raphaël Bosi <71827178+bosiraphael@users.noreply.github.com> Co-authored-by: neo773 <62795688+neo773@users.noreply.github.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: Félix Malfait <felix.malfait@gmail.com> Co-authored-by: Félix Malfait <felix@twenty.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions <github-actions@twenty.com> Co-authored-by: MD Readul Islam <99027968+readul-islam@users.noreply.github.com> Co-authored-by: readul-islam <developer.readul@gamil.com> Co-authored-by: Thomas des Francs <tdesfrancs@gmail.com> Co-authored-by: Guillim <guillim@users.noreply.github.com> Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com> Co-authored-by: Jean-Baptiste Ronssin <65334819+jbronssin@users.noreply.github.com> Co-authored-by: kahkashan shaik <93042682+kahkashanshaik@users.noreply.github.com> Co-authored-by: martmull <martmull@hotmail.fr> Co-authored-by: Paul Rastoin <45004772+prastoin@users.noreply.github.com> Co-authored-by: bosiraphael <raphael.bosi@gmail.com> Co-authored-by: Naifer <161821705+omarNaifer12@users.noreply.github.com> Co-authored-by: Marie Stoppa <marie.stoppa@essec.edu>
This commit is contained in:
@ -3,6 +3,8 @@ import { ActionConfigContext } from '@/action-menu/contexts/ActionConfigContext'
|
||||
import { useNavigateCommandMenu } from '@/command-menu/hooks/useNavigateCommandMenu';
|
||||
import { commandMenuSearchState } from '@/command-menu/states/commandMenuSearchState';
|
||||
import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';
|
||||
import { MessageDescriptor } from '@lingui/core';
|
||||
import { t } from '@lingui/core/macro';
|
||||
import { useContext } from 'react';
|
||||
import { useSetRecoilState } from 'recoil';
|
||||
import { IconComponent } from 'twenty-ui/display';
|
||||
@ -15,7 +17,7 @@ export const ActionOpenSidePanelPage = ({
|
||||
shouldResetSearchState = false,
|
||||
}: {
|
||||
page: CommandMenuPages;
|
||||
pageTitle: string;
|
||||
pageTitle: MessageDescriptor;
|
||||
pageIcon: IconComponent;
|
||||
onClick?: () => void;
|
||||
shouldResetSearchState?: boolean;
|
||||
@ -35,7 +37,7 @@ export const ActionOpenSidePanelPage = ({
|
||||
|
||||
navigateCommandMenu({
|
||||
page,
|
||||
pageTitle,
|
||||
pageTitle: t(pageTitle),
|
||||
pageIcon,
|
||||
});
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@ import { ActionType } from '@/action-menu/actions/types/ActionType';
|
||||
import { ActionViewType } from '@/action-menu/actions/types/ActionViewType';
|
||||
import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';
|
||||
import { msg } from '@lingui/core/macro';
|
||||
import { IconSearch, IconSparkles } from 'twenty-ui/display';
|
||||
import { IconHistory, IconSearch, IconSparkles } from 'twenty-ui/display';
|
||||
|
||||
export const RECORD_AGNOSTIC_ACTIONS_CONFIG: Record<string, ActionConfig> = {
|
||||
[RecordAgnosticActionsKeys.SEARCH_RECORDS]: {
|
||||
@ -22,7 +22,7 @@ export const RECORD_AGNOSTIC_ACTIONS_CONFIG: Record<string, ActionConfig> = {
|
||||
component: (
|
||||
<ActionOpenSidePanelPage
|
||||
page={CommandMenuPages.SearchRecords}
|
||||
pageTitle="Search"
|
||||
pageTitle={msg`Search`}
|
||||
pageIcon={IconSearch}
|
||||
shouldResetSearchState={true}
|
||||
/>
|
||||
@ -43,7 +43,7 @@ export const RECORD_AGNOSTIC_ACTIONS_CONFIG: Record<string, ActionConfig> = {
|
||||
component: (
|
||||
<ActionOpenSidePanelPage
|
||||
page={CommandMenuPages.SearchRecords}
|
||||
pageTitle="Search"
|
||||
pageTitle={msg`Search`}
|
||||
pageIcon={IconSearch}
|
||||
/>
|
||||
),
|
||||
@ -63,11 +63,30 @@ export const RECORD_AGNOSTIC_ACTIONS_CONFIG: Record<string, ActionConfig> = {
|
||||
component: (
|
||||
<ActionOpenSidePanelPage
|
||||
page={CommandMenuPages.AskAI}
|
||||
pageTitle="Ask AI"
|
||||
pageTitle={msg`Ask AI`}
|
||||
pageIcon={IconSparkles}
|
||||
/>
|
||||
),
|
||||
hotKeys: ['@'],
|
||||
shouldBeRegistered: () => true,
|
||||
},
|
||||
[RecordAgnosticActionsKeys.VIEW_PREVIOUS_AI_CHATS]: {
|
||||
type: ActionType.Standard,
|
||||
scope: ActionScope.Global,
|
||||
key: RecordAgnosticActionsKeys.VIEW_PREVIOUS_AI_CHATS,
|
||||
label: msg`View Previous AI Chats`,
|
||||
shortLabel: msg`Previous AI Chats`,
|
||||
position: 3,
|
||||
isPinned: false,
|
||||
Icon: IconHistory,
|
||||
availableOn: [ActionViewType.GLOBAL],
|
||||
component: (
|
||||
<ActionOpenSidePanelPage
|
||||
page={CommandMenuPages.ViewPreviousAIChats}
|
||||
pageTitle={msg`View Previous AI Chats`}
|
||||
pageIcon={IconSparkles}
|
||||
/>
|
||||
),
|
||||
shouldBeRegistered: () => true,
|
||||
},
|
||||
};
|
||||
|
||||
@ -19,6 +19,10 @@ export const useRecordAgnosticActions = () => {
|
||||
if (isAiEnabled) {
|
||||
actions[RecordAgnosticActionsKeys.ASK_AI] =
|
||||
RECORD_AGNOSTIC_ACTIONS_CONFIG[RecordAgnosticActionsKeys.ASK_AI];
|
||||
actions[RecordAgnosticActionsKeys.VIEW_PREVIOUS_AI_CHATS] =
|
||||
RECORD_AGNOSTIC_ACTIONS_CONFIG[
|
||||
RecordAgnosticActionsKeys.VIEW_PREVIOUS_AI_CHATS
|
||||
];
|
||||
}
|
||||
|
||||
return actions;
|
||||
|
||||
@ -2,4 +2,5 @@ export enum RecordAgnosticActionsKeys {
|
||||
SEARCH_RECORDS = 'search-records',
|
||||
SEARCH_RECORDS_FALLBACK = 'search-records-fallback',
|
||||
ASK_AI = 'ask-ai',
|
||||
VIEW_PREVIOUS_AI_CHATS = 'view-previous-ai-chats',
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user