Fix AI demo workspace skill (#18575)
This PR fixes what allows to have a working demo workspace skill. - Skill updated many times into something that works - Fixed infinite loop in AI chat by memoizing ai-sdk output - Finished navigateToView implementation - Increased MAX_STEPS to 300 so the chat don't quit in the middle of a long running skill - Added CreateManyRelationFields
This commit is contained in:
+21
-13
@@ -15,7 +15,7 @@ import { useAtomComponentStateCallbackState } from '@/ui/utilities/state/jotai/h
|
||||
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
|
||||
|
||||
import { useStore } from 'jotai';
|
||||
import { useMemo } from 'react';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
import { computeRecordGqlOperationFilter } from 'twenty-shared/utils';
|
||||
|
||||
export const RecordTableEmptyHasNewRecordEffect = () => {
|
||||
@@ -79,20 +79,28 @@ export const RecordTableEmptyHasNewRecordEffect = () => {
|
||||
operationSignature,
|
||||
});
|
||||
|
||||
const handleObjectRecordOperation = (
|
||||
objectRecordOperationEventDetail: ObjectRecordOperationBrowserEventDetail,
|
||||
) => {
|
||||
const objectRecordOperation = objectRecordOperationEventDetail.operation;
|
||||
const handleObjectRecordOperation = useCallback(
|
||||
(
|
||||
objectRecordOperationEventDetail: ObjectRecordOperationBrowserEventDetail,
|
||||
) => {
|
||||
const objectRecordOperation = objectRecordOperationEventDetail.operation;
|
||||
|
||||
if (
|
||||
objectRecordOperation.type.includes('update') ||
|
||||
objectRecordOperation.type.includes('create')
|
||||
) {
|
||||
if (!isRecordTableInitialLoading && !recordTableHasRecords) {
|
||||
store.set(recordTableWentFromEmptyToNotEmptyCallbackState, true);
|
||||
if (
|
||||
objectRecordOperation.type.includes('update') ||
|
||||
objectRecordOperation.type.includes('create')
|
||||
) {
|
||||
if (!isRecordTableInitialLoading && !recordTableHasRecords) {
|
||||
store.set(recordTableWentFromEmptyToNotEmptyCallbackState, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
[
|
||||
recordTableHasRecords,
|
||||
isRecordTableInitialLoading,
|
||||
store,
|
||||
recordTableWentFromEmptyToNotEmptyCallbackState,
|
||||
],
|
||||
);
|
||||
|
||||
useListenToObjectRecordOperationBrowserEvent({
|
||||
onObjectRecordOperationBrowserEvent: handleObjectRecordOperation,
|
||||
|
||||
Reference in New Issue
Block a user