The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Remove all legacy state management (#13476)
Lucas Bordeaud61eb1a95166
diff --git a/packages/twenty-front/src/modules/activities/components/ActivityRichTextEditor.tsx b/packages/twenty-front/src/modules/activities/components/ActivityRichTextEditor.tsxindex 118f716164e..14b83bb6831 100644--- a/packages/twenty-front/src/modules/activities/components/ActivityRichTextEditor.tsx+++ b/packages/twenty-front/src/modules/activities/components/ActivityRichTextEditor.tsx@@ -30,7 +30,7 @@ import { useLazyFetchAllRecords } from '@/object-record/hooks/useLazyFetchAllRecimport { useRestoreManyRecords } from '@/object-record/hooks/useRestoreManyRecords';import { useUpdateOneRecord } from '@/object-record/hooks/useUpdateOneRecord';import { useIsRecordReadOnly } from '@/object-record/record-field/hooks/useIsRecordReadOnly';-import { isInlineCellInEditModeScopedState } from '@/object-record/record-inline-cell/states/isInlineCellInEditModeScopedState';+import { isInlineCellInEditModeFamilyState } from '@/object-record/record-inline-cell/states/isInlineCellInEditModeFamilyState';import { useRecordShowContainerData } from '@/object-record/record-show/hooks/useRecordShowContainerData';import { getRecordFieldInputInstanceId } from '@/object-record/utils/getRecordFieldInputId';import { BlockEditor } from '@/ui/input/editor/components/BlockEditor';@@ -379,7 +379,7 @@ export const ActivityRichTextEditor = ({({ snapshot }) =>() => {const isRecordTitleCellOpen = snapshot- .getLoadable(isInlineCellInEditModeScopedState(recordTitleCellId))+ .getLoadable(isInlineCellInEditModeFamilyState(recordTitleCellId)).getValue();if (isRecordTitleCellOpen) {@@ -405,7 +405,7 @@ export const ActivityRichTextEditor = ({({ snapshot }) =>() => {const isRecordTitleCellOpen = snapshot- .getLoadable(isInlineCellInEditModeScopedState(recordTitleCellId))+ .getLoadable(isInlineCellInEditModeFamilyState(recordTitleCellId)).getValue();if (isRecordTitleCellOpen) {diff --git a/packages/twenty-front/src/modules/activities/files/components/AttachmentDropdown.tsx b/packages/twenty-front/src/modules/activities/files/components/AttachmentDropdown.tsxindex ab03f51e416..bba8ad4fd63 100644--- a/packages/twenty-front/src/modules/activities/files/components/AttachmentDropdown.tsx+++ b/packages/twenty-front/src/modules/activities/files/components/AttachmentDropdown.tsx@@ -16,16 +16,16 @@ type AttachmentDropdownProps = {onDownload: () => void;onDelete: () => void;onRename: () => void;- scopeKey: string;+ attachmentId: string;};export const AttachmentDropdown = ({onDownload,onDelete,onRename,- scopeKey,+ attachmentId,}: AttachmentDropdownProps) => {- const dropdownId = `${scopeKey}-settings-field-active-action-dropdown`;+ const dropdownId = `${attachmentId}-attachment-dropdown`;const { closeDropdown } = useCloseDropdown();diff --git a/packages/twenty-front/src/modules/activities/files/components/AttachmentRow.tsx b/packages/twenty-front/src/modules/activities/files/components/AttachmentRow.tsxindex 88029e02261..2903b87e7cc 100644--- a/packages/twenty-front/src/modules/activities/files/components/AttachmentRow.tsx+++ b/packages/twenty-front/src/modules/activities/files/components/AttachmentRow.tsx@@ -199,7 +199,7 @@ export const AttachmentRow = ({</StyledCalendarIconContainer>{formatToHumanReadableDate(attachment.createdAt)}<AttachmentDropdown- scopeKey={attachment.id}+ attachmentId={attachment.id}onDelete={handleDelete}onDownload={handleDownload}onRename={handleRename}diff --git a/packages/twenty-front/src/modules/activities/hooks/__tests__/useActivityTargetObjectRecords.test.tsx b/packages/twenty-front/src/modules/activities/hooks/__tests__/useActivityTargetObjectRecords.test.tsxindex 1384c328c61..c7a7e253722 100644--- a/packages/twenty-front/src/modules/activities/hooks/__tests__/useActivityTargetObjectRecords.test.tsx+++ b/packages/twenty-front/src/modules/activities/hooks/__tests__/useActivityTargetObjectRecords.test.tsx@@ -8,7 +8,7 @@ import { useActivityTargetObjectRecords } from '@/activities/hooks/useActivityTaimport { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';import { objectMetadataItemsState } from '@/object-metadata/states/objectMetadataItemsState';import { recordStoreFamilyState } from '@/object-record/record-store/states/recordStoreFamilyState';-import { SnackBarComponentInstanceContextProvider } from '@/ui/feedback/snack-bar-manager/scopes/SnackBarComponentInstanceContextProvider';+import { SnackBarComponentInstanceContext } from '@/ui/feedback/snack-bar-manager/contexts/SnackBarComponentInstanceContext';import { JestObjectMetadataItemSetter } from '~/testing/jest/JestObjectMetadataItemSetter';import { generatedMockObjectMetadataItems } from '~/testing/mock-data/generatedMockObjectMetadataItems';import { mockWorkspaceMembers } from '~/testing/mock-data/workspace-members';@@ -114,9 +114,11 @@ const Wrapper = ({ children }: { children: ReactNode }) => (<RecoilRoot><MockedProvider cache={cache}><JestObjectMetadataItemSetter>- <SnackBarComponentInstanceContextProvider snackBarComponentInstanceId="snack-bar-manager">+ <SnackBarComponentInstanceContext.Provider+ value={{ instanceId: 'snack-bar-manager' }}+ >{children}- </SnackBarComponentInstanceContextProvider>+ </SnackBarComponentInstanceContext.Provider></JestObjectMetadataItemSetter></MockedProvider></RecoilRoot>diff --git a/packages/twenty-front/src/modules/activities/tasks/components/ObjectTasks.tsx b/packages/twenty-front/src/modules/activities/tasks/components/ObjectTasks.tsxindex 755ef059bf5..b4d6285187c 100644--- a/packages/twenty-front/src/modules/activities/tasks/components/ObjectTasks.tsx+++ b/packages/twenty-front/src/modules/activities/tasks/components/ObjectTasks.tsx@@ -20,7 +20,7 @@ export const ObjectTasks = ({ targetableObject }: ObjectTasksProps) => {return (<StyledContainer><ObjectFilterDropdownComponentInstanceContext.Provider- value={{ instanceId: 'entity-tasks-filter-scope' }}+ value={{ instanceId: 'entity-tasks-filter-instance' }}><TaskGroups targetableObject={targetableObject} /></ObjectFilterDropdownComponentInstanceContext.Provider>diff --git a/packages/twenty-front/src/modules/activities/tasks/components/__stories__/TaskGroups.stories.tsx b/packages/twenty-front/src/modules/activities/tasks/components/__stories__/TaskGroups.stories.tsxindex d3cbba718eb..459e98e4603 100644--- a/packages/twenty-front/src/modules/activities/tasks/components/__stories__/TaskGroups.stories.tsx+++ b/packages/twenty-front/src/modules/activities/tasks/components/__stories__/TaskGroups.stories.tsx@@ -4,7 +4,6 @@ import { TaskGroups } from '@/activities/tasks/components/TaskGroups';import { ActivityTargetableObject } from '@/activities/types/ActivityTargetableEntity';import { ObjectFilterDropdownComponentInstanceContext } from '@/object-record/object-filter-dropdown/states/contexts/ObjectFilterDropdownComponentInstanceContext';import { TabListComponentInstanceContext } from '@/ui/layout/tab-list/states/contexts/TabListComponentInstanceContext';-import { ComponentWithRecoilScopeDecorator } from '~/testing/decorators/ComponentWithRecoilScopeDecorator';import { ComponentWithRouterDecorator } from '~/testing/decorators/ComponentWithRouterDecorator';import { I18nFrontDecorator } from '~/testing/decorators/I18nFrontDecorator';import { ObjectMetadataItemsDecorator } from '~/testing/decorators/ObjectMetadataItemsDecorator';@@ -18,17 +17,16 @@ const meta: Meta<typeof TaskGroups> = {decorators: [(Story) => (<TabListComponentInstanceContext.Provider- value={{ instanceId: 'entity-tasks-filter-scope' }}+ value={{ instanceId: 'entity-tasks-filter-instance' }}><ObjectFilterDropdownComponentInstanceContext.Provider- value={{ instanceId: 'entity-tasks-filter-scope' }}+ value={{ instanceId: 'entity-tasks-filter-instance' }}><Story /></ObjectFilterDropdownComponentInstanceContext.Provider></TabListComponentInstanceContext.Provider>),ComponentWithRouterDecorator,- ComponentWithRecoilScopeDecorator,ObjectMetadataItemsDecorator,SnackBarDecorator,I18nFrontDecorator,diff --git a/packages/twenty-front/src/modules/activities/tasks/hooks/__tests__/useTasks.test.tsx b/packages/twenty-front/src/modules/activities/tasks/hooks/__tests__/useTasks.test.tsxindex a01f814cfca..1de8c792c1b 100644--- a/packages/twenty-front/src/modules/activities/tasks/hooks/__tests__/useTasks.test.tsx+++ b/packages/twenty-front/src/modules/activities/tasks/hooks/__tests__/useTasks.test.tsx@@ -47,7 +47,7 @@ jest.mock('@/activities/hooks/useActivities', () => ({const Wrapper = ({ children }: { children: ReactNode }) => (<RecoilRoot><ObjectFilterDropdownComponentInstanceContext.Provider- value={{ instanceId: 'entity-tasks-filter-scope' }}+ value={{ instanceId: 'entity-tasks-filter-instance' }}>{children}</ObjectFilterDropdownComponentInstanceContext.Provider>diff --git a/packages/twenty-front/src/modules/apollo/hooks/__tests__/useApolloFactory.test.tsx b/packages/twenty-front/src/modules/apollo/hooks/__tests__/useApolloFactory.test.tsxindex d5a4c2b20f4..067c7cc4012 100644--- a/packages/twenty-front/src/modules/apollo/hooks/__tests__/useApolloFactory.test.tsx+++ b/packages/twenty-front/src/modules/apollo/hooks/__tests__/useApolloFactory.test.tsx@@ -4,7 +4,7 @@ import fetchMock, { enableFetchMocks } from 'jest-fetch-mock';import { MemoryRouter, useLocation } from 'react-router-dom';import { RecoilRoot } from 'recoil';-import { SnackBarComponentInstanceContextProvider } from '@/ui/feedback/snack-bar-manager/scopes/SnackBarComponentInstanceContextProvider';+import { SnackBarComponentInstanceContext } from '@/ui/feedback/snack-bar-manager/contexts/SnackBarComponentInstanceContext';import { useApolloFactory } from '../useApolloFactory';enableFetchMocks();@@ -26,9 +26,11 @@ const Wrapper = ({ children }: { children: React.ReactNode }) => (initialEntries={['/welcome', '/verify', '/opportunities']}initialIndex={2}>- <SnackBarComponentInstanceContextProvider snackBarComponentInstanceId="test-instance-id">+ <SnackBarComponentInstanceContext.Provider+ value={{ instanceId: 'test-instance-id' }}+ >{children}- </SnackBarComponentInstanceContextProvider>+ </SnackBarComponentInstanceContext.Provider></MemoryRouter></RecoilRoot>);diff --git a/packages/twenty-front/src/modules/app/components/App.tsx b/packages/twenty-front/src/modules/app/components/App.tsxindex cfccd1fa5a2..2974724317f 100644--- a/packages/twenty-front/src/modules/app/components/App.tsx+++ b/packages/twenty-front/src/modules/app/components/App.tsx@@ -4,7 +4,7 @@ import { RecoilDebugObserverEffect } from '@/debug/components/RecoilDebugObserveimport { AppErrorBoundary } from '@/error-handler/components/AppErrorBoundary';import { AppRootErrorFallback } from '@/error-handler/components/AppRootErrorFallback';import { ExceptionHandlerProvider } from '@/error-handler/components/ExceptionHandlerProvider';-import { SnackBarComponentInstanceContextProvider } from '@/ui/feedback/snack-bar-manager/scopes/SnackBarComponentInstanceContextProvider';+import { SnackBarComponentInstanceContext } from '@/ui/feedback/snack-bar-manager/contexts/SnackBarComponentInstanceContext';import { ClickOutsideListenerContext } from '@/ui/utilities/pointer-event/contexts/ClickOutsideListenerContext';import { i18n } from '@lingui/core';import { I18nProvider } from '@lingui/react';@@ -25,7 +25,9 @@ export const App = () => {<I18nProvider i18n={i18n}><RecoilDebugObserverEffect /><ApolloDevLogEffect />- <SnackBarComponentInstanceContextProvider snackBarComponentInstanceId="snack-bar-manager">+ <SnackBarComponentInstanceContext.Provider+ value={{ instanceId: 'snack-bar-manager' }}+ ><IconsProvider><ExceptionHandlerProvider><HelmetProvider>@@ -37,7 +39,7 @@ export const App = () => {</HelmetProvider></ExceptionHandlerProvider></IconsProvider>- </SnackBarComponentInstanceContextProvider>+ </SnackBarComponentInstanceContext.Provider></I18nProvider></AppErrorBoundary></RecoilRoot>diff --git a/packages/twenty-front/src/modules/app/components/AppRouterProviders.tsx b/packages/twenty-front/src/modules/app/components/AppRouterProviders.tsxindex c7d7015b473..dd08e368af9 100644--- a/packages/twenty-front/src/modules/app/components/AppRouterProviders.tsx+++ b/packages/twenty-front/src/modules/app/components/AppRouterProviders.tsx@@ -15,7 +15,7 @@ import { ObjectMetadataItemsLoadEffect } from '@/object-metadata/components/Objeimport { ObjectMetadataItemsProvider } from '@/object-metadata/components/ObjectMetadataItemsProvider';import { PrefetchDataProvider } from '@/prefetch/components/PrefetchDataProvider';import { DialogManager } from '@/ui/feedback/dialog-manager/components/DialogManager';-import { DialogManagerScope } from '@/ui/feedback/dialog-manager/scopes/DialogManagerScope';+import { DialogComponentInstanceContext } from '@/ui/feedback/dialog-manager/contexts/DialogComponentInstanceContext';import { SnackBarProvider } from '@/ui/feedback/snack-bar-manager/components/SnackBarProvider';import { BaseThemeProvider } from '@/ui/theme/components/BaseThemeProvider';import { UserThemeProviderEffect } from '@/ui/theme/components/UserThemeProviderEffect';@@ -51,7 +51,9 @@ export const AppRouterProviders = () => {<UserThemeProviderEffect /><SnackBarProvider><ErrorMessageEffect />- <DialogManagerScope dialogComponentInstanceId="dialog-manager">+ <DialogComponentInstanceContext.Provider+ value={{ instanceId: 'dialog-manager' }}+ ><DialogManager><StrictMode><PromiseRejectionEffect />@@ -61,7 +63,7 @@ export const AppRouterProviders = () => {<Outlet /></StrictMode></DialogManager>- </DialogManagerScope>+ </DialogComponentInstanceContext.Provider></SnackBarProvider><MainContextStoreProvider /></PrefetchDataProvider>diff --git a/packages/twenty-front/src/modules/auth/hooks/__tests__/useAuth.test.tsx b/packages/twenty-front/src/modules/auth/hooks/__tests__/useAuth.test.tsxindex e50db75b1f3..d37d1e0c5d1 100644--- a/packages/twenty-front/src/modules/auth/hooks/__tests__/useAuth.test.tsx+++ b/packages/twenty-front/src/modules/auth/hooks/__tests__/useAuth.test.tsx@@ -2,7 +2,7 @@ import { useAuth } from '@/auth/hooks/useAuth';import { billingState } from '@/client-config/states/billingState';import { isDeveloperDefaultSignInPrefilledState } from '@/client-config/states/isDeveloperDefaultSignInPrefilledState';import { supportChatState } from '@/client-config/states/supportChatState';-import { SnackBarComponentInstanceContextProvider } from '@/ui/feedback/snack-bar-manager/scopes/SnackBarComponentInstanceContextProvider';+import { workspaceAuthProvidersState } from '@/workspace/states/workspaceAuthProvidersState';import { useApolloClient } from '@apollo/client';import { MockedProvider } from '@apollo/client/testing';@@ -12,6 +12,7 @@ import { MemoryRouter } from 'react-router-dom';import { RecoilRoot, useRecoilValue } from 'recoil';import { isMultiWorkspaceEnabledState } from '@/client-config/states/isMultiWorkspaceEnabledState';+import { SnackBarComponentInstanceContext } from '@/ui/feedback/snack-bar-manager/contexts/SnackBarComponentInstanceContext';import { renderHook } from '@testing-library/react';import { iconsState } from 'twenty-ui/display';import { SupportDriver } from '~/generated/graphql';@@ -71,9 +72,11 @@ const Wrapper = ({ children }: { children: ReactNode }) => (<MockedProvider mocks={Object.values(mocks)} addTypename={false}><RecoilRoot><MemoryRouter>- <SnackBarComponentInstanceContextProvider snackBarComponentInstanceId="test-scope-id">+ <SnackBarComponentInstanceContext.Provider+ value={{ instanceId: 'test-instance-id' }}+ >{children}- </SnackBarComponentInstanceContextProvider>+ </SnackBarComponentInstanceContext.Provider></MemoryRouter></RecoilRoot></MockedProvider>diff --git a/packages/twenty-front/src/modules/command-menu/hooks/useOpenRecordInCommandMenu.ts b/packages/twenty-front/src/modules/command-menu/hooks/useOpenRecordInCommandMenu.tsindex cf5829e36c9..d81058d8d61 100644--- a/packages/twenty-front/src/modules/command-menu/hooks/useOpenRecordInCommandMenu.ts+++ b/packages/twenty-front/src/modules/command-menu/hooks/useOpenRecordInCommandMenu.ts@@ -15,7 +15,8 @@ import { objectMetadataItemFamilySelector } from '@/object-metadata/states/objecimport { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';import { getIconColorForObjectType } from '@/object-metadata/utils/getIconColorForObjectType';import { viewableRecordIdState } from '@/object-record/record-right-drawer/states/viewableRecordIdState';-import { getSnapshotValue } from '@/ui/utilities/recoil-scope/utils/getSnapshotValue';+import { getSnapshotValue } from '@/ui/utilities/state/utils/getSnapshotValue';+import { useRunWorkflowRunOpeningInCommandMenuSideEffects } from '@/workflow/hooks/useRunWorkflowRunOpeningInCommandMenuSideEffects';import { useTheme } from '@emotion/react';import { t } from '@lingui/core/macro';diff --git a/packages/twenty-front/src/modules/favorites/favorite-folder-picker/scopes/FavoriteFolderPickerScope.tsx b/packages/twenty-front/src/modules/favorites/favorite-folder-picker/scopes/FavoriteFolderPickerScope.tsxdeleted file mode 100644index 107c19beef0..00000000000--- a/packages/twenty-front/src/modules/favorites/favorite-folder-picker/scopes/FavoriteFolderPickerScope.tsx+++ /dev/null@@ -1,20 +0,0 @@-import { FavoriteFolderPickerInstanceContext } from '@/favorites/favorite-folder-picker/states/context/FavoriteFolderPickerInstanceContext';-import { ReactNode } from 'react';--type FavoriteFolderPickerComponentInstanceContextProps = {- children: ReactNode;- favoriteFoldersScopeId: string;-};--export const FavoriteFolderPickerComponentInstanceContext = ({- children,- favoriteFoldersScopeId,-}: FavoriteFolderPickerComponentInstanceContextProps) => {- return (- <FavoriteFolderPickerInstanceContext.Provider- value={{ instanceId: favoriteFoldersScopeId }}- >- {children}- </FavoriteFolderPickerInstanceContext.Provider>- );-};diff --git a/packages/twenty-front/src/modules/object-metadata/hooks/__tests__/useFindManyObjectMetadataItems.test.tsx b/packages/twenty-front/src/modules/object-metadata/hooks/__tests__/useFindManyObjectMetadataItems.test.tsxindex e9ece320748..68a08ade872 100644--- a/packages/twenty-front/src/modules/object-metadata/hooks/__tests__/useFindManyObjectMetadataItems.test.tsx+++ b/packages/twenty-front/src/modules/object-metadata/hooks/__tests__/useFindManyObjectMetadataItems.test.tsx@@ -4,8 +4,8 @@ import { ReactNode } from 'react';import { RecoilRoot } from 'recoil';import { useFindManyObjectMetadataItems } from '@/object-metadata/hooks/useFindManyObjectMetadataItems';-import { SnackBarComponentInstanceContextProvider } from '@/ui/feedback/snack-bar-manager/scopes/SnackBarComponentInstanceContextProvider';+import { SnackBarComponentInstanceContext } from '@/ui/feedback/snack-bar-manager/contexts/SnackBarComponentInstanceContext';import {query,responseData,@@ -27,9 +27,11 @@ const mocks = [const Wrapper = ({ children }: { children: ReactNode }) => (<RecoilRoot><MockedProvider mocks={mocks} addTypename={false}>- <SnackBarComponentInstanceContextProvider snackBarComponentInstanceId="snack-bar-manager">+ <SnackBarComponentInstanceContext.Provider+ value={{ instanceId: 'snack-bar-manager' }}+ >{children}- </SnackBarComponentInstanceContextProvider>+ </SnackBarComponentInstanceContext.Provider></MockedProvider></RecoilRoot>);diff --git a/packages/twenty-front/src/modules/object-record/hooks/useUpsertRecordFromState.ts b/packages/twenty-front/src/modules/object-record/hooks/useUpsertRecordFromState.tsdeleted file mode 100644index 8251c8c780a..00000000000--- a/packages/twenty-front/src/modules/object-record/hooks/useUpsertRecordFromState.ts+++ /dev/null@@ -1,16 +0,0 @@-import { useRecoilCallback } from 'recoil';--import { recordStoreFamilyState } from '@/object-record/record-store/states/recordStoreFamilyState';-import { ObjectRecord } from '@/object-record/types/ObjectRecord';-import { isDeeplyEqual } from '~/utils/isDeeplyEqual';--// TODO: refactor with scoped state later-export const useUpsertRecordFromState = () =>- useRecoilCallback(- ({ set }) =>- <T extends ObjectRecord>(record: T) =>- set(recordStoreFamilyState(record.id), (previousRecord) =>- isDeeplyEqual(previousRecord, record) ? previousRecord : record,- ),- [],- );diff --git a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/__stories__/ObjectOptionsDropdownContent.stories.tsx b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/__stories__/ObjectOptionsDropdownContent.stories.tsxindex f7479c89e38..70877027a08 100644--- a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/__stories__/ObjectOptionsDropdownContent.stories.tsx+++ b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/__stories__/ObjectOptionsDropdownContent.stories.tsx@@ -24,7 +24,7 @@ import { ObjectMetadataItemsDecorator } from '~/testing/decorators/ObjectMetadatimport { SnackBarDecorator } from '~/testing/decorators/SnackBarDecorator';import { generatedMockObjectMetadataItems } from '~/testing/mock-data/generatedMockObjectMetadataItems';-const instanceId = 'entity-options-scope';+const instanceId = 'entity-options-instance';const meta: Meta<typeof ObjectOptionsDropdownContent> = {title:diff --git a/packages/twenty-front/src/modules/object-record/record-board/components/RecordBoard.tsx b/packages/twenty-front/src/modules/object-record/record-board/components/RecordBoard.tsxindex 4187c46e88e..04231f96a80 100644--- a/packages/twenty-front/src/modules/object-record/record-board/components/RecordBoard.tsx+++ b/packages/twenty-front/src/modules/object-record/record-board/components/RecordBoard.tsx@@ -16,7 +16,6 @@ import { useRecordBoardSelection } from '@/object-record/record-board/hooks/useRimport { RecordBoardDeactivateBoardCardEffect } from '@/object-record/record-board/record-board-card/components/RecordBoardDeactivateBoardCardEffect';import { RECORD_BOARD_CARD_CLICK_OUTSIDE_ID } from '@/object-record/record-board/record-board-card/constants/RecordBoardCardClickOutsideId';import { RecordBoardColumn } from '@/object-record/record-board/record-board-column/components/RecordBoardColumn';-import { RecordBoardScope } from '@/object-record/record-board/scopes/RecordBoardScope';import { RecordBoardComponentInstanceContext } from '@/object-record/record-board/states/contexts/RecordBoardComponentInstanceContext';import { getDraggedRecordPosition } from '@/object-record/record-board/utils/getDraggedRecordPosition';import { recordGroupDefinitionFamilyState } from '@/object-record/record-group/states/recordGroupDefinitionFamilyState';@@ -209,51 +208,43 @@ export const RecordBoard = () => {// }return (- <RecordBoardScope- recordBoardScopeId={recordBoardId}- onColumnsChange={() => {}}- onFieldsChange={() => {}}+ <RecordBoardComponentInstanceContext.Provider+ value={{ instanceId: recordBoardId }}>- <RecordBoardComponentInstanceContext.Provider- value={{ instanceId: recordBoardId }}+ <ScrollWrapper+ componentInstanceId={`scroll-wrapper-record-board-${recordBoardId}`}>- <ScrollWrapper- componentInstanceId={`scroll-wrapper-record-board-${recordBoardId}`}- >- <RecordBoardStickyHeaderEffect />- <RecordBoardScrollToFocusedCardEffect />- <RecordBoardDeactivateBoardCardEffect />- <StyledContainerContainer>- <RecordBoardHeader />- <StyledBoardContentContainer>- <StyledContainer ref={boardRef}>- <DragDropContext onDragEnd={handleDragEnd}>- <StyledColumnContainer>- {visibleRecordGroupIds.map((recordGroupId, index) => (- <RecordBoardColumn- key={recordGroupId}- recordBoardColumnId={recordGroupId}- recordBoardColumnIndex={index}- />- ))}- </StyledColumnContainer>- </DragDropContext>-- <DragSelect- selectableItemsContainerRef={boardRef}- onDragSelectionEnd={handleDragSelectionEnd}- onDragSelectionChange={setRecordAsSelected}- onDragSelectionStart={handleDragSelectionStart}- scrollWrapperComponentInstanceId={`scroll-wrapper-record-board-${recordBoardId}`}- selectionBoundaryClass={- RECORD_INDEX_DRAG_SELECT_BOUNDARY_CLASS- }- />- </StyledContainer>- </StyledBoardContentContainer>- </StyledContainerContainer>- </ScrollWrapper>- </RecordBoardComponentInstanceContext.Provider>- </RecordBoardScope>+ <RecordBoardStickyHeaderEffect />+ <RecordBoardScrollToFocusedCardEffect />+ <RecordBoardDeactivateBoardCardEffect />+ <StyledContainerContainer>+ <RecordBoardHeader />+ <StyledBoardContentContainer>+ <StyledContainer ref={boardRef}>+ <DragDropContext onDragEnd={handleDragEnd}>+ <StyledColumnContainer>+ {visibleRecordGroupIds.map((recordGroupId, index) => (+ <RecordBoardColumn+ key={recordGroupId}+ recordBoardColumnId={recordGroupId}+ recordBoardColumnIndex={index}+ />+ ))}+ </StyledColumnContainer>+ </DragDropContext>++ <DragSelect+ selectableItemsContainerRef={boardRef}+ onDragSelectionEnd={handleDragSelectionEnd}+ onDragSelectionChange={setRecordAsSelected}+ onDragSelectionStart={handleDragSelectionStart}+ scrollWrapperComponentInstanceId={`scroll-wrapper-record-board-${recordBoardId}`}+ selectionBoundaryClass={RECORD_INDEX_DRAG_SELECT_BOUNDARY_CLASS}+ />+ </StyledContainer>+ </StyledBoardContentContainer>+ </StyledContainerContainer>+ </ScrollWrapper>+ </RecordBoardComponentInstanceContext.Provider>);};diff --git a/packages/twenty-front/src/modules/object-record/record-board/components/RecordBoardScrollToFocusedCardEffect.tsx b/packages/twenty-front/src/modules/object-record/record-board/components/RecordBoardScrollToFocusedCardEffect.tsxindex 1d6cdbf1dc7..2eee76facce 100644--- a/packages/twenty-front/src/modules/object-record/record-board/components/RecordBoardScrollToFocusedCardEffect.tsx+++ b/packages/twenty-front/src/modules/object-record/record-board/components/RecordBoardScrollToFocusedCardEffect.tsx@@ -1,24 +1,16 @@import { useEffect } from 'react';-import { RecordBoardScopeInternalContext } from '@/object-record/record-board/scopes/scope-internal-context/RecordBoardScopeInternalContext';import { focusedRecordBoardCardIndexesComponentState } from '@/object-record/record-board/states/focusedRecordBoardCardIndexesComponentState';import { isRecordBoardCardFocusActiveComponentState } from '@/object-record/record-board/states/isRecordBoardCardFocusActiveComponentState';-import { useAvailableScopeIdOrThrow } from '@/ui/utilities/recoil-scope/scopes-internal/hooks/useAvailableScopeId';import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';export const RecordBoardScrollToFocusedCardEffect = () => {- const recordBoardId = useAvailableScopeIdOrThrow(- RecordBoardScopeInternalContext,- );-const focusedCardIndexes = useRecoilComponentValueV2(focusedRecordBoardCardIndexesComponentState,- recordBoardId,);const isFocusActive = useRecoilComponentValueV2(isRecordBoardCardFocusActiveComponentState,- recordBoardId,);useEffect(() => {diff --git a/packages/twenty-front/src/modules/object-record/record-board/hooks/useSelectAllCards.ts b/packages/twenty-front/src/modules/object-record/record-board/hooks/useSelectAllCards.tsindex 7e7c380a222..03cebc8794a 100644--- a/packages/twenty-front/src/modules/object-record/record-board/hooks/useSelectAllCards.ts+++ b/packages/twenty-front/src/modules/object-record/record-board/hooks/useSelectAllCards.ts@@ -4,8 +4,8 @@ import { useRecordBoardSelection } from '@/object-record/record-board/hooks/useRimport { isRecordBoardCardSelectedComponentFamilyState } from '@/object-record/record-board/states/isRecordBoardCardSelectedComponentFamilyState';import { allCardsSelectedStatusComponentSelector } from '@/object-record/record-board/states/selectors/allCardsSelectedStatusComponentSelector';import { recordIndexAllRecordIdsComponentSelector } from '@/object-record/record-index/states/selectors/recordIndexAllRecordIdsComponentSelector';-import { getSnapshotValue } from '@/ui/utilities/recoil-scope/utils/getSnapshotValue';import { useRecoilComponentCallbackStateV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentCallbackStateV2';+import { getSnapshotValue } from '@/ui/utilities/state/utils/getSnapshotValue';export const useSelectAllCards = (recordBoardId?: string) => {const allCardsSelectedStatusSelector = useRecoilComponentCallbackStateV2(diff --git a/packages/twenty-front/src/modules/object-record/record-board/record-board-card/components/RecordBoardCard.tsx b/packages/twenty-front/src/modules/object-record/record-board/record-board-card/components/RecordBoardCard.tsxindex 28ca824fbcd..922b1675014 100644--- a/packages/twenty-front/src/modules/object-record/record-board/record-board-card/components/RecordBoardCard.tsx+++ b/packages/twenty-front/src/modules/object-record/record-board/record-board-card/components/RecordBoardCard.tsx@@ -2,7 +2,6 @@ import { recordIndexActionMenuDropdownPositionComponentState } from '@/action-meimport { getActionMenuDropdownIdFromActionMenuId } from '@/action-menu/utils/getActionMenuDropdownIdFromActionMenuId';import { getActionMenuIdFromRecordIndexId } from '@/action-menu/utils/getActionMenuIdFromRecordIndexId';import { RecordBoardCardContext } from '@/object-record/record-board/record-board-card/contexts/RecordBoardCardContext';-import { RecordBoardScopeInternalContext } from '@/object-record/record-board/scopes/scope-internal-context/RecordBoardScopeInternalContext';import { isRecordBoardCardActiveComponentFamilyState } from '@/object-record/record-board/states/isRecordBoardCardActiveComponentFamilyState';import { isRecordBoardCardFocusedComponentFamilyState } from '@/object-record/record-board/states/isRecordBoardCardFocusedComponentFamilyState';import { isRecordBoardCardSelectedComponentFamilyState } from '@/object-record/record-board/states/isRecordBoardCardSelectedComponentFamilyState';@@ -14,10 +13,11 @@ import { useFocusedRecordBoardCard } from '@/object-record/record-board/hooks/usimport { RecordBoardCardBody } from '@/object-record/record-board/record-board-card/components/RecordBoardCardBody';import { RecordBoardCardHeader } from '@/object-record/record-board/record-board-card/components/RecordBoardCardHeader';import { RECORD_BOARD_CARD_CLICK_OUTSIDE_ID } from '@/object-record/record-board/record-board-card/constants/RecordBoardCardClickOutsideId';+import { RecordBoardComponentInstanceContext } from '@/object-record/record-board/states/contexts/RecordBoardComponentInstanceContext';import { useOpenRecordFromIndexView } from '@/object-record/record-index/hooks/useOpenRecordFromIndexView';import { useOpenDropdown } from '@/ui/layout/dropdown/hooks/useOpenDropdown';-import { useAvailableScopeIdOrThrow } from '@/ui/utilities/recoil-scope/scopes-internal/hooks/useAvailableScopeId';import { useScrollWrapperElement } from '@/ui/utilities/scroll/hooks/useScrollWrapperElement';+import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';import { useRecoilComponentFamilyStateV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentFamilyStateV2';import { useRecoilComponentFamilyValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentFamilyValueV2';import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';@@ -122,8 +122,8 @@ export const RecordBoardCard = () => {},);- const recordBoardId = useAvailableScopeIdOrThrow(- RecordBoardScopeInternalContext,+ const recordBoardId = useAvailableComponentInstanceIdOrThrow(+ RecordBoardComponentInstanceContext,);const actionMenuId = getActionMenuIdFromRecordIndexId(recordBoardId);diff --git a/packages/twenty-front/src/modules/object-record/record-board/scopes/RecordBoardScope.tsx b/packages/twenty-front/src/modules/object-record/record-board/scopes/RecordBoardScope.tsxdeleted file mode 100644index 2f61769ed16..00000000000--- a/packages/twenty-front/src/modules/object-record/record-board/scopes/RecordBoardScope.tsx+++ /dev/null@@ -1,33 +0,0 @@-import { ReactNode } from 'react';--import { RecordBoardScopeInternalContext } from '@/object-record/record-board/scopes/scope-internal-context/RecordBoardScopeInternalContext';-import { FieldDefinition } from '@/object-record/record-field/types/FieldDefinition';-import { FieldMetadata } from '@/object-record/record-field/types/FieldMetadata';-import { RecordGroupDefinition } from '@/object-record/record-group/types/RecordGroupDefinition';--type RecordBoardScopeProps = {- children: ReactNode;- recordBoardScopeId: string;- onFieldsChange: (fields: FieldDefinition<FieldMetadata>[]) => void;- onColumnsChange: (column: RecordGroupDefinition[]) => void;-};--/** @deprecated */-export const RecordBoardScope = ({- children,- recordBoardScopeId,- onColumnsChange,- onFieldsChange,-}: RecordBoardScopeProps) => {- return (- <RecordBoardScopeInternalContext.Provider- value={{- scopeId: recordBoardScopeId,- onColumnsChange,- onFieldsChange,- }}- >- {children}- </RecordBoardScopeInternalContext.Provider>- );-};diff --git a/packages/twenty-front/src/modules/object-record/record-board/scopes/scope-internal-context/RecordBoardScopeInternalContext.ts b/packages/twenty-front/src/modules/object-record/record-board/scopes/scope-internal-context/RecordBoardScopeInternalContext.tsdeleted file mode 100644index 330ff18aba5..00000000000--- a/packages/twenty-front/src/modules/object-record/record-board/scopes/scope-internal-context/RecordBoardScopeInternalContext.ts+++ /dev/null@@ -1,13 +0,0 @@-import { FieldDefinition } from '@/object-record/record-field/types/FieldDefinition';-import { FieldMetadata } from '@/object-record/record-field/types/FieldMetadata';-import { RecordGroupDefinition } from '@/object-record/record-group/types/RecordGroupDefinition';-import { createScopeInternalContext } from '@/ui/utilities/recoil-scope/scopes-internal/utils/createScopeInternalContext';-import { RecoilComponentStateKey } from '@/ui/utilities/state/component-state/types/RecoilComponentStateKey';--type RecordBoardScopeInternalContextProps = RecoilComponentStateKey & {- onFieldsChange: (fields: FieldDefinition<FieldMetadata>[]) => void;- onColumnsChange: (column: RecordGroupDefinition[]) => void;-};--export const RecordBoardScopeInternalContext =- createScopeInternalContext<RecordBoardScopeInternalContextProps>();diff --git a/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/__stories__/RelationFromManyFieldInput.stories.tsx b/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/__stories__/RelationFromManyFieldInput.stories.tsxindex 887ba572227..2276d0acb2c 100644--- a/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/__stories__/RelationFromManyFieldInput.stories.tsx+++ b/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/__stories__/RelationFromManyFieldInput.stories.tsx@@ -6,7 +6,6 @@ import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMembeimport { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';import { RelationFromManyFieldInput } from '@/object-record/record-field/meta-types/input/components/RelationFromManyFieldInput';import { usePushFocusItemToFocusStack } from '@/ui/utilities/focus/hooks/usePushFocusItemToFocusStack';-import { ComponentWithRecoilScopeDecorator } from '~/testing/decorators/ComponentWithRecoilScopeDecorator';import { ObjectMetadataItemsDecorator } from '~/testing/decorators/ObjectMetadataItemsDecorator';import { SnackBarDecorator } from '~/testing/decorators/SnackBarDecorator';import { graphqlMocks } from '~/testing/graphqlMocks';@@ -127,6 +126,4 @@ export default meta;type Story = StoryObj<typeof RelationManyFieldInputWithContext>;-export const Default: Story = {- decorators: [ComponentWithRecoilScopeDecorator],-};+export const Default: Story = {};diff --git a/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/__stories__/RelationToOneFieldInput.stories.tsx b/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/__stories__/RelationToOneFieldInput.stories.tsxindex 65eac31320c..f0a98f38559 100644--- a/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/__stories__/RelationToOneFieldInput.stories.tsx+++ b/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/__stories__/RelationToOneFieldInput.stories.tsx@@ -5,7 +5,6 @@ import { useSetRecoilState } from 'recoil';import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';-import { ComponentWithRecoilScopeDecorator } from '~/testing/decorators/ComponentWithRecoilScopeDecorator';import { ObjectMetadataItemsDecorator } from '~/testing/decorators/ObjectMetadataItemsDecorator';import { SnackBarDecorator } from '~/testing/decorators/SnackBarDecorator';import { graphqlMocks } from '~/testing/graphqlMocks';@@ -150,12 +149,9 @@ export default meta;type Story = StoryObj<typeof RelationToOneFieldInputWithContext>;-export const Default: Story = {- decorators: [ComponentWithRecoilScopeDecorator],-};+export const Default: Story = {};export const Submit: Story = {- decorators: [ComponentWithRecoilScopeDecorator],play: async () => {const canvas = within(getCanvasElementForDropdownTesting());@@ -174,7 +170,6 @@ export const Submit: Story = {};export const Cancel: Story = {- decorators: [ComponentWithRecoilScopeDecorator],play: async () => {const canvas = within(getCanvasElementForDropdownTesting());diff --git a/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCell.tsx b/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCell.tsxindex d8ac5328aa6..96210b576ae 100644--- a/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCell.tsx+++ b/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCell.tsx@@ -14,7 +14,7 @@ import { useIsFieldInputOnly } from '@/object-record/record-field/hooks/useIsFieimport { useOpenFieldInputEditMode } from '@/object-record/record-field/hooks/useOpenFieldInputEditMode';import { RecordFieldComponentInstanceContext } from '@/object-record/record-field/states/contexts/RecordFieldComponentInstanceContext';-import { isInlineCellInEditModeScopedState } from '@/object-record/record-inline-cell/states/isInlineCellInEditModeScopedState';+import { isInlineCellInEditModeFamilyState } from '@/object-record/record-inline-cell/states/isInlineCellInEditModeFamilyState';import { getDropdownFocusIdForRecordField } from '@/object-record/utils/getDropdownFocusIdForRecordField';import { useGoBackToPreviousDropdownFocusId } from '@/ui/layout/dropdown/hooks/useGoBackToPreviousDropdownFocusId';import { activeDropdownFocusIdState } from '@/ui/layout/dropdown/states/activeDropdownFocusIdState';@@ -85,7 +85,7 @@ export const RecordInlineCell = ({);const setIsInlineCellInEditMode = useSetRecoilState(- isInlineCellInEditModeScopedState(recordFieldComponentInstanceId),+ isInlineCellInEditModeFamilyState(recordFieldComponentInstanceId),);const closeInlineCell = useCallback(() => {diff --git a/packages/twenty-front/src/modules/object-record/record-inline-cell/hooks/useInlineCell.ts b/packages/twenty-front/src/modules/object-record/record-inline-cell/hooks/useInlineCell.tsindex 6ced5993864..ed9ce060396 100644--- a/packages/twenty-front/src/modules/object-record/record-inline-cell/hooks/useInlineCell.ts+++ b/packages/twenty-front/src/modules/object-record/record-inline-cell/hooks/useInlineCell.ts@@ -10,7 +10,7 @@ import { getDropdownFocusIdForRecordField } from '@/object-record/utils/getDropdimport { useGoBackToPreviousDropdownFocusId } from '@/ui/layout/dropdown/hooks/useGoBackToPreviousDropdownFocusId';import { useSetActiveDropdownFocusIdAndMemorizePrevious } from '@/ui/layout/dropdown/hooks/useSetFocusedDropdownIdAndMemorizePrevious';import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';-import { isInlineCellInEditModeScopedState } from '../states/isInlineCellInEditModeScopedState';+import { isInlineCellInEditModeFamilyState } from '../states/isInlineCellInEditModeFamilyState';export const useInlineCell = (recordFieldComponentInstanceIdFromProps?: string,@@ -23,7 +23,7 @@ export const useInlineCell = ();const [isInlineCellInEditMode, setIsInlineCellInEditMode] = useRecoilState(- isInlineCellInEditModeScopedState(recordFieldComponentInstanceId),+ isInlineCellInEditModeFamilyState(recordFieldComponentInstanceId),);const { onOpenEditMode, onCloseEditMode } = useRecordInlineCellContext();diff --git a/packages/twenty-front/src/modules/object-record/record-inline-cell/states/isInlineCellInEditModeScopedState.ts b/packages/twenty-front/src/modules/object-record/record-inline-cell/states/isInlineCellInEditModeFamilyState.tssimilarity index 73%rename from packages/twenty-front/src/modules/object-record/record-inline-cell/states/isInlineCellInEditModeScopedState.tsrename to packages/twenty-front/src/modules/object-record/record-inline-cell/states/isInlineCellInEditModeFamilyState.tsindex 9142d9400e0..d605eda2136 100644--- a/packages/twenty-front/src/modules/object-record/record-inline-cell/states/isInlineCellInEditModeScopedState.ts+++ b/packages/twenty-front/src/modules/object-record/record-inline-cell/states/isInlineCellInEditModeFamilyState.ts@@ -1,6 +1,6 @@import { createFamilyState } from '@/ui/utilities/state/utils/createFamilyState';-export const isInlineCellInEditModeScopedState = createFamilyState<+export const isInlineCellInEditModeFamilyState = createFamilyState<boolean,string>({diff --git a/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/components/__stories__/SingleRecordPicker.stories.tsx b/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/components/__stories__/SingleRecordPicker.stories.tsxindex 99b843f1bd5..37e3755852a 100644--- a/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/components/__stories__/SingleRecordPicker.stories.tsx+++ b/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/components/__stories__/SingleRecordPicker.stories.tsx@@ -2,7 +2,6 @@ import { Meta, StoryObj } from '@storybook/react';import { expect, userEvent, within } from '@storybook/test';import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';-import { ComponentWithRecoilScopeDecorator } from '~/testing/decorators/ComponentWithRecoilScopeDecorator';import { ObjectMetadataItemsDecorator } from '~/testing/decorators/ObjectMetadataItemsDecorator';import { SnackBarDecorator } from '~/testing/decorators/SnackBarDecorator';import { graphqlMocks } from '~/testing/graphqlMocks';@@ -11,8 +10,8 @@ import { sleep } from '~/utils/sleep';import { SingleRecordPicker } from '@/object-record/record-picker/single-record-picker/components/SingleRecordPicker';import { SingleRecordPickerRecord } from '@/object-record/record-picker/single-record-picker/types/SingleRecordPickerRecord';-import { ComponentDecorator } from 'twenty-ui/testing';import { IconUserCircle } from 'twenty-ui/display';+import { ComponentDecorator } from 'twenty-ui/testing';const records = allMockPersonRecords.map<SingleRecordPickerRecord>((person) => ({@@ -29,7 +28,6 @@ const meta: Meta<typeof SingleRecordPicker> = {component: SingleRecordPicker,decorators: [ComponentDecorator,- ComponentWithRecoilScopeDecorator,ObjectMetadataItemsDecorator,SnackBarDecorator,],diff --git a/packages/twenty-front/src/modules/object-record/record-show/record-detail-section/components/RecordDetailRelationRecordsListItem.tsx b/packages/twenty-front/src/modules/object-record/record-show/record-detail-section/components/RecordDetailRelationRecordsListItem.tsxindex 5a13bd5888d..2381b2f381c 100644--- a/packages/twenty-front/src/modules/object-record/record-show/record-detail-section/components/RecordDetailRelationRecordsListItem.tsx+++ b/packages/twenty-front/src/modules/object-record/record-show/record-detail-section/components/RecordDetailRelationRecordsListItem.tsx@@ -35,7 +35,6 @@ import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';-import { DropdownScope } from '@/ui/layout/dropdown/scopes/DropdownScope';import { isDropdownOpenComponentState } from '@/ui/layout/dropdown/states/isDropdownOpenComponentState';import { ConfirmationModal } from '@/ui/layout/modal/components/ConfirmationModal';import { useModal } from '@/ui/layout/modal/hooks/useModal';@@ -159,12 +158,12 @@ export const RecordDetailRelationRecordsListItem = ({).sort();- const dropdownScopeId = `record-field-card-menu-${relationFieldMetadataId}-${relationRecord.id}`;+ const dropdownInstanceId = `record-field-card-menu-${relationFieldMetadataId}-${relationRecord.id}`;const { closeDropdown } = useCloseDropdown();const isDropdownOpen = useRecoilComponentValueV2(isDropdownOpenComponentState,- dropdownScopeId,+ dropdownInstanceId,);const dropdownId = getRecordFieldCardRelationPickerDropdownId({@@ -177,7 +176,7 @@ export const RecordDetailRelationRecordsListItem = ({);const handleDetach = () => {- closeDropdown(dropdownScopeId);+ closeDropdown(dropdownInstanceId);const relationFieldMetadataItem = relationObjectMetadataItem.fields.find(({ id }) => id === relationFieldMetadataId,@@ -202,7 +201,7 @@ export const RecordDetailRelationRecordsListItem = ({};const handleDelete = async () => {- closeDropdown(dropdownScopeId);+ closeDropdown(dropdownInstanceId);openModal(getDeleteRelationModalId(relationRecord.id));};@@ -262,39 +261,37 @@ export const RecordDetailRelationRecordsListItem = ({/></StyledClickableZone>{!isFieldReadOnly && (- <DropdownScope dropdownScopeId={dropdownScopeId}>- <Dropdown- dropdownId={dropdownScopeId}- dropdownPlacement="right-start"- clickableComponent={- <LightIconButton- className="displayOnHover"- Icon={IconDotsVertical}- accent="tertiary"- />- }- dropdownComponents={- <DropdownContent>- <DropdownMenuItemsContainer>- <MenuItem- LeftIcon={IconUnlink}- text="Detach"- onClick={handleDetach}- />- {!isAccountOwnerRelation &&- relationObjectPermissions.canSoftDeleteObjectRecords && (- <MenuItem- LeftIcon={IconTrash}- text="Delete"- accent="danger"- onClick={handleDelete}- />- )}- </DropdownMenuItemsContainer>- </DropdownContent>- }- />- </DropdownScope>+ <Dropdown+ dropdownId={dropdownInstanceId}+ dropdownPlacement="right-start"+ clickableComponent={+ <LightIconButton+ className="displayOnHover"+ Icon={IconDotsVertical}+ accent="tertiary"+ />+ }+ dropdownComponents={+ <DropdownContent>+ <DropdownMenuItemsContainer>+ <MenuItem+ LeftIcon={IconUnlink}+ text="Detach"+ onClick={handleDetach}+ />+ {!isAccountOwnerRelation &&+ relationObjectPermissions.canSoftDeleteObjectRecords && (+ <MenuItem+ LeftIcon={IconTrash}+ text="Delete"+ accent="danger"+ onClick={handleDelete}+ />+ )}+ </DropdownMenuItemsContainer>+ </DropdownContent>+ }+ />)}</StyledListItem><AnimatedEaseInOut isOpen={isExpanded}>diff --git a/packages/twenty-front/src/modules/object-record/record-show/record-detail-section/components/RecordDetailRelationSectionDropdownToMany.tsx b/packages/twenty-front/src/modules/object-record/record-show/record-detail-section/components/RecordDetailRelationSectionDropdownToMany.tsxindex a47d588179d..f930f13c7a0 100644--- a/packages/twenty-front/src/modules/object-record/record-show/record-detail-section/components/RecordDetailRelationSectionDropdownToMany.tsx+++ b/packages/twenty-front/src/modules/object-record/record-show/record-detail-section/components/RecordDetailRelationSectionDropdownToMany.tsx@@ -17,7 +17,6 @@ import { recordStoreFamilySelector } from '@/object-record/record-store/states/simport { ObjectRecord } from '@/object-record/types/ObjectRecord';import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';-import { DropdownScope } from '@/ui/layout/dropdown/scopes/DropdownScope';import { dropdownPlacementComponentState } from '@/ui/layout/dropdown/states/dropdownPlacementComponentState';import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';import { useSetRecoilComponentStateV2 } from '@/ui/utilities/state/component-state/hooks/useSetRecoilComponentStateV2';@@ -131,39 +130,37 @@ export const RecordDetailRelationSectionDropdownToMany = () => {};return (- <DropdownScope dropdownScopeId={dropdownId}>- <Dropdown- dropdownId={dropdownId}- dropdownPlacement="left-start"- onClose={handleCloseRelationPickerDropdown}- onOpen={handleOpenRelationPickerDropdown}- clickableComponent={- <LightIconButton- className="displayOnHover"- Icon={IconPlus}- accent="tertiary"- />- }- dropdownComponents={- <MultipleRecordPicker- focusId={dropdownId}- componentInstanceId={dropdownId}- onCreate={handleCreateNew}- onChange={updateRelation}- onSubmit={() => {- closeDropdown(dropdownId);- }}- onClickOutside={() => {- closeDropdown(dropdownId);- }}- layoutDirection={- dropdownPlacement?.includes('end')- ? 'search-bar-on-bottom'- : 'search-bar-on-top'- }- />- }- />- </DropdownScope>+ <Dropdown+ dropdownId={dropdownId}+ dropdownPlacement="left-start"+ onClose={handleCloseRelationPickerDropdown}+ onOpen={handleOpenRelationPickerDropdown}+ clickableComponent={+ <LightIconButton+ className="displayOnHover"+ Icon={IconPlus}+ accent="tertiary"+ />+ }+ dropdownComponents={+ <MultipleRecordPicker+ focusId={dropdownId}+ componentInstanceId={dropdownId}+ onCreate={handleCreateNew}+ onChange={updateRelation}+ onSubmit={() => {+ closeDropdown(dropdownId);+ }}+ onClickOutside={() => {+ closeDropdown(dropdownId);+ }}+ layoutDirection={+ dropdownPlacement?.includes('end')+ ? 'search-bar-on-bottom'+ : 'search-bar-on-top'+ }+ />+ }+ />);};diff --git a/packages/twenty-front/src/modules/object-record/record-show/record-detail-section/components/RecordDetailRelationSectionDropdownToOne.tsx b/packages/twenty-front/src/modules/object-record/record-show/record-detail-section/components/RecordDetailRelationSectionDropdownToOne.tsxindex 0945e5f90bf..b69df3a37a2 100644--- a/packages/twenty-front/src/modules/object-record/record-show/record-detail-section/components/RecordDetailRelationSectionDropdownToOne.tsx+++ b/packages/twenty-front/src/modules/object-record/record-show/record-detail-section/components/RecordDetailRelationSectionDropdownToOne.tsx@@ -17,7 +17,6 @@ import { recordStoreFamilySelector } from '@/object-record/record-store/states/simport { ObjectRecord } from '@/object-record/types/ObjectRecord';import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';-import { DropdownScope } from '@/ui/layout/dropdown/scopes/DropdownScope';import { dropdownPlacementComponentState } from '@/ui/layout/dropdown/states/dropdownPlacementComponentState';import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';import { useSetRecoilComponentStateV2 } from '@/ui/utilities/state/component-state/hooks/useSetRecoilComponentStateV2';@@ -117,37 +116,35 @@ export const RecordDetailRelationSectionDropdownToOne = () => {CoreObjectNameSingular.WorkspaceMember;return (- <DropdownScope dropdownScopeId={dropdownId}>- <Dropdown- dropdownId={dropdownId}- dropdownPlacement="left-start"- onClose={handleCloseRelationPickerDropdown}- onOpen={handleOpenRelationPickerDropdown}- clickableComponent={- <LightIconButton- className="displayOnHover"- Icon={IconPencil}- accent="tertiary"- />- }- dropdownComponents={- <SingleRecordPicker- focusId={dropdownId}- componentInstanceId={dropdownId}- EmptyIcon={IconForbid}- onRecordSelected={handleRelationPickerEntitySelected}- objectNameSingular={relationObjectMetadataNameSingular}- recordPickerInstanceId={dropdownId}- onCancel={() => closeDropdown(dropdownId)}- onCreate={shouldAllowCreateNew ? handleCreateNew : undefined}- layoutDirection={- dropdownPlacement?.includes('end')- ? 'search-bar-on-bottom'- : 'search-bar-on-top'- }- />- }- />- </DropdownScope>+ <Dropdown+ dropdownId={dropdownId}+ dropdownPlacement="left-start"+ onClose={handleCloseRelationPickerDropdown}+ onOpen={handleOpenRelationPickerDropdown}+ clickableComponent={+ <LightIconButton+ className="displayOnHover"+ Icon={IconPencil}+ accent="tertiary"+ />+ }+ dropdownComponents={+ <SingleRecordPicker+ focusId={dropdownId}+ componentInstanceId={dropdownId}+ EmptyIcon={IconForbid}+ onRecordSelected={handleRelationPickerEntitySelected}+ objectNameSingular={relationObjectMetadataNameSingular}+ recordPickerInstanceId={dropdownId}+ onCancel={() => closeDropdown(dropdownId)}+ onCreate={shouldAllowCreateNew ? handleCreateNew : undefined}+ layoutDirection={+ dropdownPlacement?.includes('end')+ ? 'search-bar-on-bottom'+ : 'search-bar-on-top'+ }+ />+ }+ />);};diff --git a/packages/twenty-front/src/modules/object-record/record-table/hooks/internal/useHandleContainerMouseEnter.ts b/packages/twenty-front/src/modules/object-record/record-table/hooks/internal/useHandleContainerMouseEnter.tsindex 7fb081552ca..d5082560615 100644--- a/packages/twenty-front/src/modules/object-record/record-table/hooks/internal/useHandleContainerMouseEnter.ts+++ b/packages/twenty-front/src/modules/object-record/record-table/hooks/internal/useHandleContainerMouseEnter.ts@@ -3,8 +3,8 @@ import { useRecoilCallback } from 'recoil';import { useMoveHoverToCurrentCell } from '@/object-record/record-table/record-table-cell/hooks/useMoveHoverToCurrentCell';import { isSomeCellInEditModeComponentSelector } from '@/object-record/record-table/states/selectors/isSomeCellInEditModeComponentSelector';import { TableCellPosition } from '@/object-record/record-table/types/TableCellPosition';-import { getSnapshotValue } from '@/ui/utilities/recoil-scope/utils/getSnapshotValue';import { useRecoilComponentCallbackStateV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentCallbackStateV2';+import { getSnapshotValue } from '@/ui/utilities/state/utils/getSnapshotValue';export type HandleContainerMouseEnterArgs = {cellPosition: TableCellPosition;diff --git a/packages/twenty-front/src/modules/object-record/record-table/hooks/internal/useResetTableRowSelection.ts b/packages/twenty-front/src/modules/object-record/record-table/hooks/internal/useResetTableRowSelection.tsindex 02f6de326a0..331b8d0ce06 100644--- a/packages/twenty-front/src/modules/object-record/record-table/hooks/internal/useResetTableRowSelection.ts+++ b/packages/twenty-front/src/modules/object-record/record-table/hooks/internal/useResetTableRowSelection.ts@@ -7,9 +7,9 @@ import { hasUserSelectedAllRowsComponentState } from '@/object-record/record-tabimport { isRowSelectedComponentFamilyState } from '@/object-record/record-table/record-table-row/states/isRowSelectedComponentFamilyState';import { RecordTableComponentInstanceContext } from '@/object-record/record-table/states/context/RecordTableComponentInstanceContext';import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';-import { getSnapshotValue } from '@/ui/utilities/recoil-scope/utils/getSnapshotValue';import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';import { useRecoilComponentCallbackStateV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentCallbackStateV2';+import { getSnapshotValue } from '@/ui/utilities/state/utils/getSnapshotValue';import { lastSelectedRowIndexComponentState } from '../../record-table-row/states/lastSelectedRowIndexComponentState';export const useResetTableRowSelection = (recordTableId?: string) => {diff --git a/packages/twenty-front/src/modules/object-record/record-table/hooks/internal/useSelectAllRows.ts b/packages/twenty-front/src/modules/object-record/record-table/hooks/internal/useSelectAllRows.tsindex 67e842c0f54..ed9d7b8d508 100644--- a/packages/twenty-front/src/modules/object-record/record-table/hooks/internal/useSelectAllRows.ts+++ b/packages/twenty-front/src/modules/object-record/record-table/hooks/internal/useSelectAllRows.ts@@ -4,8 +4,8 @@ import { recordIndexAllRecordIdsComponentSelector } from '@/object-record/recordimport { useResetTableRowSelection } from '@/object-record/record-table/hooks/internal/useResetTableRowSelection';import { isRowSelectedComponentFamilyState } from '@/object-record/record-table/record-table-row/states/isRowSelectedComponentFamilyState';import { allRowsSelectedStatusComponentSelector } from '@/object-record/record-table/states/selectors/allRowsSelectedStatusComponentSelector';-import { getSnapshotValue } from '@/ui/utilities/recoil-scope/utils/getSnapshotValue';import { useRecoilComponentCallbackStateV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentCallbackStateV2';+import { getSnapshotValue } from '@/ui/utilities/state/utils/getSnapshotValue';export const useSelectAllRows = (recordTableId?: string) => {const allRowsSelectedStatusSelector = useRecoilComponentCallbackStateV2(diff --git a/packages/twenty-front/src/modules/object-record/record-table/hooks/internal/useSetRecordTableData.ts b/packages/twenty-front/src/modules/object-record/record-table/hooks/internal/useSetRecordTableData.tsindex 42cd1e1d489..8757fe4479c 100644--- a/packages/twenty-front/src/modules/object-record/record-table/hooks/internal/useSetRecordTableData.ts+++ b/packages/twenty-front/src/modules/object-record/record-table/hooks/internal/useSetRecordTableData.ts@@ -10,10 +10,10 @@ import { hasUserSelectedAllRowsComponentState } from '@/object-record/record-tabimport { isRowSelectedComponentFamilyState } from '@/object-record/record-table/record-table-row/states/isRowSelectedComponentFamilyState';import { recordTableHoverPositionComponentState } from '@/object-record/record-table/states/recordTableHoverPositionComponentState';import { ObjectRecord } from '@/object-record/types/ObjectRecord';-import { getSnapshotValue } from '@/ui/utilities/recoil-scope/utils/getSnapshotValue';import { useRecoilComponentCallbackStateV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentCallbackStateV2';import { useRecoilComponentFamilyCallbackStateV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentFamilyCallbackStateV2';import { useSetRecoilComponentStateV2 } from '@/ui/utilities/state/component-state/hooks/useSetRecoilComponentStateV2';+import { getSnapshotValue } from '@/ui/utilities/state/utils/getSnapshotValue';import { isDefined } from 'twenty-shared/utils';import { isDeeplyEqual } from '~/utils/isDeeplyEqual';diff --git a/packages/twenty-front/src/modules/object-record/record-table/hooks/useRecordTable.ts b/packages/twenty-front/src/modules/object-record/record-table/hooks/useRecordTable.tsindex 8b1875e86b8..7852ba52255 100644--- a/packages/twenty-front/src/modules/object-record/record-table/hooks/useRecordTable.ts+++ b/packages/twenty-front/src/modules/object-record/record-table/hooks/useRecordTable.ts@@ -2,7 +2,7 @@ import { useRecoilCallback } from 'recoil';import { FieldMetadata } from '@/object-record/record-field/types/FieldMetadata';import { useSetHasUserSelectedAllRows } from '@/object-record/record-table/hooks/internal/useSetAllRowSelectedState';-import { getSnapshotValue } from '@/ui/utilities/recoil-scope/utils/getSnapshotValue';+import { getSnapshotValue } from '@/ui/utilities/state/utils/getSnapshotValue';import { isDeeplyEqual } from '~/utils/isDeeplyEqual';import { ColumnDefinition } from '../types/ColumnDefinition';diff --git a/packages/twenty-front/src/modules/object-record/record-table/hooks/useRecordTableMoveFocusedCell.ts b/packages/twenty-front/src/modules/object-record/record-table/hooks/useRecordTableMoveFocusedCell.tsindex 1db85a2467f..b2d96e58949 100644--- a/packages/twenty-front/src/modules/object-record/record-table/hooks/useRecordTableMoveFocusedCell.ts+++ b/packages/twenty-front/src/modules/object-record/record-table/hooks/useRecordTableMoveFocusedCell.ts@@ -1,7 +1,7 @@import { useRecoilCallback } from 'recoil';import { MoveFocusDirection } from '@/object-record/record-table/types/MoveFocusDirection';-import { getSnapshotValue } from '@/ui/utilities/recoil-scope/utils/getSnapshotValue';+import { getSnapshotValue } from '@/ui/utilities/state/utils/getSnapshotValue';import { recordIndexAllRecordIdsComponentSelector } from '@/object-record/record-index/states/selectors/recordIndexAllRecordIdsComponentSelector';import { useFocusRecordTableCell } from '@/object-record/record-table/record-table-cell/hooks/useFocusRecordTableCell';diff --git a/packages/twenty-front/src/modules/object-record/record-table/hooks/useRecordTableMoveFocusedRow.ts b/packages/twenty-front/src/modules/object-record/record-table/hooks/useRecordTableMoveFocusedRow.tsindex cab82d7461c..3a7bf93ced5 100644--- a/packages/twenty-front/src/modules/object-record/record-table/hooks/useRecordTableMoveFocusedRow.ts+++ b/packages/twenty-front/src/modules/object-record/record-table/hooks/useRecordTableMoveFocusedRow.ts@@ -4,8 +4,8 @@ import { recordIndexAllRecordIdsComponentSelector } from '@/object-record/recordimport { useFocusedRecordTableRow } from '@/object-record/record-table/hooks/useFocusedRecordTableRow';import { focusedRecordTableRowIndexComponentState } from '@/object-record/record-table/states/focusedRecordTableRowIndexComponentState';import { MoveFocusDirection } from '@/object-record/record-table/types/MoveFocusDirection';-import { getSnapshotValue } from '@/ui/utilities/recoil-scope/utils/getSnapshotValue';import { useRecoilComponentCallbackStateV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentCallbackStateV2';+import { getSnapshotValue } from '@/ui/utilities/state/utils/getSnapshotValue';import { isDefined } from 'twenty-shared/utils';export const useRecordTableMoveFocusedRow = (recordTableId?: string) => {diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-body/components/RecordTableBodyDragDropContextProvider.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-body/components/RecordTableBodyDragDropContextProvider.tsxindex 8eb432828ec..f1c1465152b 100644--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-body/components/RecordTableBodyDragDropContextProvider.tsx+++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-body/components/RecordTableBodyDragDropContextProvider.tsx@@ -10,9 +10,9 @@ import { currentRecordSortsComponentState } from '@/object-record/record-sort/stimport { recordStoreFamilyState } from '@/object-record/record-store/states/recordStoreFamilyState';import { useRecordTableContextOrThrow } from '@/object-record/record-table/contexts/RecordTableContext';import { useModal } from '@/ui/layout/modal/hooks/useModal';-import { getSnapshotValue } from '@/ui/utilities/recoil-scope/utils/getSnapshotValue';import { useRecoilComponentCallbackStateV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentCallbackStateV2';import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';+import { getSnapshotValue } from '@/ui/utilities/state/utils/getSnapshotValue';import { isDefined } from 'twenty-shared/utils';export const RecordTableBodyDragDropContextProvider = ({diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/hooks/internal/__tests__/useCloseRecordTableCellInGroup.test.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/hooks/internal/__tests__/useCloseRecordTableCellInGroup.test.tsxindex 00b1534be07..125b06762bf 100644--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/hooks/internal/__tests__/useCloseRecordTableCellInGroup.test.tsx+++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/hooks/internal/__tests__/useCloseRecordTableCellInGroup.test.tsx@@ -22,7 +22,7 @@ import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/import { generatedMockObjectMetadataItems } from '~/testing/mock-data/generatedMockObjectMetadataItems';const onColumnsChange = jest.fn();-const recordTableId = 'scopeId';+const recordTableId = 'record-table-id';const Wrapper = ({ children }: { children: React.ReactNode }) => (<RecoilRootdiff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/hooks/internal/__tests__/useCloseRecordTableCellNoGroup.test.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/hooks/internal/__tests__/useCloseRecordTableCellNoGroup.test.tsxindex 9ff4969abc3..337c76af466 100644--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/hooks/internal/__tests__/useCloseRecordTableCellNoGroup.test.tsx+++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/hooks/internal/__tests__/useCloseRecordTableCellNoGroup.test.tsx@@ -22,7 +22,7 @@ import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/import { generatedMockObjectMetadataItems } from '~/testing/mock-data/generatedMockObjectMetadataItems';const onColumnsChange = jest.fn();-const recordTableId = 'scopeId';+const recordTableId = 'record-table-id';const Wrapper = ({ children }: { children: React.ReactNode }) => (<RecoilRootdiff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/hooks/useMoveHoverToCurrentCell.ts b/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/hooks/useMoveHoverToCurrentCell.tsindex 4b782f3a368..3a4c1c56bb1 100644--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/hooks/useMoveHoverToCurrentCell.ts+++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/hooks/useMoveHoverToCurrentCell.ts@@ -1,7 +1,7 @@import { useRecoilCallback } from 'recoil';import { TableCellPosition } from '@/object-record/record-table/types/TableCellPosition';-import { getSnapshotValue } from '@/ui/utilities/recoil-scope/utils/getSnapshotValue';+import { getSnapshotValue } from '@/ui/utilities/state/utils/getSnapshotValue';import { recordTableHoverPositionComponentState } from '@/object-record/record-table/states/recordTableHoverPositionComponentState';import { isSomeCellInEditModeComponentSelector } from '@/object-record/record-table/states/selectors/isSomeCellInEditModeComponentSelector';diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/hooks/useTriggerActionMenuDropdown.ts b/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/hooks/useTriggerActionMenuDropdown.tsindex dbd67d52a3e..7852e89bf48 100644--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/hooks/useTriggerActionMenuDropdown.ts+++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/hooks/useTriggerActionMenuDropdown.ts@@ -6,9 +6,9 @@ import { getActionMenuDropdownIdFromActionMenuId } from '@/action-menu/utils/getimport { useCommandMenu } from '@/command-menu/hooks/useCommandMenu';import { isRowSelectedComponentFamilyState } from '@/object-record/record-table/record-table-row/states/isRowSelectedComponentFamilyState';import { useOpenDropdown } from '@/ui/layout/dropdown/hooks/useOpenDropdown';-import { getSnapshotValue } from '@/ui/utilities/recoil-scope/utils/getSnapshotValue';import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';import { useRecoilComponentCallbackStateV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentCallbackStateV2';+import { getSnapshotValue } from '@/ui/utilities/state/utils/getSnapshotValue';export const useTriggerActionMenuDropdown = ({recordTableId,diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-header/components/RecordTableHeaderCell.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-header/components/RecordTableHeaderCell.tsxindex 392bc41f5ad..3beb8b6989a 100644--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-header/components/RecordTableHeaderCell.tsx+++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-header/components/RecordTableHeaderCell.tsx@@ -17,12 +17,12 @@ import { tableColumnsComponentState } from '@/object-record/record-table/states/import { ColumnDefinition } from '@/object-record/record-table/types/ColumnDefinition';import { useTrackPointer } from '@/ui/utilities/pointer-event/hooks/useTrackPointer';import { PointerEventListener } from '@/ui/utilities/pointer-event/types/PointerEventListener';-import { getSnapshotValue } from '@/ui/utilities/recoil-scope/utils/getSnapshotValue';import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';import { useRecoilComponentCallbackStateV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentCallbackStateV2';import { useRecoilComponentFamilyValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentFamilyValueV2';import { useRecoilComponentStateV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentStateV2';import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';+import { getSnapshotValue } from '@/ui/utilities/state/utils/getSnapshotValue';import { IconPlus } from 'twenty-ui/display';import { LightIconButton } from 'twenty-ui/input';import { mapArrayToObject } from '~/utils/array/mapArrayToObject';diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-row/hooks/useSetCurrentRowSelected.ts b/packages/twenty-front/src/modules/object-record/record-table/record-table-row/hooks/useSetCurrentRowSelected.tsindex 1ca68e2e469..70a0b86a48f 100644--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-row/hooks/useSetCurrentRowSelected.ts+++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-row/hooks/useSetCurrentRowSelected.ts@@ -4,8 +4,8 @@ import { recordIndexAllRecordIdsComponentSelector } from '@/object-record/recordimport { useRecordTableRowContextOrThrow } from '@/object-record/record-table/contexts/RecordTableRowContext';import { isRowSelectedComponentFamilyState } from '@/object-record/record-table/record-table-row/states/isRowSelectedComponentFamilyState';import { lastSelectedRowIndexComponentState } from '@/object-record/record-table/record-table-row/states/lastSelectedRowIndexComponentState';-import { getSnapshotValue } from '@/ui/utilities/recoil-scope/utils/getSnapshotValue';import { useRecoilComponentCallbackStateV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentCallbackStateV2';+import { getSnapshotValue } from '@/ui/utilities/state/utils/getSnapshotValue';import { isDefined } from 'twenty-shared/utils';export const useSetCurrentRowSelected = () => {diff --git a/packages/twenty-front/src/modules/object-record/record-table/states/context/RecordTableComponentInstanceContext.ts b/packages/twenty-front/src/modules/object-record/record-table/states/context/RecordTableComponentInstanceContext.tsindex 689e25fbc78..6d058637d34 100644--- a/packages/twenty-front/src/modules/object-record/record-table/states/context/RecordTableComponentInstanceContext.ts+++ b/packages/twenty-front/src/modules/object-record/record-table/states/context/RecordTableComponentInstanceContext.ts@@ -4,7 +4,6 @@ import { ComponentStateKeyV2 } from '@/ui/utilities/state/component-state/types/import { createComponentInstanceContext } from '@/ui/utilities/state/component-state/utils/createComponentInstanceContext';import { ColumnDefinition } from '../../types/ColumnDefinition';-// TODO: separate scope contexts from event contextstype RecordTableComponentInstanceContextProps = ComponentStateKeyV2 & {onColumnsChange: (columns: ColumnDefinition<FieldMetadata>[]) => void;};diff --git a/packages/twenty-front/src/modules/object-record/record-title-cell/hooks/useRecordTitleCell.tsx b/packages/twenty-front/src/modules/object-record/record-title-cell/hooks/useRecordTitleCell.tsxindex 42c4c5c0cfb..499f2edf795 100644--- a/packages/twenty-front/src/modules/object-record/record-title-cell/hooks/useRecordTitleCell.tsx+++ b/packages/twenty-front/src/modules/object-record/record-title-cell/hooks/useRecordTitleCell.tsx@@ -1,7 +1,7 @@import { useContextStoreObjectMetadataItemOrThrow } from '@/context-store/hooks/useContextStoreObjectMetadataItemOrThrow';import { formatFieldMetadataItemAsColumnDefinition } from '@/object-metadata/utils/formatFieldMetadataItemAsColumnDefinition';import { useInitDraftValueV2 } from '@/object-record/record-field/hooks/useInitDraftValueV2';-import { isInlineCellInEditModeScopedState } from '@/object-record/record-inline-cell/states/isInlineCellInEditModeScopedState';+import { isInlineCellInEditModeFamilyState } from '@/object-record/record-inline-cell/states/isInlineCellInEditModeFamilyState';import { RecordTitleCellContainerType } from '@/object-record/record-title-cell/types/RecordTitleCellContainerType';import { getRecordFieldInputInstanceId } from '@/object-record/utils/getRecordFieldInputId';import { useGoBackToPreviousDropdownFocusId } from '@/ui/layout/dropdown/hooks/useGoBackToPreviousDropdownFocusId';@@ -32,7 +32,7 @@ export const useRecordTitleCell = () => {containerType: RecordTitleCellContainerType;}) => {set(- isInlineCellInEditModeScopedState(+ isInlineCellInEditModeFamilyState(getRecordFieldInputInstanceId({recordId,fieldName,@@ -93,7 +93,7 @@ export const useRecordTitleCell = () => {fieldName,prefix: containerType,});- set(isInlineCellInEditModeScopedState(recordTitleCellId), true);+ set(isInlineCellInEditModeFamilyState(recordTitleCellId), true);const fieldDefinitions = objectMetadataItem.fields.map((fieldMetadataItem, index) =>diff --git a/packages/twenty-front/src/modules/search/hooks/__tests__/useFilteredSearchRecordQuery.test.tsx b/packages/twenty-front/src/modules/search/hooks/__tests__/useFilteredSearchRecordQuery.test.tsxindex c87dbfb5157..c2f416a6b4b 100644--- a/packages/twenty-front/src/modules/search/hooks/__tests__/useFilteredSearchRecordQuery.test.tsx+++ b/packages/twenty-front/src/modules/search/hooks/__tests__/useFilteredSearchRecordQuery.test.tsx@@ -5,9 +5,9 @@ import { RecoilRoot, useSetRecoilState } from 'recoil';import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';import { objectMetadataItemsState } from '@/object-metadata/states/objectMetadataItemsState';-import { SnackBarComponentInstanceContextProvider } from '@/ui/feedback/snack-bar-manager/scopes/SnackBarComponentInstanceContextProvider';import { MultipleRecordPickerRecords } from '@/object-record/record-picker/multiple-record-picker/types/MultipleRecordPickerRecords';+import { SnackBarComponentInstanceContext } from '@/ui/feedback/snack-bar-manager/contexts/SnackBarComponentInstanceContext';import { generatedMockObjectMetadataItems } from '~/testing/mock-data/generatedMockObjectMetadataItems';import {query,@@ -55,9 +55,11 @@ const mocks = [const Wrapper = ({ children }: { children: ReactNode }) => (<RecoilRoot><MockedProvider mocks={mocks} addTypename={false}>- <SnackBarComponentInstanceContextProvider snackBarComponentInstanceId="snack-bar-manager">+ <SnackBarComponentInstanceContext.Provider+ value={{ instanceId: 'snack-bar-manager' }}+ >{children}- </SnackBarComponentInstanceContextProvider>+ </SnackBarComponentInstanceContext.Provider></MockedProvider></RecoilRoot>);diff --git a/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectFieldActiveActionDropdown.tsx b/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectFieldActiveActionDropdown.tsxindex 72b6b2c1dcf..e7ef66e3feb 100644--- a/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectFieldActiveActionDropdown.tsx+++ b/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectFieldActiveActionDropdown.tsx@@ -19,7 +19,7 @@ type SettingsObjectFieldActiveActionDropdownProps = {onDeactivate?: () => void;onEdit: () => void;onSetAsLabelIdentifier?: () => void;- scopeKey: string;+ fieldMetadataItemId: string;};export const SettingsObjectFieldActiveActionDropdown = ({@@ -27,9 +27,9 @@ export const SettingsObjectFieldActiveActionDropdown = ({onDeactivate,onEdit,onSetAsLabelIdentifier,- scopeKey,+ fieldMetadataItemId,}: SettingsObjectFieldActiveActionDropdownProps) => {- const dropdownId = `${scopeKey}-settings-field-active-action-dropdown`;+ const dropdownId = `${fieldMetadataItemId}-settings-field-active-action-dropdown`;const { closeDropdown } = useCloseDropdown();diff --git a/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectFieldDisabledActionDropdown.tsx b/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectFieldDisabledActionDropdown.tsxindex 85d1a983b27..2bd550411ae 100644--- a/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectFieldDisabledActionDropdown.tsx+++ b/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectFieldDisabledActionDropdown.tsx@@ -21,17 +21,17 @@ type SettingsObjectFieldInactiveActionDropdownProps = {onActivate: () => void;onEdit: () => void;onDelete: () => void;- scopeKey: string;+ fieldMetadataItemId: string;};export const SettingsObjectFieldInactiveActionDropdown = ({onActivate,- scopeKey,+ fieldMetadataItemId,onDelete,onEdit,isCustomField,}: SettingsObjectFieldInactiveActionDropdownProps) => {- const dropdownId = `${scopeKey}-settings-field-disabled-action-dropdown`;+ const dropdownId = `${fieldMetadataItemId}-settings-field-disabled-action-dropdown`;const { closeDropdown } = useCloseDropdown();diff --git a/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectFieldItemTableRow.tsx b/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectFieldItemTableRow.tsxindex 69952e4ca62..51d73f3c3ca 100644--- a/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectFieldItemTableRow.tsx+++ b/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectFieldItemTableRow.tsx@@ -270,7 +270,7 @@ export const SettingsObjectFieldItemTableRow = ({mode === 'view' ? (<SettingsObjectFieldActiveActionDropdownisCustomField={fieldMetadataItem.isCustom === true}- scopeKey={fieldMetadataItem.id}+ fieldMetadataItemId={fieldMetadataItem.id}onEdit={() =>navigate(SettingsPath.ObjectFieldEdit, {objectNamePlural: objectMetadataItem.namePlural,@@ -300,7 +300,7 @@ export const SettingsObjectFieldItemTableRow = ({) : mode === 'view' ? (<SettingsObjectFieldInactiveActionDropdownisCustomField={fieldMetadataItem.isCustom === true}- scopeKey={fieldMetadataItem.id}+ fieldMetadataItemId={fieldMetadataItem.id}onEdit={() =>navigate(SettingsPath.ObjectFieldEdit, {objectNamePlural: objectMetadataItem.namePlural,diff --git a/packages/twenty-front/src/modules/settings/data-model/objects/components/SettingsObjectInactiveMenuDropDown.tsx b/packages/twenty-front/src/modules/settings/data-model/objects/components/SettingsObjectInactiveMenuDropDown.tsxindex 23d7423f508..859038042e8 100644--- a/packages/twenty-front/src/modules/settings/data-model/objects/components/SettingsObjectInactiveMenuDropDown.tsx+++ b/packages/twenty-front/src/modules/settings/data-model/objects/components/SettingsObjectInactiveMenuDropDown.tsx@@ -11,16 +11,16 @@ type SettingsObjectInactiveMenuDropDownProps = {isCustomObject: boolean;onActivate: () => void;onDelete: () => void;- scopeKey: string;+ objectMetadataItemNamePlural: string;};export const SettingsObjectInactiveMenuDropDown = ({onActivate,- scopeKey,+ objectMetadataItemNamePlural,onDelete,isCustomObject,}: SettingsObjectInactiveMenuDropDownProps) => {- const dropdownId = `${scopeKey}-settings-object-inactive-menu-dropdown`;+ const dropdownId = `${objectMetadataItemNamePlural}-settings-object-inactive-menu-dropdown`;const { closeDropdown } = useCloseDropdown();diff --git a/packages/twenty-front/src/modules/settings/data-model/objects/components/__stories__/SettingsObjectInactiveMenuDropDown.stories.tsx b/packages/twenty-front/src/modules/settings/data-model/objects/components/__stories__/SettingsObjectInactiveMenuDropDown.stories.tsxindex b160b46e86c..735ce63293f 100644--- a/packages/twenty-front/src/modules/settings/data-model/objects/components/__stories__/SettingsObjectInactiveMenuDropDown.stories.tsx+++ b/packages/twenty-front/src/modules/settings/data-model/objects/components/__stories__/SettingsObjectInactiveMenuDropDown.stories.tsx@@ -1,8 +1,8 @@import { Decorator, Meta, StoryObj } from '@storybook/react';import { expect, fn, userEvent, within } from '@storybook/test';-import { SettingsObjectInactiveMenuDropDown } from '../SettingsObjectInactiveMenuDropDown';import { ComponentDecorator } from 'twenty-ui/testing';+import { SettingsObjectInactiveMenuDropDown } from '../SettingsObjectInactiveMenuDropDown';const handleActivateMockFunction = fn();const handleDeleteMockFunction = fn();@@ -19,7 +19,7 @@ const meta: Meta<typeof SettingsObjectInactiveMenuDropDown> = {title: 'Modules/Settings/DataModel/SettingsObjectInactiveMenuDropDown',component: SettingsObjectInactiveMenuDropDown,args: {- scopeKey: 'settings-object-inactive-menu-dropdown',+ objectMetadataItemNamePlural: 'settings-object-inactive-menu-dropdown',onActivate: handleActivateMockFunction,onDelete: handleDeleteMockFunction,},diff --git a/packages/twenty-front/src/modules/settings/hooks/__tests__/useSettingsNavigationItems.test.tsx b/packages/twenty-front/src/modules/settings/hooks/__tests__/useSettingsNavigationItems.test.tsxindex 97e01e60d54..9a0befeef89 100644--- a/packages/twenty-front/src/modules/settings/hooks/__tests__/useSettingsNavigationItems.test.tsx+++ b/packages/twenty-front/src/modules/settings/hooks/__tests__/useSettingsNavigationItems.test.tsx@@ -14,7 +14,7 @@ import { currentUserState } from '@/auth/states/currentUserState';import { billingState } from '@/client-config/states/billingState';import { labPublicFeatureFlagsState } from '@/client-config/states/labPublicFeatureFlagsState';import { usePermissionFlagMap } from '@/settings/roles/hooks/usePermissionFlagMap';-import { SnackBarComponentInstanceContextProvider } from '@/ui/feedback/snack-bar-manager/scopes/SnackBarComponentInstanceContextProvider';+import { SnackBarComponentInstanceContext } from '@/ui/feedback/snack-bar-manager/contexts/SnackBarComponentInstanceContext';const mockCurrentUser = {id: 'fake-user-id',@@ -45,9 +45,11 @@ const Wrapper = ({ children }: { children: ReactNode }) => (<MockedProvider><RecoilRoot initializeState={initializeState}><MemoryRouter>- <SnackBarComponentInstanceContextProvider snackBarComponentInstanceId="test-scope-id">+ <SnackBarComponentInstanceContext.Provider+ value={{ instanceId: 'test-scope-id' }}+ >{children}- </SnackBarComponentInstanceContextProvider>+ </SnackBarComponentInstanceContext.Provider></MemoryRouter></RecoilRoot></MockedProvider>diff --git a/packages/twenty-front/src/modules/settings/playground/components/__stories__/GraphQLPlayground.stories.tsx b/packages/twenty-front/src/modules/settings/playground/components/__stories__/GraphQLPlayground.stories.tsxindex 52e9dd63e19..54b8ca6b6eb 100644--- a/packages/twenty-front/src/modules/settings/playground/components/__stories__/GraphQLPlayground.stories.tsx+++ b/packages/twenty-front/src/modules/settings/playground/components/__stories__/GraphQLPlayground.stories.tsx@@ -4,13 +4,12 @@ import { action } from '@storybook/addon-actions';import { Meta, StoryObj } from '@storybook/react';import { useEffect } from 'react';import { useSetRecoilState } from 'recoil';-import { ComponentWithRecoilScopeDecorator } from '~/testing/decorators/ComponentWithRecoilScopeDecorator';-import { I18nFrontDecorator } from '~/testing/decorators/I18nFrontDecorator';-import { graphqlMocks } from '~/testing/graphqlMocks';import {ComponentDecorator,ComponentWithRouterDecorator,} from 'twenty-ui/testing';+import { I18nFrontDecorator } from '~/testing/decorators/I18nFrontDecorator';+import { graphqlMocks } from '~/testing/graphqlMocks';const PlaygroundApiKeySetterEffect = () => {const setPlaygroundApiKey = useSetRecoilState(playgroundApiKeyState);@@ -29,7 +28,6 @@ const meta: Meta<typeof GraphQLPlayground> = {ComponentDecorator,I18nFrontDecorator,ComponentWithRouterDecorator,- ComponentWithRecoilScopeDecorator,],parameters: {docs: {diff --git a/packages/twenty-front/src/modules/settings/playground/components/__stories__/PlaygroundSetupForm.stories.tsx b/packages/twenty-front/src/modules/settings/playground/components/__stories__/PlaygroundSetupForm.stories.tsxindex 351c2707ac5..ef1c5acbaed 100644--- a/packages/twenty-front/src/modules/settings/playground/components/__stories__/PlaygroundSetupForm.stories.tsx+++ b/packages/twenty-front/src/modules/settings/playground/components/__stories__/PlaygroundSetupForm.stories.tsx@@ -1,18 +1,12 @@import { Meta, StoryObj } from '@storybook/react';-import { ComponentWithRecoilScopeDecorator } from '~/testing/decorators/ComponentWithRecoilScopeDecorator';+import { ComponentDecorator, RouterDecorator } from 'twenty-ui/testing';import { I18nFrontDecorator } from '~/testing/decorators/I18nFrontDecorator';import { PlaygroundSetupForm } from '../PlaygroundSetupForm';-import { ComponentDecorator, RouterDecorator } from 'twenty-ui/testing';const meta: Meta<typeof PlaygroundSetupForm> = {title: 'Modules/Settings/Playground/PlaygroundSetupForm',component: PlaygroundSetupForm,- decorators: [- ComponentDecorator,- RouterDecorator,- I18nFrontDecorator,- ComponentWithRecoilScopeDecorator,- ],+ decorators: [ComponentDecorator, RouterDecorator, I18nFrontDecorator],parameters: {docs: {description: {diff --git a/packages/twenty-front/src/modules/settings/playground/components/__stories__/RestPlayground.stories.tsx b/packages/twenty-front/src/modules/settings/playground/components/__stories__/RestPlayground.stories.tsxindex 2bfaded0996..2c1c5b3367e 100644--- a/packages/twenty-front/src/modules/settings/playground/components/__stories__/RestPlayground.stories.tsx+++ b/packages/twenty-front/src/modules/settings/playground/components/__stories__/RestPlayground.stories.tsx@@ -2,13 +2,12 @@ import { playgroundApiKeyState } from '@/settings/playground/states/playgroundApimport { PlaygroundSchemas } from '@/settings/playground/types/PlaygroundSchemas';import { action } from '@storybook/addon-actions';import { Meta, StoryObj } from '@storybook/react';-import { http, HttpResponse } from 'msw';+import { HttpResponse, http } from 'msw';import { useEffect } from 'react';import { useSetRecoilState } from 'recoil';-import { ComponentWithRecoilScopeDecorator } from '~/testing/decorators/ComponentWithRecoilScopeDecorator';+import { ComponentDecorator } from 'twenty-ui/testing';import { I18nFrontDecorator } from '~/testing/decorators/I18nFrontDecorator';import { RestPlayground } from '../RestPlayground';-import { ComponentDecorator } from 'twenty-ui/testing';const PlaygroundApiKeySetterEffect = () => {const setPlaygroundApiKey = useSetRecoilState(playgroundApiKeyState);@@ -88,11 +87,7 @@ const openApiSpec = {const meta: Meta<typeof RestPlayground> = {title: 'Modules/Settings/Playground/RestPlayground',component: RestPlayground,- decorators: [- ComponentDecorator,- I18nFrontDecorator,- ComponentWithRecoilScopeDecorator,- ],+ decorators: [ComponentDecorator, I18nFrontDecorator],parameters: {docs: {description: {diff --git a/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesQueryEffect.tsx b/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesQueryEffect.tsxindex bee0af67131..24f90e61c43 100644--- a/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesQueryEffect.tsx+++ b/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesQueryEffect.tsx@@ -2,7 +2,7 @@ import { settingsDraftRoleFamilyState } from '@/settings/roles/states/settingsDrimport { settingsPersistedRoleFamilyState } from '@/settings/roles/states/settingsPersistedRoleFamilyState';import { settingsRoleIdsState } from '@/settings/roles/states/settingsRoleIdsState';import { settingsRolesIsLoadingState } from '@/settings/roles/states/settingsRolesIsLoadingState';-import { getSnapshotValue } from '@/ui/utilities/recoil-scope/utils/getSnapshotValue';+import { getSnapshotValue } from '@/ui/utilities/state/utils/getSnapshotValue';import { useEffect } from 'react';import { useRecoilCallback, useSetRecoilState } from 'recoil';import { isDefined } from 'twenty-shared/utils';diff --git a/packages/twenty-front/src/modules/settings/roles/role/components/SettingsRoleEditEffect.tsx b/packages/twenty-front/src/modules/settings/roles/role/components/SettingsRoleEditEffect.tsxindex 04898aad84d..8667ade15ae 100644--- a/packages/twenty-front/src/modules/settings/roles/role/components/SettingsRoleEditEffect.tsx+++ b/packages/twenty-front/src/modules/settings/roles/role/components/SettingsRoleEditEffect.tsx@@ -2,8 +2,8 @@ import { SETTINGS_ROLE_DETAIL_TABS } from '@/settings/roles/role/constants/Settiimport { settingsDraftRoleFamilyState } from '@/settings/roles/states/settingsDraftRoleFamilyState';import { settingsPersistedRoleFamilyState } from '@/settings/roles/states/settingsPersistedRoleFamilyState';import { activeTabIdComponentState } from '@/ui/layout/tab-list/states/activeTabIdComponentState';-import { getSnapshotValue } from '@/ui/utilities/recoil-scope/utils/getSnapshotValue';import { useSetRecoilComponentStateV2 } from '@/ui/utilities/state/component-state/hooks/useSetRecoilComponentStateV2';+import { getSnapshotValue } from '@/ui/utilities/state/utils/getSnapshotValue';import { useEffect, useState } from 'react';import { useRecoilCallback, useRecoilValue } from 'recoil';import { isDefined } from 'twenty-shared/utils';diff --git a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/__stories__/MatchColumns.stories.tsx b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/__stories__/MatchColumns.stories.tsxindex cd1d1811e84..cb9f8e5fee4 100644--- a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/__stories__/MatchColumns.stories.tsx+++ b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/__stories__/MatchColumns.stories.tsx@@ -5,7 +5,7 @@ import { ReactSpreadsheetImportContextProvider } from '@/spreadsheet-import/compimport { SpreadSheetImportModalWrapper } from '@/spreadsheet-import/components/SpreadSheetImportModalWrapper';import { MatchColumnsStep } from '@/spreadsheet-import/steps/components/MatchColumnsStep/MatchColumnsStep';import { SpreadsheetImportStep } from '@/spreadsheet-import/steps/types/SpreadsheetImportStep';-import { DialogManagerScope } from '@/ui/feedback/dialog-manager/scopes/DialogManagerScope';+import { DialogComponentInstanceContext } from '@/ui/feedback/dialog-manager/contexts/DialogComponentInstanceContext';import { I18nFrontDecorator } from '~/testing/decorators/I18nFrontDecorator';import { SnackBarDecorator } from '~/testing/decorators/SnackBarDecorator';@@ -62,7 +62,9 @@ const mockData = [];export const Default = () => (- <DialogManagerScope dialogComponentInstanceId="dialog-manager">+ <DialogComponentInstanceContext.Provider+ value={{ instanceId: 'dialog-manager' }}+ ><ReactSpreadsheetImportContextProvider values={mockRsiValues}><SpreadSheetImportModalWrappermodalId="match-columns-step"@@ -80,5 +82,5 @@ export const Default = () => (/></SpreadSheetImportModalWrapper></ReactSpreadsheetImportContextProvider>- </DialogManagerScope>+ </DialogComponentInstanceContext.Provider>);diff --git a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/__stories__/SelectHeader.stories.tsx b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/__stories__/SelectHeader.stories.tsxindex f59ff3f5f2a..97b634c2850 100644--- a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/__stories__/SelectHeader.stories.tsx+++ b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/__stories__/SelectHeader.stories.tsx@@ -8,7 +8,7 @@ import { ReactSpreadsheetImportContextProvider } from '@/spreadsheet-import/compimport { SpreadSheetImportModalWrapper } from '@/spreadsheet-import/components/SpreadSheetImportModalWrapper';import { SelectHeaderStep } from '@/spreadsheet-import/steps/components/SelectHeaderStep/SelectHeaderStep';import { SpreadsheetImportStepType } from '@/spreadsheet-import/steps/types/SpreadsheetImportStepType';-import { DialogManagerScope } from '@/ui/feedback/dialog-manager/scopes/DialogManagerScope';+import { DialogComponentInstanceContext } from '@/ui/feedback/dialog-manager/contexts/DialogComponentInstanceContext';import { isModalOpenedComponentState } from '@/ui/layout/modal/states/isModalOpenedComponentState';import { RecoilRoot } from 'recoil';import { I18nFrontDecorator } from '~/testing/decorators/I18nFrontDecorator';@@ -40,7 +40,9 @@ const meta: Meta<typeof SelectHeaderStep> = {export default meta;export const Default = () => (- <DialogManagerScope dialogComponentInstanceId="dialog-manager">+ <DialogComponentInstanceContext.Provider+ value={{ instanceId: 'dialog-manager' }}+ ><ReactSpreadsheetImportContextProvider values={mockRsiValues}><SpreadSheetImportModalWrappermodalId="select-header-step"@@ -60,5 +62,5 @@ export const Default = () => (/></SpreadSheetImportModalWrapper></ReactSpreadsheetImportContextProvider>- </DialogManagerScope>+ </DialogComponentInstanceContext.Provider>);diff --git a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/__stories__/SelectSheet.stories.tsx b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/__stories__/SelectSheet.stories.tsxindex 7dbc22c7633..1a34e3f4207 100644--- a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/__stories__/SelectSheet.stories.tsx+++ b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/__stories__/SelectSheet.stories.tsx@@ -5,7 +5,7 @@ import { ReactSpreadsheetImportContextProvider } from '@/spreadsheet-import/compimport { SpreadSheetImportModalWrapper } from '@/spreadsheet-import/components/SpreadSheetImportModalWrapper';import { SelectSheetStep } from '@/spreadsheet-import/steps/components/SelectSheetStep/SelectSheetStep';import { SpreadsheetImportStepType } from '@/spreadsheet-import/steps/types/SpreadsheetImportStepType';-import { DialogManagerScope } from '@/ui/feedback/dialog-manager/scopes/DialogManagerScope';+import { DialogComponentInstanceContext } from '@/ui/feedback/dialog-manager/contexts/DialogComponentInstanceContext';import { isModalOpenedComponentState } from '@/ui/layout/modal/states/isModalOpenedComponentState';import { RecoilRoot } from 'recoil';import { I18nFrontDecorator } from '~/testing/decorators/I18nFrontDecorator';@@ -40,7 +40,9 @@ export default meta;const sheetNames = ['Sheet1', 'Sheet2', 'Sheet3'];export const Default = () => (- <DialogManagerScope dialogComponentInstanceId="dialog-manager">+ <DialogComponentInstanceContext.Provider+ value={{ instanceId: 'dialog-manager' }}+ ><ReactSpreadsheetImportContextProvider values={mockRsiValues}><SpreadSheetImportModalWrappermodalId="select-sheet-step"@@ -78,5 +80,5 @@ export const Default = () => (/></SpreadSheetImportModalWrapper></ReactSpreadsheetImportContextProvider>- </DialogManagerScope>+ </DialogComponentInstanceContext.Provider>);diff --git a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/__stories__/Steps.stories.tsx b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/__stories__/Steps.stories.tsxindex 7d74d6021e4..1e36f31b2ed 100644--- a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/__stories__/Steps.stories.tsx+++ b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/__stories__/Steps.stories.tsx@@ -1,6 +1,5 @@import { Meta, StoryObj } from '@storybook/react';-import { ComponentWithRecoilScopeDecorator } from '~/testing/decorators/ComponentWithRecoilScopeDecorator';import { SnackBarDecorator } from '~/testing/decorators/SnackBarDecorator';import { stepBarInternalState } from '@/ui/navigation/step-bar/states/stepBarInternalState';@@ -13,7 +12,6 @@ const meta: Meta<typeof SpreadsheetImportStepperContainer> = {title: 'Modules/SpreadsheetImport/Steps',component: SpreadsheetImportStepperContainer,decorators: [- ComponentWithRecoilScopeDecorator,SnackBarDecorator,I18nFrontDecorator,ObjectMetadataItemsDecorator,diff --git a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/__stories__/Upload.stories.tsx b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/__stories__/Upload.stories.tsxindex 73946a24177..4e5cc4bbb18 100644--- a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/__stories__/Upload.stories.tsx+++ b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/__stories__/Upload.stories.tsx@@ -5,7 +5,7 @@ import { ReactSpreadsheetImportContextProvider } from '@/spreadsheet-import/compimport { SpreadSheetImportModalWrapper } from '@/spreadsheet-import/components/SpreadSheetImportModalWrapper';import { UploadStep } from '@/spreadsheet-import/steps/components/UploadStep/UploadStep';import { SpreadsheetImportStepType } from '@/spreadsheet-import/steps/types/SpreadsheetImportStepType';-import { DialogManagerScope } from '@/ui/feedback/dialog-manager/scopes/DialogManagerScope';+import { DialogComponentInstanceContext } from '@/ui/feedback/dialog-manager/contexts/DialogComponentInstanceContext';import { isModalOpenedComponentState } from '@/ui/layout/modal/states/isModalOpenedComponentState';import { RecoilRoot } from 'recoil';import { ContextStoreDecorator } from '~/testing/decorators/ContextStoreDecorator';@@ -44,7 +44,9 @@ const meta: Meta<typeof UploadStep> = {export default meta;export const Default = () => (- <DialogManagerScope dialogComponentInstanceId="dialog-manager">+ <DialogComponentInstanceContext.Provider+ value={{ instanceId: 'dialog-manager' }}+ ><ReactSpreadsheetImportContextProvider values={mockRsiValues}><SpreadSheetImportModalWrapper modalId="upload-step" onClose={() => null}><UploadStep@@ -57,5 +59,5 @@ export const Default = () => (/></SpreadSheetImportModalWrapper></ReactSpreadsheetImportContextProvider>- </DialogManagerScope>+ </DialogComponentInstanceContext.Provider>);diff --git a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/__stories__/Validation.stories.tsx b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/__stories__/Validation.stories.tsxindex 895e8614d1e..b7f9544e1d6 100644--- a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/__stories__/Validation.stories.tsx+++ b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/__stories__/Validation.stories.tsx@@ -8,7 +8,7 @@ import {import { ReactSpreadsheetImportContextProvider } from '@/spreadsheet-import/components/ReactSpreadsheetImportContextProvider';import { SpreadSheetImportModalWrapper } from '@/spreadsheet-import/components/SpreadSheetImportModalWrapper';import { ValidationStep } from '@/spreadsheet-import/steps/components/ValidationStep/ValidationStep';-import { DialogManagerScope } from '@/ui/feedback/dialog-manager/scopes/DialogManagerScope';+import { DialogComponentInstanceContext } from '@/ui/feedback/dialog-manager/contexts/DialogComponentInstanceContext';import { isModalOpenedComponentState } from '@/ui/layout/modal/states/isModalOpenedComponentState';import { RecoilRoot } from 'recoil';import { I18nFrontDecorator } from '~/testing/decorators/I18nFrontDecorator';@@ -43,7 +43,9 @@ export default meta;const file = new File([''], 'file.csv');export const Default = () => (- <DialogManagerScope dialogComponentInstanceId="dialog-manager">+ <DialogComponentInstanceContext.Provider+ value={{ instanceId: 'dialog-manager' }}+ ><ReactSpreadsheetImportContextProvider values={mockRsiValues}><SpreadSheetImportModalWrappermodalId="validation-step"@@ -58,5 +60,5 @@ export const Default = () => (/></SpreadSheetImportModalWrapper></ReactSpreadsheetImportContextProvider>- </DialogManagerScope>+ </DialogComponentInstanceContext.Provider>);diff --git a/packages/twenty-front/src/modules/types/RecoilScopeContext.ts b/packages/twenty-front/src/modules/types/RecoilScopeContext.tsdeleted file mode 100644index 0a7b4188bcd..00000000000--- a/packages/twenty-front/src/modules/types/RecoilScopeContext.ts+++ /dev/null@@ -1,3 +0,0 @@-import { Context } from 'react';--export type RecoilScopeContext = Context<string | null>;diff --git a/packages/twenty-front/src/modules/ui/feedback/dialog-manager/constants/DialogManagerHotkeyScopeMemoizeKey.ts b/packages/twenty-front/src/modules/ui/feedback/dialog-manager/constants/DialogManagerHotkeyScopeMemoizeKey.tsdeleted file mode 100644index 21e4fddcb23..00000000000--- a/packages/twenty-front/src/modules/ui/feedback/dialog-manager/constants/DialogManagerHotkeyScopeMemoizeKey.ts+++ /dev/null@@ -1 +0,0 @@-export const DIALOG_MANAGER_HOTKEY_SCOPE_MEMOIZE_KEY = 'dialog-manager';diff --git a/packages/twenty-front/src/modules/ui/feedback/dialog-manager/hooks/__tests__/useDialogManager.test.tsx b/packages/twenty-front/src/modules/ui/feedback/dialog-manager/hooks/__tests__/useDialogManager.test.tsxindex ba83b25a8ef..a59a83ae50d 100644--- a/packages/twenty-front/src/modules/ui/feedback/dialog-manager/hooks/__tests__/useDialogManager.test.tsx+++ b/packages/twenty-front/src/modules/ui/feedback/dialog-manager/hooks/__tests__/useDialogManager.test.tsx@@ -2,8 +2,8 @@ import { act, renderHook } from '@testing-library/react';import { RecoilRoot } from 'recoil';import { v4 as uuidv4 } from 'uuid';+import { DialogComponentInstanceContext } from '@/ui/feedback/dialog-manager/contexts/DialogComponentInstanceContext';import { useDialogManager } from '@/ui/feedback/dialog-manager/hooks/useDialogManager';-import { DialogManagerScope } from '@/ui/feedback/dialog-manager/scopes/DialogManagerScope';import { dialogInternalComponentState } from '@/ui/feedback/dialog-manager/states/dialogInternalComponentState';import { DialogOptions } from '@/ui/feedback/dialog-manager/types/DialogOptions';import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';@@ -13,12 +13,13 @@ jest.mock('uuid');(uuidv4 as jest.Mock).mockReturnValue(mockedUuid);-const dialogManagerScopeId = 'dialog-manager';const Wrapper = ({ children }: { children: React.ReactNode }) => (<RecoilRoot>- <DialogManagerScope dialogComponentInstanceId={dialogManagerScopeId}>+ <DialogComponentInstanceContext.Provider+ value={{ instanceId: 'dialog-manager' }}+ >{children}- </DialogManagerScope>+ </DialogComponentInstanceContext.Provider></RecoilRoot>);diff --git a/packages/twenty-front/src/modules/ui/feedback/dialog-manager/scopes/DialogManagerScope.tsx b/packages/twenty-front/src/modules/ui/feedback/dialog-manager/scopes/DialogManagerScope.tsxdeleted file mode 100644index 82efa844016..00000000000--- a/packages/twenty-front/src/modules/ui/feedback/dialog-manager/scopes/DialogManagerScope.tsx+++ /dev/null@@ -1,21 +0,0 @@-import { ReactNode } from 'react';--import { DialogComponentInstanceContext } from '@/ui/feedback/dialog-manager/contexts/DialogComponentInstanceContext';--type DialogManagerScopeProps = {- children: ReactNode;- dialogComponentInstanceId: string;-};--export const DialogManagerScope = ({- children,- dialogComponentInstanceId,-}: DialogManagerScopeProps) => {- return (- <DialogComponentInstanceContext.Provider- value={{ instanceId: dialogComponentInstanceId }}- >- {children}- </DialogComponentInstanceContext.Provider>- );-};diff --git a/packages/twenty-front/src/modules/ui/feedback/snack-bar-manager/scopes/SnackBarComponentInstanceContextProvider.tsx b/packages/twenty-front/src/modules/ui/feedback/snack-bar-manager/scopes/SnackBarComponentInstanceContextProvider.tsxdeleted file mode 100644index 6b09175986a..00000000000--- a/packages/twenty-front/src/modules/ui/feedback/snack-bar-manager/scopes/SnackBarComponentInstanceContextProvider.tsx+++ /dev/null@@ -1,21 +0,0 @@-import { ReactNode } from 'react';--import { SnackBarComponentInstanceContext } from '@/ui/feedback/snack-bar-manager/contexts/SnackBarComponentInstanceContext';--type SnackBarComponentInstanceContextProviderProps = {- children: ReactNode;- snackBarComponentInstanceId: string;-};--export const SnackBarComponentInstanceContextProvider = ({- children,- snackBarComponentInstanceId,-}: SnackBarComponentInstanceContextProviderProps) => {- return (- <SnackBarComponentInstanceContext.Provider- value={{ instanceId: snackBarComponentInstanceId }}- >- {children}- </SnackBarComponentInstanceContext.Provider>- );-};diff --git a/packages/twenty-front/src/modules/ui/layout/dropdown/components/Dropdown.tsx b/packages/twenty-front/src/modules/ui/layout/dropdown/components/Dropdown.tsxindex 6fa6f1ccea1..fbf60f4c8e3 100644--- a/packages/twenty-front/src/modules/ui/layout/dropdown/components/Dropdown.tsx+++ b/packages/twenty-front/src/modules/ui/layout/dropdown/components/Dropdown.tsx@@ -4,7 +4,6 @@ import { DROPDOWN_RESIZE_MIN_HEIGHT } from '@/ui/layout/dropdown/constants/Dropdimport { DROPDOWN_RESIZE_MIN_WIDTH } from '@/ui/layout/dropdown/constants/DropdownResizeMinWidth';import { DropdownComponentInstanceContext } from '@/ui/layout/dropdown/contexts/DropdownComponentInstanceContext';import { useToggleDropdown } from '@/ui/layout/dropdown/hooks/useToggleDropdown';-import { DropdownScope } from '@/ui/layout/dropdown/scopes/DropdownScope';import { dropdownMaxHeightComponentState } from '@/ui/layout/dropdown/states/internal/dropdownMaxHeightComponentState';import { dropdownMaxWidthComponentState } from '@/ui/layout/dropdown/states/internal/dropdownMaxWidthComponentState';import { isDropdownOpenComponentState } from '@/ui/layout/dropdown/states/isDropdownOpenComponentState';@@ -174,43 +173,39 @@ export const Dropdown = ({<DropdownComponentInstanceContext.Providervalue={{ instanceId: dropdownId }}>- <DropdownScope dropdownScopeId={dropdownId}>- <>- {isDefined(clickableComponent) ? (- <StyledClickableComponent- ref={refs.setReference}- onClick={handleClickableComponentClick}- aria-controls={`${dropdownId}-options`}- aria-expanded={isDropdownOpen}- aria-haspopup={true}- role="button"- width={clickableComponentWidth}- >- {clickableComponent}- </StyledClickableComponent>- ) : (- <StyledDropdownFallbackAnchor ref={refs.setReference} />- )}- {isDropdownOpen && (- <DropdownInternalContainer- floatingStyles={floatingStyles}- dropdownComponents={dropdownComponents}- dropdownId={dropdownId}- dropdownPlacement={placement}- floatingUiRefs={refs}- hotkey={hotkey}- onClickOutside={onClickOutside}- onHotkeyTriggered={onOpen}- excludedClickOutsideIds={excludedClickOutsideIds}- isDropdownInModal={isDropdownInModal}- />- )}- <DropdownOnToggleEffect- onDropdownClose={onClose}- onDropdownOpen={onOpen}- />- </>- </DropdownScope>+ {isDefined(clickableComponent) ? (+ <StyledClickableComponent+ ref={refs.setReference}+ onClick={handleClickableComponentClick}+ aria-controls={`${dropdownId}-options`}+ aria-expanded={isDropdownOpen}+ aria-haspopup={true}+ role="button"+ width={clickableComponentWidth}+ >+ {clickableComponent}+ </StyledClickableComponent>+ ) : (+ <StyledDropdownFallbackAnchor ref={refs.setReference} />+ )}+ {isDropdownOpen && (+ <DropdownInternalContainer+ floatingStyles={floatingStyles}+ dropdownComponents={dropdownComponents}+ dropdownId={dropdownId}+ dropdownPlacement={placement}+ floatingUiRefs={refs}+ hotkey={hotkey}+ onClickOutside={onClickOutside}+ onHotkeyTriggered={onOpen}+ excludedClickOutsideIds={excludedClickOutsideIds}+ isDropdownInModal={isDropdownInModal}+ />+ )}+ <DropdownOnToggleEffect+ onDropdownClose={onClose}+ onDropdownOpen={onOpen}+ /></DropdownComponentInstanceContext.Provider>);};diff --git a/packages/twenty-front/src/modules/ui/layout/dropdown/scopes/DropdownScope.tsx b/packages/twenty-front/src/modules/ui/layout/dropdown/scopes/DropdownScope.tsxdeleted file mode 100644index e6e53702da2..00000000000--- a/packages/twenty-front/src/modules/ui/layout/dropdown/scopes/DropdownScope.tsx+++ /dev/null@@ -1,19 +0,0 @@-import { ReactNode } from 'react';--import { DropdownScopeInternalContext } from './scope-internal-context/DropdownScopeInternalContext';--type DropdownScopeProps = {- children: ReactNode;- dropdownScopeId: string;-};--export const DropdownScope = ({- children,- dropdownScopeId,-}: DropdownScopeProps) => {- return (- <DropdownScopeInternalContext.Provider value={{ scopeId: dropdownScopeId }}>- {children}- </DropdownScopeInternalContext.Provider>- );-};diff --git a/packages/twenty-front/src/modules/ui/layout/dropdown/scopes/scope-internal-context/DropdownScopeInternalContext.ts b/packages/twenty-front/src/modules/ui/layout/dropdown/scopes/scope-internal-context/DropdownScopeInternalContext.tsdeleted file mode 100644index ed9516be68f..00000000000--- a/packages/twenty-front/src/modules/ui/layout/dropdown/scopes/scope-internal-context/DropdownScopeInternalContext.ts+++ /dev/null@@ -1,7 +0,0 @@-import { createScopeInternalContext } from '@/ui/utilities/recoil-scope/scopes-internal/utils/createScopeInternalContext';-import { RecoilComponentStateKey } from '@/ui/utilities/state/component-state/types/RecoilComponentStateKey';--type DropdownScopeInternalContextProps = RecoilComponentStateKey;--export const DropdownScopeInternalContext =- createScopeInternalContext<DropdownScopeInternalContextProps>();diff --git a/packages/twenty-front/src/modules/ui/layout/selectable-list/hooks/__tests__/useSelectableList.test.ts b/packages/twenty-front/src/modules/ui/layout/selectable-list/hooks/__tests__/useSelectableList.test.tsindex f6a26777b3a..dd68596cfce 100644--- a/packages/twenty-front/src/modules/ui/layout/selectable-list/hooks/__tests__/useSelectableList.test.ts+++ b/packages/twenty-front/src/modules/ui/layout/selectable-list/hooks/__tests__/useSelectableList.test.ts@@ -8,7 +8,7 @@ import { selectedItemIdComponentState } from '@/ui/layout/selectable-list/statesimport { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';import { useSetRecoilComponentStateV2 } from '@/ui/utilities/state/component-state/hooks/useSetRecoilComponentStateV2';-const selectableListScopeId = 'testId';+const selectableListComponentInstanceId = 'testId';const testArr = [['1'], ['2'], ['3']];const emptyArr = [[]];@@ -18,12 +18,12 @@ describe('useSelectableList', () => {() => {const setSelectableItemIds = useSetRecoilComponentStateV2(selectableItemIdsComponentState,- selectableListScopeId,+ selectableListComponentInstanceId,);const selectableItemIds = useRecoilComponentValueV2(selectableItemIdsComponentState,- selectableListScopeId,+ selectableListComponentInstanceId,);return {@@ -45,18 +45,20 @@ describe('useSelectableList', () => {expect(result.current.selectableItemIds).toEqual(testArr);});- it('Should resetSelectItem', async () => {+ it('Should resetSelectedItem', async () => {const { result } = renderHook(() => {- const { resetSelectedItem } = useSelectableList(selectableListScopeId);+ const { resetSelectedItem } = useSelectableList(+ selectableListComponentInstanceId,+ );const selectedItemId = useRecoilComponentValueV2(selectedItemIdComponentState,- selectableListScopeId,+ selectableListComponentInstanceId,);const setSelectedItemId = useSetRecoilComponentStateV2(selectedItemIdComponentState,- selectableListScopeId,+ selectableListComponentInstanceId,);return {resetSelectedItem,diff --git a/packages/twenty-front/src/modules/ui/layout/selectable-list/hooks/internal/useSelectableListHotKeys.ts b/packages/twenty-front/src/modules/ui/layout/selectable-list/hooks/internal/useSelectableListHotKeys.tsindex 0fb586657d7..0fc3f1edcd7 100644--- a/packages/twenty-front/src/modules/ui/layout/selectable-list/hooks/internal/useSelectableListHotKeys.ts+++ b/packages/twenty-front/src/modules/ui/layout/selectable-list/hooks/internal/useSelectableListHotKeys.ts@@ -6,7 +6,7 @@ import { selectableItemIdsComponentState } from '@/ui/layout/selectable-list/staimport { selectedItemIdComponentState } from '@/ui/layout/selectable-list/states/selectedItemIdComponentState';import { isSelectedItemIdComponentFamilySelector } from '@/ui/layout/selectable-list/states/selectors/isSelectedItemIdComponentFamilySelector';import { useHotkeysOnFocusedElement } from '@/ui/utilities/hotkey/hooks/useHotkeysOnFocusedElement';-import { getSnapshotValue } from '@/ui/utilities/recoil-scope/utils/getSnapshotValue';+import { getSnapshotValue } from '@/ui/utilities/state/utils/getSnapshotValue';type Direction = 'up' | 'down' | 'left' | 'right';diff --git a/packages/twenty-front/src/modules/ui/layout/selectable-list/hooks/useSelectableList.ts b/packages/twenty-front/src/modules/ui/layout/selectable-list/hooks/useSelectableList.tsindex 7fc543aecc5..ce33cb5525b 100644--- a/packages/twenty-front/src/modules/ui/layout/selectable-list/hooks/useSelectableList.ts+++ b/packages/twenty-front/src/modules/ui/layout/selectable-list/hooks/useSelectableList.ts@@ -3,8 +3,8 @@ import { useRecoilCallback } from 'recoil';import { SelectableListComponentInstanceContext } from '@/ui/layout/selectable-list/states/contexts/SelectableListComponentInstanceContext';import { selectedItemIdComponentState } from '@/ui/layout/selectable-list/states/selectedItemIdComponentState';import { isSelectedItemIdComponentFamilySelector } from '@/ui/layout/selectable-list/states/selectors/isSelectedItemIdComponentFamilySelector';-import { getSnapshotValue } from '@/ui/utilities/recoil-scope/utils/getSnapshotValue';import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';+import { getSnapshotValue } from '@/ui/utilities/state/utils/getSnapshotValue';import { isDefined } from 'twenty-shared/utils';export const useSelectableList = (instanceId?: string) => {diff --git a/packages/twenty-front/src/modules/ui/layout/selectable-list/hooks/useSelectableListListenToEnterHotkeyOnItem.ts b/packages/twenty-front/src/modules/ui/layout/selectable-list/hooks/useSelectableListListenToEnterHotkeyOnItem.tsindex 9a5ef7eb44c..02990dd7423 100644--- a/packages/twenty-front/src/modules/ui/layout/selectable-list/hooks/useSelectableListListenToEnterHotkeyOnItem.ts+++ b/packages/twenty-front/src/modules/ui/layout/selectable-list/hooks/useSelectableListListenToEnterHotkeyOnItem.ts@@ -1,8 +1,8 @@import { SelectableListComponentInstanceContext } from '@/ui/layout/selectable-list/states/contexts/SelectableListComponentInstanceContext';import { selectedItemIdComponentState } from '@/ui/layout/selectable-list/states/selectedItemIdComponentState';import { useHotkeysOnFocusedElement } from '@/ui/utilities/hotkey/hooks/useHotkeysOnFocusedElement';-import { getSnapshotValue } from '@/ui/utilities/recoil-scope/utils/getSnapshotValue';import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';+import { getSnapshotValue } from '@/ui/utilities/state/utils/getSnapshotValue';import { isNonEmptyString } from '@sniptt/guards';import { useRecoilCallback } from 'recoil';import { Key } from 'ts-key-enum';diff --git a/packages/twenty-front/src/modules/ui/layout/tab-list/scopes/TabListScope.tsx b/packages/twenty-front/src/modules/ui/layout/tab-list/scopes/TabListScope.tsxdeleted file mode 100644index e1f52ef0121..00000000000--- a/packages/twenty-front/src/modules/ui/layout/tab-list/scopes/TabListScope.tsx+++ /dev/null@@ -1,19 +0,0 @@-import { ReactNode } from 'react';--import { TabListScopeInternalContext } from './scope-internal-context/TabListScopeInternalContext';--type TabListScopeProps = {- children: ReactNode;- tabListScopeId: string;-};--export const TabListScope = ({- children,- tabListScopeId,-}: TabListScopeProps) => {- return (- <TabListScopeInternalContext.Provider value={{ scopeId: tabListScopeId }}>- {children}- </TabListScopeInternalContext.Provider>- );-};diff --git a/packages/twenty-front/src/modules/ui/layout/tab-list/scopes/scope-internal-context/TabListScopeInternalContext.ts b/packages/twenty-front/src/modules/ui/layout/tab-list/scopes/scope-internal-context/TabListScopeInternalContext.tsdeleted file mode 100644index 5212b7bdba2..00000000000--- a/packages/twenty-front/src/modules/ui/layout/tab-list/scopes/scope-internal-context/TabListScopeInternalContext.ts+++ /dev/null@@ -1,7 +0,0 @@-import { createScopeInternalContext } from '@/ui/utilities/recoil-scope/scopes-internal/utils/createScopeInternalContext';-import { RecoilComponentStateKey } from '@/ui/utilities/state/component-state/types/RecoilComponentStateKey';--type TabListScopeInternalContextProps = RecoilComponentStateKey;--export const TabListScopeInternalContext =- createScopeInternalContext<TabListScopeInternalContextProps>();diff --git a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/hooks/useNavigationSection.ts b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/hooks/useNavigationSection.tsindex 8785c90baf7..33c3255a3b1 100644--- a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/hooks/useNavigationSection.ts+++ b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/hooks/useNavigationSection.ts@@ -2,28 +2,28 @@ import { useRecoilCallback } from 'recoil';import { isNavigationSectionOpenFamilyState } from '@/ui/navigation/navigation-drawer/states/isNavigationSectionOpenFamilyState';-export const useNavigationSection = (scopeId: string) => {+export const useNavigationSection = (navigationSectionId: string) => {const closeNavigationSection = useRecoilCallback(({ set }) =>() => {- set(isNavigationSectionOpenFamilyState(scopeId), false);+ set(isNavigationSectionOpenFamilyState(navigationSectionId), false);},- [scopeId],+ [navigationSectionId],);const openNavigationSection = useRecoilCallback(({ set }) =>() => {- set(isNavigationSectionOpenFamilyState(scopeId), true);+ set(isNavigationSectionOpenFamilyState(navigationSectionId), true);},- [scopeId],+ [navigationSectionId],);const toggleNavigationSection = useRecoilCallback(({ snapshot }) =>() => {const isNavigationSectionOpen = snapshot- .getLoadable(isNavigationSectionOpenFamilyState(scopeId))+ .getLoadable(isNavigationSectionOpenFamilyState(navigationSectionId)).getValue();if (isNavigationSectionOpen) {@@ -32,11 +32,11 @@ export const useNavigationSection = (scopeId: string) => {openNavigationSection();}},- [closeNavigationSection, openNavigationSection, scopeId],+ [closeNavigationSection, openNavigationSection, navigationSectionId],);const isNavigationSectionOpenState =- isNavigationSectionOpenFamilyState(scopeId);+ isNavigationSectionOpenFamilyState(navigationSectionId);return {isNavigationSectionOpenState,diff --git a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/components/RecoilScope.tsx b/packages/twenty-front/src/modules/ui/utilities/recoil-scope/components/RecoilScope.tsxdeleted file mode 100644index b2ee0f6d104..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/components/RecoilScope.tsx+++ /dev/null@@ -1,33 +0,0 @@-import { useRef } from 'react';-import { v4 } from 'uuid';--import { RecoilScopeContext as RecoilScopeContextType } from '@/types/RecoilScopeContext';--import { RecoilScopeContext } from '../states/RecoilScopeContext';--/**- *- * @deprecated Use a custom scope context instead, see example with DropdownScope- */-export const RecoilScope = ({- children,- scopeId,- CustomRecoilScopeContext,-}: {- children: React.ReactNode;- scopeId?: string;- CustomRecoilScopeContext?: RecoilScopeContextType;-}) => {- // eslint-disable-next-line @nx/workspace-no-state-useref- const currentScopeId = useRef(scopeId ?? v4());-- return CustomRecoilScopeContext ? (- <CustomRecoilScopeContext.Provider value={currentScopeId.current}>- {children}- </CustomRecoilScopeContext.Provider>- ) : (- <RecoilScopeContext.Provider value={currentScopeId.current}>- {children}- </RecoilScopeContext.Provider>- );-};diff --git a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/hooks/__tests__/useContextScopeId.test.tsx b/packages/twenty-front/src/modules/ui/utilities/recoil-scope/hooks/__tests__/useContextScopeId.test.tsxdeleted file mode 100644index 810ba3fadb4..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/hooks/__tests__/useContextScopeId.test.tsx+++ /dev/null@@ -1,43 +0,0 @@-import { renderHook } from '@testing-library/react';-import { createContext } from 'react';--import { useContextScopeId } from '@/ui/utilities/recoil-scope/hooks/useContextScopeId';--const mockedContextValue = 'mocked-scope-id';-const MockedContext = createContext<string | null>(mockedContextValue);-const nullContext = createContext<string | null>(null);--const ERROR_MESSAGE =- 'Using useContextScopedId outside of the specified context : undefined, verify that you are using a RecoilScope with the specific context you want to use.';--describe('useContextScopeId', () => {- it('Should return the scoped ID when used within the specified context', () => {- const { result } = renderHook(() => useContextScopeId(MockedContext), {- wrapper: ({ children }) => (- <MockedContext.Provider value={mockedContextValue}>- {children}- </MockedContext.Provider>- ),- });-- const scopeId = result.current;- expect(scopeId).toBe(mockedContextValue);- });-- it('Should throw an error when used outside of the specified context', () => {- // Suppress console errors for this test since we're expecting an error- /* eslint-disable no-console */- const originalConsoleError = console.error;- console.error = jest.fn();- /* eslint-enable no-console */-- expect(() => {- renderHook(() => useContextScopeId(nullContext));- }).toThrow(ERROR_MESSAGE);-- // Restore console.error- /* eslint-disable no-console */- console.error = originalConsoleError;- /* eslint-enable no-console */- });-});diff --git a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/hooks/__tests__/useRecoilScopeId.test.tsx b/packages/twenty-front/src/modules/ui/utilities/recoil-scope/hooks/__tests__/useRecoilScopeId.test.tsxdeleted file mode 100644index 9faa15c44a9..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/hooks/__tests__/useRecoilScopeId.test.tsx+++ /dev/null@@ -1,43 +0,0 @@-import { renderHook } from '@testing-library/react';-import { createContext } from 'react';--import { useRecoilScopeId } from '@/ui/utilities/recoil-scope/hooks/useRecoilScopeId';--const mockedContextValue = 'mocked-scope-id';-const MockedContext = createContext<string | null>(mockedContextValue);-const nullContext = createContext<string | null>(null);--const ERROR_MESSAGE =- 'Using useRecoilScopeId outside of the specified context : undefined, verify that you are using a RecoilScope with the specific context you want to use.';--describe('useRecoilScopeId', () => {- it('Should return the scoped ID when used within the specified context', () => {- const { result } = renderHook(() => useRecoilScopeId(MockedContext), {- wrapper: ({ children }) => (- <MockedContext.Provider value={mockedContextValue}>- {children}- </MockedContext.Provider>- ),- });-- const scopeId = result.current;- expect(scopeId).toBe(mockedContextValue);- });-- it('Should throw an error when used outside of the specified context', () => {- // Suppress console errors for this test since we're expecting an error- /* eslint-disable no-console */- const originalConsoleError = console.error;- console.error = jest.fn();- /* eslint-enable no-console */-- expect(() => {- renderHook(() => useRecoilScopeId(nullContext));- }).toThrow(ERROR_MESSAGE);-- // Restore console.error- /* eslint-disable no-console */- console.error = originalConsoleError;- /* eslint-enable no-console */- });-});diff --git a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/hooks/useContextScopeId.ts b/packages/twenty-front/src/modules/ui/utilities/recoil-scope/hooks/useContextScopeId.tsdeleted file mode 100644index bf92b9de258..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/hooks/useContextScopeId.ts+++ /dev/null@@ -1,16 +0,0 @@-import { Context, useContext } from 'react';--/**- * @deprecated use a custom scope instead and desctructure the scope id from the scope context- * Get the scope context with useScopeInternalContext- */-export const useContextScopeId = (SpecificContext: Context<string | null>) => {- const recoilScopeId = useContext(SpecificContext);-- if (!recoilScopeId)- throw new Error(- `Using useContextScopedId outside of the specified context : ${SpecificContext.displayName}, verify that you are using a RecoilScope with the specific context you want to use.`,- );-- return recoilScopeId;-};diff --git a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/hooks/useRecoilScopeId.ts b/packages/twenty-front/src/modules/ui/utilities/recoil-scope/hooks/useRecoilScopeId.tsdeleted file mode 100644index f14486f1fdd..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/hooks/useRecoilScopeId.ts+++ /dev/null@@ -1,17 +0,0 @@-import { useContext } from 'react';--import { RecoilScopeContext } from '@/types/RecoilScopeContext';--/**- * @deprecated Use a custom scope instead and desctructure the scope id from the scope context- */-export const useRecoilScopeId = (RecoilScopeContext: RecoilScopeContext) => {- const recoilScopeId = useContext(RecoilScopeContext);-- if (!recoilScopeId)- throw new Error(- `Using useRecoilScopeId outside of the specified context : ${RecoilScopeContext.displayName}, verify that you are using a RecoilScope with the specific context you want to use.`,- );-- return recoilScopeId;-};diff --git a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/hooks/useRecoilScopedStateV2.ts b/packages/twenty-front/src/modules/ui/utilities/recoil-scope/hooks/useRecoilScopedStateV2.tsdeleted file mode 100644index cf3b7474505..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/hooks/useRecoilScopedStateV2.ts+++ /dev/null@@ -1,14 +0,0 @@-import { RecoilState, useRecoilState } from 'recoil';--import { RecoilComponentStateKey } from '@/ui/utilities/state/component-state/types/RecoilComponentStateKey';--export const useRecoilScopedStateV2 = <StateType>(- recoilState: (scopedKey: RecoilComponentStateKey) => RecoilState<StateType>,- scopeId: string,-) => {- return useRecoilState<StateType>(- recoilState({- scopeId,- }),- );-};diff --git a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/scopes-internal/hooks/__tests__/useAvailableScopeId.test.tsx b/packages/twenty-front/src/modules/ui/utilities/recoil-scope/scopes-internal/hooks/__tests__/useAvailableScopeId.test.tsxdeleted file mode 100644index 05a638e7172..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/scopes-internal/hooks/__tests__/useAvailableScopeId.test.tsx+++ /dev/null@@ -1,64 +0,0 @@-import { renderHook } from '@testing-library/react';-import React from 'react';--import { useAvailableScopeIdOrThrow } from '@/ui/utilities/recoil-scope/scopes-internal/hooks/useAvailableScopeId';-import { createScopeInternalContext } from '@/ui/utilities/recoil-scope/scopes-internal/utils/createScopeInternalContext';--const mockScopeIdFrom = {- Props: 'scopeIdFromProps',- Context: 'scopeIdFromContext',-};-const MockedContext = createScopeInternalContext();-const errorMessage = 'Scope id is not provided and cannot be found in context.';--const Wrapper = ({ children }: { children: React.ReactNode }) => (- <MockedContext.Provider value={{ scopeId: mockScopeIdFrom.Context }}>- {children}- </MockedContext.Provider>-);--describe('useAvailableScopeIdOrThrow', () => {- it('should return scopeIdFromProps if provided', () => {- const {- result: {- current: { availableScopeId },- },- } = renderHook(- () => ({- availableScopeId: useAvailableScopeIdOrThrow(- MockedContext,- mockScopeIdFrom.Props,- ),- }),- { wrapper: Wrapper },- );-- expect(availableScopeId).toBe(mockScopeIdFrom.Props);- });-- it('should return scopeIdFromContext if no scopeIdFromProps is present', () => {- const {- result: {- current: { availableScopeId },- },- } = renderHook(- () => ({- availableScopeId: useAvailableScopeIdOrThrow(MockedContext),- }),- { wrapper: Wrapper },- );-- expect(availableScopeId).toBe(mockScopeIdFrom.Context);- });-- it('should throw an error if no scopeId is provided and scopeId is undefined in the context', () => {- global.console.error = jest.fn();-- const renderFunction = () =>- renderHook(() => ({- availableScopeId: useAvailableScopeIdOrThrow(MockedContext),- }));-- expect(renderFunction).toThrow(errorMessage);- });-});diff --git a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/scopes-internal/hooks/__tests__/useScopeInternalContext.test.tsx b/packages/twenty-front/src/modules/ui/utilities/recoil-scope/scopes-internal/hooks/__tests__/useScopeInternalContext.test.tsxdeleted file mode 100644index dcd7159d562..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/scopes-internal/hooks/__tests__/useScopeInternalContext.test.tsx+++ /dev/null@@ -1,32 +0,0 @@-import { renderHook } from '@testing-library/react';--import { useScopeInternalContext } from '@/ui/utilities/recoil-scope/scopes-internal/hooks/useScopeInternalContext';-import { createScopeInternalContext } from '@/ui/utilities/recoil-scope/scopes-internal/utils/createScopeInternalContext';--const scopeId = 'scopeId';-const MockedContext = createScopeInternalContext();--const Wrapper = ({ children }: { children: React.ReactNode }) => (- <MockedContext.Provider value={{ scopeId }}>- {children}- </MockedContext.Provider>-);--describe('useScopeInternalContext', () => {- it('should work as expected', () => {- const {- result: {- current: { scopeInternalContext },- },- } = renderHook(- () => ({- scopeInternalContext: useScopeInternalContext(MockedContext),- }),- {- wrapper: Wrapper,- },- );-- expect(scopeInternalContext!.scopeId).toBe(scopeId);- });-});diff --git a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/scopes-internal/hooks/useAvailableScopeId.ts b/packages/twenty-front/src/modules/ui/utilities/recoil-scope/scopes-internal/hooks/useAvailableScopeId.tsdeleted file mode 100644index 02a902c0ec2..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/scopes-internal/hooks/useAvailableScopeId.ts+++ /dev/null@@ -1,26 +0,0 @@-import { isNonEmptyString } from '@sniptt/guards';--import { ScopeInternalContext } from '../types/ScopeInternalContext';--import { useScopeInternalContext } from './useScopeInternalContext';--export const useAvailableScopeIdOrThrow = <T extends { scopeId: string }>(- Context: ScopeInternalContext<T>,- scopeIdFromProps?: string,-): string => {- const scopeInternalContext = useScopeInternalContext(Context);-- const scopeIdFromContext = scopeInternalContext?.scopeId;-- if (isNonEmptyString(scopeIdFromProps)) {- return scopeIdFromProps;- } else if (isNonEmptyString(scopeIdFromContext)) {- return scopeIdFromContext;- } else {- throw new Error(- `Scope id is not provided and cannot be found in context.\n` +- `Context: ${Context.displayName || 'Unknown'}\n` +- `ScopeInternalContext.scopeId: ${scopeInternalContext?.scopeId || 'Unknown'}`,- );- }-};diff --git a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/scopes-internal/hooks/useScopeInternalContext.ts b/packages/twenty-front/src/modules/ui/utilities/recoil-scope/scopes-internal/hooks/useScopeInternalContext.tsdeleted file mode 100644index 7b4c4f1c40a..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/scopes-internal/hooks/useScopeInternalContext.ts+++ /dev/null@@ -1,11 +0,0 @@-import { useContext } from 'react';--import { ScopeInternalContext } from '../types/ScopeInternalContext';--export const useScopeInternalContext = <T extends { scopeId: string }>(- Context: ScopeInternalContext<T>,-) => {- const context = useContext(Context);-- return context;-};diff --git a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/scopes-internal/types/ScopeInternalContext.ts b/packages/twenty-front/src/modules/ui/utilities/recoil-scope/scopes-internal/types/ScopeInternalContext.tsdeleted file mode 100644index bd6ff6ee49c..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/scopes-internal/types/ScopeInternalContext.ts+++ /dev/null@@ -1,4 +0,0 @@-import { Context } from 'react';--export type ScopeInternalContext<T extends { scopeId: string }> =- Context<T | null>;diff --git a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/scopes-internal/utils/createScopeInternalContext.ts b/packages/twenty-front/src/modules/ui/utilities/recoil-scope/scopes-internal/utils/createScopeInternalContext.tsdeleted file mode 100644index 02d447a7fd3..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/scopes-internal/utils/createScopeInternalContext.ts+++ /dev/null@@ -1,13 +0,0 @@-import { RecoilComponentStateKey } from '@/ui/utilities/state/component-state/types/RecoilComponentStateKey';-import { Context, createContext } from 'react';--type ScopeInternalContext<T extends RecoilComponentStateKey> =- Context<T | null>;--export const createScopeInternalContext = <T extends RecoilComponentStateKey>(- initialValue?: T,-) => {- return createContext<T | null>(- initialValue ?? null,- ) as ScopeInternalContext<T>;-};diff --git a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/states/RecoilScopeContext.ts b/packages/twenty-front/src/modules/ui/utilities/recoil-scope/states/RecoilScopeContext.tsdeleted file mode 100644index b88dc68a24e..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/states/RecoilScopeContext.ts+++ /dev/null@@ -1,3 +0,0 @@-import { createContext } from 'react';--export const RecoilScopeContext = createContext<string | null>(null);diff --git a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/types/RecoilScopedSelector.ts b/packages/twenty-front/src/modules/ui/utilities/recoil-scope/types/RecoilScopedSelector.tsdeleted file mode 100644index 5f680bbda05..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/types/RecoilScopedSelector.ts+++ /dev/null@@ -1,7 +0,0 @@-import { RecoilValueReadOnly } from 'recoil';--import { RecoilComponentStateKey } from '@/ui/utilities/state/component-state/types/RecoilComponentStateKey';--export type RecoilScopedSelector<StateType> = (- scopedKey: RecoilComponentStateKey,-) => RecoilValueReadOnly<StateType>;diff --git a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/types/RecoilScopedState.ts b/packages/twenty-front/src/modules/ui/utilities/recoil-scope/types/RecoilScopedState.tsdeleted file mode 100644index 44ed24a2389..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/types/RecoilScopedState.ts+++ /dev/null@@ -1,7 +0,0 @@-import { RecoilState } from 'recoil';--import { RecoilComponentStateKey } from '@/ui/utilities/state/component-state/types/RecoilComponentStateKey';--export type RecoilScopedState<StateType> = (- scopedKey: RecoilComponentStateKey,-) => RecoilState<StateType>;diff --git a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/utils/getScopedStateDeprecated.ts b/packages/twenty-front/src/modules/ui/utilities/recoil-scope/utils/getScopedStateDeprecated.tsdeleted file mode 100644index db7a3cbd209..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/utils/getScopedStateDeprecated.ts+++ /dev/null@@ -1,10 +0,0 @@-import { RecoilScopedState } from '../types/RecoilScopedState';--export const getScopedStateDeprecated = <StateType>(- recoilScopedState: RecoilScopedState<StateType>,- scopeId: string,-) => {- return recoilScopedState({- scopeId,- });-};diff --git a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/utils/getSnapshotValue.ts b/packages/twenty-front/src/modules/ui/utilities/recoil-scope/utils/getSnapshotValue.tsdeleted file mode 100644index 711d21a4ae5..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/utils/getSnapshotValue.ts+++ /dev/null@@ -1,8 +0,0 @@-import { RecoilState, RecoilValueReadOnly, Snapshot } from 'recoil';--export const getSnapshotValue = <StateType>(- snapshot: Snapshot,- state: RecoilState<StateType> | RecoilValueReadOnly<StateType>,-) => {- return snapshot.getLoadable(state).getValue();-};diff --git a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/utils/guardRecoilDefaultValue.ts b/packages/twenty-front/src/modules/ui/utilities/recoil-scope/utils/guardRecoilDefaultValue.tsdeleted file mode 100644index 84349601126..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/recoil-scope/utils/guardRecoilDefaultValue.ts+++ /dev/null@@ -1,8 +0,0 @@-import { DefaultValue } from 'recoil';--export const guardRecoilDefaultValue = (- candidate: any,-): candidate is DefaultValue => {- if (candidate instanceof DefaultValue) return true;- return false;-};diff --git a/packages/twenty-front/src/modules/ui/utilities/state/component-state/hooks/useExtractedComponentFamilyStateV2.ts b/packages/twenty-front/src/modules/ui/utilities/state/component-state/hooks/useExtractedComponentFamilyStateV2.tsdeleted file mode 100644index f5f05e49e57..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/state/component-state/hooks/useExtractedComponentFamilyStateV2.ts+++ /dev/null@@ -1,34 +0,0 @@-import { useAvailableScopeIdOrThrow } from '@/ui/utilities/recoil-scope/scopes-internal/hooks/useAvailableScopeId';-import { ComponentFamilyState } from '@/ui/utilities/state/component-state/types/ComponentFamilyState';-import { SerializableParam } from 'recoil';--export const useExtractedComponentFamilyStateV2 = <- FamilyKey extends SerializableParam,- Value,->(- componentFamilyState: ComponentFamilyState<Value, FamilyKey>,- componentId?: string,-) => {- const componentContext = (window as any).componentContextStateMap?.get(- componentFamilyState.key,- );-- if (!componentContext) {- throw new Error(- `Component context for key "${componentFamilyState.key}" is not defined`,- );- }-- const internalScopeId = useAvailableScopeIdOrThrow(- componentContext,- componentId,- );-- const extractedComponentFamilyState = (familyKey: FamilyKey) =>- componentFamilyState.atomFamily({- scopeId: internalScopeId,- familyKey,- });-- return extractedComponentFamilyState;-};diff --git a/packages/twenty-front/src/modules/ui/utilities/state/component-state/hooks/useRecoilComponentFamilyValue.ts b/packages/twenty-front/src/modules/ui/utilities/state/component-state/hooks/useRecoilComponentFamilyValue.tsdeleted file mode 100644index 12654b0a5e1..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/state/component-state/hooks/useRecoilComponentFamilyValue.ts+++ /dev/null@@ -1,35 +0,0 @@-import { SerializableParam, useRecoilValue } from 'recoil';--import { useAvailableScopeIdOrThrow } from '@/ui/utilities/recoil-scope/scopes-internal/hooks/useAvailableScopeId';-import { ComponentFamilyState } from '@/ui/utilities/state/component-state/types/ComponentFamilyState';--export const useRecoilComponentFamilyValue = <- StateType,- FamilyKey extends SerializableParam,->(- componentFamilyState: ComponentFamilyState<StateType, FamilyKey>,- familyKey: FamilyKey,- componentId?: string,-) => {- const componentContext = (window as any).componentContextStateMap?.get(- componentFamilyState.key,- );-- if (!componentContext) {- throw new Error(- `Component context for key "${componentFamilyState.key}" is not defined`,- );- }-- const internalComponentId = useAvailableScopeIdOrThrow(- componentContext,- componentId,- );-- return useRecoilValue(- componentFamilyState.atomFamily({- scopeId: internalComponentId,- familyKey,- }),- );-};diff --git a/packages/twenty-front/src/modules/ui/utilities/state/component-state/hooks/useRecoilComponentState.ts b/packages/twenty-front/src/modules/ui/utilities/state/component-state/hooks/useRecoilComponentState.tsdeleted file mode 100644index 5c02f4df3d7..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/state/component-state/hooks/useRecoilComponentState.ts+++ /dev/null@@ -1,27 +0,0 @@-import { useAvailableScopeIdOrThrow } from '@/ui/utilities/recoil-scope/scopes-internal/hooks/useAvailableScopeId';-import { RecoilComponentState } from '@/ui/utilities/state/component-state/types/RecoilComponentState';-import { useRecoilState } from 'recoil';--export const useRecoilComponentState = <StateType>(- componentState: RecoilComponentState<StateType>,- componentId?: string,-) => {- const componentContext = (window as any).componentContextStateMap?.get(- componentState.key,- );-- if (!componentContext) {- throw new Error(- `Component context for key "${componentState.key}" is not defined`,- );- }-- const internalComponentId = useAvailableScopeIdOrThrow(- componentContext,- componentId,- );-- return useRecoilState(- componentState.atomFamily({ scopeId: internalComponentId }),- );-};diff --git a/packages/twenty-front/src/modules/ui/utilities/state/component-state/hooks/useRecoilComponentValue.ts b/packages/twenty-front/src/modules/ui/utilities/state/component-state/hooks/useRecoilComponentValue.tsdeleted file mode 100644index ed76e246dc4..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/state/component-state/hooks/useRecoilComponentValue.ts+++ /dev/null@@ -1,28 +0,0 @@-import { useRecoilValue } from 'recoil';--import { useAvailableScopeIdOrThrow } from '@/ui/utilities/recoil-scope/scopes-internal/hooks/useAvailableScopeId';-import { RecoilComponentState } from '@/ui/utilities/state/component-state/types/RecoilComponentState';--export const useRecoilComponentValue = <StateType>(- componentState: RecoilComponentState<StateType>,- componentId?: string,-) => {- const componentContext = (window as any).componentContextStateMap?.get(- componentState.key,- );-- if (!componentContext) {- throw new Error(- `Component context for key "${componentState.key}" is not defined`,- );- }-- const internalComponentId = useAvailableScopeIdOrThrow(- componentContext,- componentId,- );-- return useRecoilValue(- componentState.atomFamily({ scopeId: internalComponentId }),- );-};diff --git a/packages/twenty-front/src/modules/ui/utilities/state/component-state/hooks/useScopeIdFromStateContext.ts b/packages/twenty-front/src/modules/ui/utilities/state/component-state/hooks/useScopeIdFromStateContext.tsdeleted file mode 100644index fa30c4cd537..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/state/component-state/hooks/useScopeIdFromStateContext.ts+++ /dev/null@@ -1,23 +0,0 @@-import { useScopeInternalContext } from '@/ui/utilities/recoil-scope/scopes-internal/hooks/useScopeInternalContext';-import { ComponentFamilyState } from '@/ui/utilities/state/component-state/types/ComponentFamilyState';-import { RecoilComponentState } from '@/ui/utilities/state/component-state/types/RecoilComponentState';--export const useScopeIdFromStateContext = (- componentState: RecoilComponentState<any> | ComponentFamilyState<any, any>,-) => {- const componentContext = (window as any).componentContextStateMap?.get(- componentState.key,- );-- if (!componentContext) {- throw new Error(- `Component context for key "${componentState.key}" is not defined`,- );- }-- const scopeInternalContext = useScopeInternalContext(componentContext);-- const scopeIdFromContext = scopeInternalContext?.scopeId;-- return { scopeId: scopeIdFromContext };-};diff --git a/packages/twenty-front/src/modules/ui/utilities/state/component-state/hooks/useSetRecoilComponentState.ts b/packages/twenty-front/src/modules/ui/utilities/state/component-state/hooks/useSetRecoilComponentState.tsdeleted file mode 100644index c663801378d..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/state/component-state/hooks/useSetRecoilComponentState.ts+++ /dev/null@@ -1,28 +0,0 @@-import { useSetRecoilState } from 'recoil';--import { useAvailableScopeIdOrThrow } from '@/ui/utilities/recoil-scope/scopes-internal/hooks/useAvailableScopeId';-import { RecoilComponentState } from '@/ui/utilities/state/component-state/types/RecoilComponentState';--export const useSetRecoilComponentState = <StateType>(- componentState: RecoilComponentState<StateType>,- componentId?: string,-) => {- const componentContext = (window as any).componentContextStateMap?.get(- componentState.key,- );-- if (!componentContext) {- throw new Error(- `Component context for key "${componentState.key}" is not defined`,- );- }-- const internalComponentId = useAvailableScopeIdOrThrow(- componentContext,- componentId,- );-- return useSetRecoilState(- componentState.atomFamily({ scopeId: internalComponentId }),- );-};diff --git a/packages/twenty-front/src/modules/ui/utilities/state/component-state/types/ComponentFamilyState.ts b/packages/twenty-front/src/modules/ui/utilities/state/component-state/types/ComponentFamilyState.tsdeleted file mode 100644index 1a4be078646..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/state/component-state/types/ComponentFamilyState.ts+++ /dev/null@@ -1,13 +0,0 @@-import { RecoilState, SerializableParam } from 'recoil';--import { ComponentFamilyStateKey } from '@/ui/utilities/state/component-state/types/ComponentFamilyStateKey';--export type ComponentFamilyState<- StateType,- FamilyKey extends SerializableParam,-> = {- key: string;- atomFamily: (- componentStateKey: ComponentFamilyStateKey<FamilyKey>,- ) => RecoilState<StateType>;-};diff --git a/packages/twenty-front/src/modules/ui/utilities/state/component-state/types/ComponentFamilyStateKey.ts b/packages/twenty-front/src/modules/ui/utilities/state/component-state/types/ComponentFamilyStateKey.tsdeleted file mode 100644index e5b9fa304a5..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/state/component-state/types/ComponentFamilyStateKey.ts+++ /dev/null@@ -1,6 +0,0 @@-import { SerializableParam } from 'recoil';--export type ComponentFamilyStateKey<FamilyKey extends SerializableParam> = {- scopeId: string;- familyKey: FamilyKey;-};diff --git a/packages/twenty-front/src/modules/ui/utilities/state/component-state/types/RecoilComponentState.ts b/packages/twenty-front/src/modules/ui/utilities/state/component-state/types/RecoilComponentState.tsdeleted file mode 100644index 8c007e5bdda..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/state/component-state/types/RecoilComponentState.ts+++ /dev/null@@ -1,9 +0,0 @@-import { RecoilState } from 'recoil';-import { RecoilComponentStateKey } from './RecoilComponentStateKey';--export type RecoilComponentState<StateType> = {- key: string;- atomFamily: (- componentStateKey: RecoilComponentStateKey,- ) => RecoilState<StateType>;-};diff --git a/packages/twenty-front/src/modules/ui/utilities/state/component-state/types/RecoilComponentStateKey.ts b/packages/twenty-front/src/modules/ui/utilities/state/component-state/types/RecoilComponentStateKey.tsdeleted file mode 100644index 6627f39f92a..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/state/component-state/types/RecoilComponentStateKey.ts+++ /dev/null@@ -1,3 +0,0 @@-export type RecoilComponentStateKey = {- scopeId: string;-};diff --git a/packages/twenty-front/src/modules/ui/utilities/state/component-state/utils/createComponentFamilySelector.ts b/packages/twenty-front/src/modules/ui/utilities/state/component-state/utils/createComponentFamilySelector.tsdeleted file mode 100644index af2c6c42716..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/state/component-state/utils/createComponentFamilySelector.ts+++ /dev/null@@ -1,24 +0,0 @@-import { selectorFamily, SerializableParam } from 'recoil';--import { ComponentFamilyStateKey } from '@/ui/utilities/state/component-state/types/ComponentFamilyStateKey';-import { SelectorGetter } from '@/ui/utilities/state/types/SelectorGetter';-import { SelectorSetter } from '@/ui/utilities/state/types/SelectorSetter';--export const createComponentFamilySelector = <- ValueType,- FamilyKey extends SerializableParam,->({- key,- get,- set,-}: {- key: string;- get: SelectorGetter<ValueType, ComponentFamilyStateKey<FamilyKey>>;- set: SelectorSetter<ValueType, ComponentFamilyStateKey<FamilyKey>>;-}) => {- return selectorFamily<ValueType, ComponentFamilyStateKey<FamilyKey>>({- key,- get,- set,- });-};diff --git a/packages/twenty-front/src/modules/ui/utilities/state/component-state/utils/createComponentFamilyState.ts b/packages/twenty-front/src/modules/ui/utilities/state/component-state/utils/createComponentFamilyState.tsdeleted file mode 100644index fea9894e1bb..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/state/component-state/utils/createComponentFamilyState.ts+++ /dev/null@@ -1,19 +0,0 @@-import { atomFamily, SerializableParam } from 'recoil';--import { ComponentFamilyStateKey } from '@/ui/utilities/state/component-state/types/ComponentFamilyStateKey';--export const createComponentFamilyState = <- ValueType,- FamilyKey extends SerializableParam,->({- key,- defaultValue,-}: {- key: string;- defaultValue: ValueType;-}) => {- return atomFamily<ValueType, ComponentFamilyStateKey<FamilyKey>>({- key,- default: defaultValue,- });-};diff --git a/packages/twenty-front/src/modules/ui/utilities/state/component-state/utils/createComponentReadOnlySelector.ts b/packages/twenty-front/src/modules/ui/utilities/state/component-state/utils/createComponentReadOnlySelector.tsdeleted file mode 100644index 5fa33782397..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/state/component-state/utils/createComponentReadOnlySelector.ts+++ /dev/null@@ -1,17 +0,0 @@-import { selectorFamily } from 'recoil';--import { RecoilComponentStateKey } from '@/ui/utilities/state/component-state/types/RecoilComponentStateKey';-import { SelectorGetter } from '@/ui/utilities/state/types/SelectorGetter';--export const createComponentReadOnlySelector = <ValueType>({- key,- get,-}: {- key: string;- get: SelectorGetter<ValueType, RecoilComponentStateKey>;-}) => {- return selectorFamily<ValueType, RecoilComponentStateKey>({- key,- get,- });-};diff --git a/packages/twenty-front/src/modules/ui/utilities/state/component-state/utils/createComponentSelector.ts b/packages/twenty-front/src/modules/ui/utilities/state/component-state/utils/createComponentSelector.tsdeleted file mode 100644index 545845ccda7..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/state/component-state/utils/createComponentSelector.ts+++ /dev/null@@ -1,21 +0,0 @@-import { selectorFamily } from 'recoil';--import { RecoilComponentStateKey } from '@/ui/utilities/state/component-state/types/RecoilComponentStateKey';-import { SelectorGetter } from '@/ui/utilities/state/types/SelectorGetter';-import { SelectorSetter } from '@/ui/utilities/state/types/SelectorSetter';--export const createComponentSelector = <ValueType>({- key,- get,- set,-}: {- key: string;- get: SelectorGetter<ValueType, RecoilComponentStateKey>;- set: SelectorSetter<ValueType, RecoilComponentStateKey>;-}) => {- return selectorFamily<ValueType, RecoilComponentStateKey>({- key,- get,- set,- });-};diff --git a/packages/twenty-front/src/modules/ui/utilities/state/component-state/utils/createComponentState.ts b/packages/twenty-front/src/modules/ui/utilities/state/component-state/utils/createComponentState.tsdeleted file mode 100644index 5f2cd0badc3..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/state/component-state/utils/createComponentState.ts+++ /dev/null@@ -1,21 +0,0 @@-import { AtomEffect, atomFamily } from 'recoil';--import { RecoilComponentStateKey } from '@/ui/utilities/state/component-state/types/RecoilComponentStateKey';--type CreateComponentStateType<ValueType> = {- key: string;- defaultValue: ValueType;- effects?: AtomEffect<ValueType>[];-};--export const createComponentState = <ValueType>({- key,- defaultValue,- effects,-}: CreateComponentStateType<ValueType>) => {- return atomFamily<ValueType, RecoilComponentStateKey>({- key,- default: defaultValue,- effects: effects,- });-};diff --git a/packages/twenty-front/src/modules/ui/utilities/state/component-state/utils/createComponentStateV2Alpha.ts b/packages/twenty-front/src/modules/ui/utilities/state/component-state/utils/createComponentStateV2Alpha.tsdeleted file mode 100644index 51c636c192f..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/state/component-state/utils/createComponentStateV2Alpha.ts+++ /dev/null@@ -1,38 +0,0 @@-import { AtomEffect, atomFamily } from 'recoil';--import { ScopeInternalContext } from '@/ui/utilities/recoil-scope/scopes-internal/types/ScopeInternalContext';--import { RecoilComponentState } from '@/ui/utilities/state/component-state/types/RecoilComponentState';-import { RecoilComponentStateKey } from '@/ui/utilities/state/component-state/types/RecoilComponentStateKey';-import { isDefined } from 'twenty-shared/utils';--type CreateComponentStateV2Type<ValueType> = {- key: string;- defaultValue: ValueType;- componentContext?: ScopeInternalContext<any> | null;- effects?: AtomEffect<ValueType>[];-};--export const createComponentStateV2_alpha = <ValueType>({- key,- defaultValue,- componentContext,- effects,-}: CreateComponentStateV2Type<ValueType>): RecoilComponentState<ValueType> => {- if (isDefined(componentContext)) {- if (!isDefined((window as any).componentContextStateMap)) {- (window as any).componentContextStateMap = new Map();- }-- (window as any).componentContextStateMap.set(key, componentContext);- }-- return {- key,- atomFamily: atomFamily<ValueType, RecoilComponentStateKey>({- key,- default: defaultValue,- effects: effects,- }),- };-};diff --git a/packages/twenty-front/src/modules/ui/utilities/state/component-state/utils/createEventContext.ts b/packages/twenty-front/src/modules/ui/utilities/state/component-state/utils/createEventContext.tsdeleted file mode 100644index 723e1c3f3ef..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/state/component-state/utils/createEventContext.ts+++ /dev/null@@ -1,9 +0,0 @@-import { createContext } from 'react';--export const createEventContext = <- Events extends Record<string, (...args: any) => void>,->(- initialValue?: Events,-) => {- return createContext<Events>((initialValue ?? {}) as Events);-};diff --git a/packages/twenty-front/src/modules/ui/utilities/state/component-state/utils/extractComponentFamilyState.ts b/packages/twenty-front/src/modules/ui/utilities/state/component-state/utils/extractComponentFamilyState.tsdeleted file mode 100644index 85ada7fd6ca..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/state/component-state/utils/extractComponentFamilyState.ts+++ /dev/null@@ -1,19 +0,0 @@-import { RecoilState, SerializableParam } from 'recoil';--import { ComponentFamilyStateKey } from '@/ui/utilities/state/component-state/types/ComponentFamilyStateKey';--export const extractComponentFamilyState = <- StateType,- FamilyKey extends SerializableParam,->(- componentfamilyState: (- componentFamilyStateKey: ComponentFamilyStateKey<FamilyKey>,- ) => RecoilState<StateType>,- scopeId: string,-) => {- return (familyKey: FamilyKey) =>- componentfamilyState({- scopeId,- familyKey: familyKey || ('' as FamilyKey),- });-};diff --git a/packages/twenty-front/src/modules/ui/utilities/state/component-state/utils/extractComponentReadOnlySelector.ts b/packages/twenty-front/src/modules/ui/utilities/state/component-state/utils/extractComponentReadOnlySelector.tsdeleted file mode 100644index da5b494b6e5..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/state/component-state/utils/extractComponentReadOnlySelector.ts+++ /dev/null@@ -1,12 +0,0 @@-import { RecoilValueReadOnly } from 'recoil';--import { RecoilComponentStateKey } from '@/ui/utilities/state/component-state/types/RecoilComponentStateKey';--export const extractComponentReadOnlySelector = <StateType>(- componentSelector: (- componentStateKey: RecoilComponentStateKey,- ) => RecoilValueReadOnly<StateType>,- scopeId: string,-) => {- return () => componentSelector({ scopeId });-};diff --git a/packages/twenty-front/src/modules/ui/utilities/state/component-state/utils/extractComponentSelector.ts b/packages/twenty-front/src/modules/ui/utilities/state/component-state/utils/extractComponentSelector.tsdeleted file mode 100644index 40befcf6feb..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/state/component-state/utils/extractComponentSelector.ts+++ /dev/null@@ -1,12 +0,0 @@-import { RecoilState } from 'recoil';--import { RecoilComponentStateKey } from '@/ui/utilities/state/component-state/types/RecoilComponentStateKey';--export const extractComponentSelector = <StateType>(- componentSelector: (- componentStateKey: RecoilComponentStateKey,- ) => RecoilState<StateType>,- scopeId: string,-) => {- return () => componentSelector({ scopeId });-};diff --git a/packages/twenty-front/src/modules/ui/utilities/state/component-state/utils/extractComponentState.ts b/packages/twenty-front/src/modules/ui/utilities/state/component-state/utils/extractComponentState.tsdeleted file mode 100644index cac495c0c2d..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/state/component-state/utils/extractComponentState.ts+++ /dev/null@@ -1,12 +0,0 @@-import { RecoilState } from 'recoil';--import { RecoilComponentStateKey } from '@/ui/utilities/state/component-state/types/RecoilComponentStateKey';--export const extractComponentState = <StateType>(- componentState: (- componentStateKey: RecoilComponentStateKey,- ) => RecoilState<StateType>,- scopeId: string,-) => {- return componentState({ scopeId });-};diff --git a/packages/twenty-front/src/modules/ui/utilities/state/utils/guardRecoilDefaultValue.ts b/packages/twenty-front/src/modules/ui/utilities/state/utils/guardRecoilDefaultValue.tsdeleted file mode 100644index 84349601126..00000000000--- a/packages/twenty-front/src/modules/ui/utilities/state/utils/guardRecoilDefaultValue.ts+++ /dev/null@@ -1,8 +0,0 @@-import { DefaultValue } from 'recoil';--export const guardRecoilDefaultValue = (- candidate: any,-): candidate is DefaultValue => {- if (candidate instanceof DefaultValue) return true;- return false;-};diff --git a/packages/twenty-front/src/modules/views/components/ViewBarDetails.tsx b/packages/twenty-front/src/modules/views/components/ViewBarDetails.tsxindex 97475f9f4db..d3e70d602d8 100644--- a/packages/twenty-front/src/modules/views/components/ViewBarDetails.tsx+++ b/packages/twenty-front/src/modules/views/components/ViewBarDetails.tsx@@ -4,7 +4,6 @@ import { ReactNode, useMemo } from 'react';import { useObjectNameSingularFromPlural } from '@/object-metadata/hooks/useObjectNameSingularFromPlural';import { ObjectFilterDropdownComponentInstanceContext } from '@/object-record/object-filter-dropdown/states/contexts/ObjectFilterDropdownComponentInstanceContext';import { useHandleToggleTrashColumnFilter } from '@/object-record/record-index/hooks/useHandleToggleTrashColumnFilter';-import { DropdownScope } from '@/ui/layout/dropdown/scopes/DropdownScope';import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';import { AdvancedFilterDropdownButton } from '@/views/components/AdvancedFilterDropdownButton';import { EditableFilterDropdownButton } from '@/views/components/EditableFilterDropdownButton';@@ -256,9 +255,7 @@ export const ViewBarDetails = ({key={recordFilter.id}value={{ instanceId: recordFilter.id }}>- <DropdownScope dropdownScopeId={recordFilter.id}>- <EditableFilterDropdownButton recordFilter={recordFilter} />- </DropdownScope>+ <EditableFilterDropdownButton recordFilter={recordFilter} /></ObjectFilterDropdownComponentInstanceContext.Provider>))}</StyledChipContainer>diff --git a/packages/twenty-front/src/modules/views/hooks/useCreateViewFromCurrentView.ts b/packages/twenty-front/src/modules/views/hooks/useCreateViewFromCurrentView.tsindex e5b851914ce..499df805bc4 100644--- a/packages/twenty-front/src/modules/views/hooks/useCreateViewFromCurrentView.ts+++ b/packages/twenty-front/src/modules/views/hooks/useCreateViewFromCurrentView.ts@@ -8,9 +8,9 @@ import { currentRecordFiltersComponentState } from '@/object-record/record-filteimport { useRecordIndexContextOrThrow } from '@/object-record/record-index/contexts/RecordIndexContext';import { currentRecordSortsComponentState } from '@/object-record/record-sort/states/currentRecordSortsComponentState';import { prefetchViewFromViewIdFamilySelector } from '@/prefetch/states/selector/prefetchViewFromViewIdFamilySelector';-import { getSnapshotValue } from '@/ui/utilities/recoil-scope/utils/getSnapshotValue';import { useRecoilComponentCallbackStateV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentCallbackStateV2';import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';+import { getSnapshotValue } from '@/ui/utilities/state/utils/getSnapshotValue';import { usePersistViewFieldRecords } from '@/views/hooks/internal/usePersistViewFieldRecords';import { usePersistViewFilterGroupRecords } from '@/views/hooks/internal/usePersistViewFilterGroupRecords';import { usePersistViewFilterRecords } from '@/views/hooks/internal/usePersistViewFilterRecords';diff --git a/packages/twenty-front/src/modules/views/view-picker/components/ViewPickerFavoriteFoldersDropdown.tsx b/packages/twenty-front/src/modules/views/view-picker/components/ViewPickerFavoriteFoldersDropdown.tsxindex 587b3008b0b..b1590de2b5b 100644--- a/packages/twenty-front/src/modules/views/view-picker/components/ViewPickerFavoriteFoldersDropdown.tsx+++ b/packages/twenty-front/src/modules/views/view-picker/components/ViewPickerFavoriteFoldersDropdown.tsx@@ -1,8 +1,7 @@import { FavoriteFolderPicker } from '@/favorites/favorite-folder-picker/components/FavoriteFolderPicker';import { FavoriteFolderPickerEffect } from '@/favorites/favorite-folder-picker/components/FavoriteFolderPickerEffect';-import { FavoriteFolderPickerComponentInstanceContext } from '@/favorites/favorite-folder-picker/scopes/FavoriteFolderPickerScope';+import { FavoriteFolderPickerInstanceContext } from '@/favorites/favorite-folder-picker/states/context/FavoriteFolderPickerInstanceContext';import { prefetchViewFromViewIdFamilySelector } from '@/prefetch/states/selector/prefetchViewFromViewIdFamilySelector';-import { DropdownScope } from '@/ui/layout/dropdown/scopes/DropdownScope';import { useRecoilComponentStateV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentStateV2';import { VIEW_PICKER_DROPDOWN_ID } from '@/views/view-picker/constants/ViewPickerDropdownId';import { viewPickerReferenceViewIdComponentState } from '@/views/view-picker/states/viewPickerReferenceViewIdComponentState';@@ -20,19 +19,15 @@ export const ViewPickerFavoriteFoldersDropdown = () => {);return (- <FavoriteFolderPickerComponentInstanceContext- favoriteFoldersScopeId={VIEW_PICKER_DROPDOWN_ID}+ <FavoriteFolderPickerInstanceContext.Provider+ value={{ instanceId: VIEW_PICKER_DROPDOWN_ID }}>- <DropdownScope dropdownScopeId={VIEW_PICKER_DROPDOWN_ID}>- <>- <FavoriteFolderPickerEffect record={view} />- <FavoriteFolderPicker- record={view}- objectNameSingular="view"- dropdownId={VIEW_PICKER_DROPDOWN_ID}- />- </>- </DropdownScope>- </FavoriteFolderPickerComponentInstanceContext>+ <FavoriteFolderPickerEffect record={view} />+ <FavoriteFolderPicker+ record={view}+ objectNameSingular="view"+ dropdownId={VIEW_PICKER_DROPDOWN_ID}+ />+ </FavoriteFolderPickerInstanceContext.Provider>);};diff --git a/packages/twenty-front/src/modules/views/view-picker/hooks/useCreateViewFromCurrentState.ts b/packages/twenty-front/src/modules/views/view-picker/hooks/useCreateViewFromCurrentState.tsindex edd8421e54b..e63ce88a6df 100644--- a/packages/twenty-front/src/modules/views/view-picker/hooks/useCreateViewFromCurrentState.ts+++ b/packages/twenty-front/src/modules/views/view-picker/hooks/useCreateViewFromCurrentState.ts@@ -1,5 +1,5 @@-import { getSnapshotValue } from '@/ui/utilities/recoil-scope/utils/getSnapshotValue';import { useRecoilComponentCallbackStateV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentCallbackStateV2';+import { getSnapshotValue } from '@/ui/utilities/state/utils/getSnapshotValue';import { useChangeView } from '@/views/hooks/useChangeView';import { useCreateViewFromCurrentView } from '@/views/hooks/useCreateViewFromCurrentView';import { useCloseAndResetViewPicker } from '@/views/view-picker/hooks/useCloseAndResetViewPicker';diff --git a/packages/twenty-front/src/modules/views/view-picker/hooks/useDeleteViewFromCurrentState.ts b/packages/twenty-front/src/modules/views/view-picker/hooks/useDeleteViewFromCurrentState.tsindex f6fad860d4e..c8d0d80e6b1 100644--- a/packages/twenty-front/src/modules/views/view-picker/hooks/useDeleteViewFromCurrentState.ts+++ b/packages/twenty-front/src/modules/views/view-picker/hooks/useDeleteViewFromCurrentState.ts@@ -2,8 +2,8 @@ import { useRecoilCallback, useRecoilValue } from 'recoil';import { useContextStoreObjectMetadataItemOrThrow } from '@/context-store/hooks/useContextStoreObjectMetadataItemOrThrow';import { prefetchViewsFromObjectMetadataItemFamilySelector } from '@/prefetch/states/selector/prefetchViewsFromObjectMetadataItemFamilySelector';-import { getSnapshotValue } from '@/ui/utilities/recoil-scope/utils/getSnapshotValue';import { useRecoilComponentCallbackStateV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentCallbackStateV2';+import { getSnapshotValue } from '@/ui/utilities/state/utils/getSnapshotValue';import { useChangeView } from '@/views/hooks/useChangeView';import { useDeleteView } from '@/views/hooks/useDeleteView';import { useGetCurrentViewOnly } from '@/views/hooks/useGetCurrentViewOnly';diff --git a/packages/twenty-front/src/modules/views/view-picker/hooks/useUpdateViewFromCurrentState.ts b/packages/twenty-front/src/modules/views/view-picker/hooks/useUpdateViewFromCurrentState.tsindex 9af68933cc9..8ecdbcec4bc 100644--- a/packages/twenty-front/src/modules/views/view-picker/hooks/useUpdateViewFromCurrentState.ts+++ b/packages/twenty-front/src/modules/views/view-picker/hooks/useUpdateViewFromCurrentState.ts@@ -1,5 +1,5 @@-import { getSnapshotValue } from '@/ui/utilities/recoil-scope/utils/getSnapshotValue';import { useRecoilComponentCallbackStateV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentCallbackStateV2';+import { getSnapshotValue } from '@/ui/utilities/state/utils/getSnapshotValue';import { useChangeView } from '@/views/hooks/useChangeView';import { useUpdateView } from '@/views/hooks/useUpdateView';import { useCloseAndResetViewPicker } from '@/views/view-picker/hooks/useCloseAndResetViewPicker';diff --git a/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramCanvasBase.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramCanvasBase.tsxindex fc42b7912e4..d2d22cac731 100644--- a/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramCanvasBase.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramCanvasBase.tsx@@ -1,10 +1,10 @@import { ActionMenuContext } from '@/action-menu/contexts/ActionMenuContext';import { CommandMenuAnimationVariant } from '@/command-menu/types/CommandMenuAnimationVariant';import { useListenToSidePanelClosing } from '@/ui/layout/right-drawer/hooks/useListenToSidePanelClosing';-import { getSnapshotValue } from '@/ui/utilities/recoil-scope/utils/getSnapshotValue';import { useRecoilComponentCallbackStateV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentCallbackStateV2';import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';import { useSetRecoilComponentStateV2 } from '@/ui/utilities/state/component-state/hooks/useSetRecoilComponentStateV2';+import { getSnapshotValue } from '@/ui/utilities/state/utils/getSnapshotValue';import { WorkflowDiagramCustomMarkers } from '@/workflow/workflow-diagram/components/WorkflowDiagramCustomMarkers';import { useRightDrawerState } from '@/workflow/workflow-diagram/hooks/useRightDrawerState';import { workflowDiagramComponentState } from '@/workflow/workflow-diagram/states/workflowDiagramComponentState';diff --git a/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowRunVisualizerEffect.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowRunVisualizerEffect.tsxindex 91516e265e6..64d200f2f9c 100644--- a/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowRunVisualizerEffect.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowRunVisualizerEffect.tsx@@ -1,8 +1,8 @@import { ActionMenuContext } from '@/action-menu/contexts/ActionMenuContext';import { useWorkflowCommandMenu } from '@/command-menu/hooks/useWorkflowCommandMenu';-import { getSnapshotValue } from '@/ui/utilities/recoil-scope/utils/getSnapshotValue';import { useRecoilComponentCallbackStateV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentCallbackStateV2';import { useSetRecoilComponentStateV2 } from '@/ui/utilities/state/component-state/hooks/useSetRecoilComponentStateV2';+import { getSnapshotValue } from '@/ui/utilities/state/utils/getSnapshotValue';import { useStepsOutputSchema } from '@/workflow/hooks/useStepsOutputSchema';import { useWorkflowRun } from '@/workflow/hooks/useWorkflowRun';import { useWorkflowVersion } from '@/workflow/hooks/useWorkflowVersion';diff --git a/packages/twenty-front/src/modules/workflow/workflow-diagram/hooks/useHandleWorkflowRunDiagramCanvasInit.ts b/packages/twenty-front/src/modules/workflow/workflow-diagram/hooks/useHandleWorkflowRunDiagramCanvasInit.tsindex a2a07e58d9f..9953163e10f 100644--- a/packages/twenty-front/src/modules/workflow/workflow-diagram/hooks/useHandleWorkflowRunDiagramCanvasInit.ts+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/hooks/useHandleWorkflowRunDiagramCanvasInit.ts@@ -1,7 +1,7 @@import { ActionMenuContext } from '@/action-menu/contexts/ActionMenuContext';import { useWorkflowCommandMenu } from '@/command-menu/hooks/useWorkflowCommandMenu';-import { getSnapshotValue } from '@/ui/utilities/recoil-scope/utils/getSnapshotValue';import { useRecoilComponentCallbackStateV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentCallbackStateV2';+import { getSnapshotValue } from '@/ui/utilities/state/utils/getSnapshotValue';import { useWorkflowRunIdOrThrow } from '@/workflow/hooks/useWorkflowRunIdOrThrow';import { workflowVisualizerWorkflowIdComponentState } from '@/workflow/states/workflowVisualizerWorkflowIdComponentState';import { workflowDiagramStatusComponentState } from '@/workflow/workflow-diagram/states/workflowDiagramStatusComponentState';diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/filter-action/hooks/useRemoveStepFilter.ts b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/filter-action/hooks/useRemoveStepFilter.tsindex bf8ed323817..416e559af73 100644--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/filter-action/hooks/useRemoveStepFilter.ts+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/filter-action/hooks/useRemoveStepFilter.ts@@ -1,5 +1,5 @@-import { getSnapshotValue } from '@/ui/utilities/recoil-scope/utils/getSnapshotValue';import { useRecoilComponentCallbackStateV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentCallbackStateV2';+import { getSnapshotValue } from '@/ui/utilities/state/utils/getSnapshotValue';import { currentStepFilterGroupsComponentState } from '@/workflow/workflow-steps/workflow-actions/filter-action/states/currentStepFilterGroupsComponentState';import { currentStepFiltersComponentState } from '@/workflow/workflow-steps/workflow-actions/filter-action/states/currentStepFiltersComponentState';import { useContext } from 'react';diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/filter-action/hooks/useRemoveStepFilterGroup.ts b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/filter-action/hooks/useRemoveStepFilterGroup.tsindex c2990ca398c..6bf1288fe2e 100644--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/filter-action/hooks/useRemoveStepFilterGroup.ts+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/filter-action/hooks/useRemoveStepFilterGroup.ts@@ -1,5 +1,5 @@-import { getSnapshotValue } from '@/ui/utilities/recoil-scope/utils/getSnapshotValue';import { useRecoilComponentCallbackStateV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentCallbackStateV2';+import { getSnapshotValue } from '@/ui/utilities/state/utils/getSnapshotValue';import { WorkflowStepFilterContext } from '@/workflow/workflow-steps/workflow-actions/filter-action/states/context/WorkflowStepFilterContext';import { currentStepFilterGroupsComponentState } from '@/workflow/workflow-steps/workflow-actions/filter-action/states/currentStepFilterGroupsComponentState';import { currentStepFiltersComponentState } from '@/workflow/workflow-steps/workflow-actions/filter-action/states/currentStepFiltersComponentState';diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/filter-action/hooks/useUpsertStepFilterSettings.ts b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/filter-action/hooks/useUpsertStepFilterSettings.tsindex c62877250d4..cead1171260 100644--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/filter-action/hooks/useUpsertStepFilterSettings.ts+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/filter-action/hooks/useUpsertStepFilterSettings.ts@@ -1,5 +1,5 @@-import { getSnapshotValue } from '@/ui/utilities/recoil-scope/utils/getSnapshotValue';import { useRecoilComponentCallbackStateV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentCallbackStateV2';+import { getSnapshotValue } from '@/ui/utilities/state/utils/getSnapshotValue';import { WorkflowStepFilterContext } from '@/workflow/workflow-steps/workflow-actions/filter-action/states/context/WorkflowStepFilterContext';import { currentStepFilterGroupsComponentState } from '@/workflow/workflow-steps/workflow-actions/filter-action/states/currentStepFilterGroupsComponentState';import { currentStepFiltersComponentState } from '@/workflow/workflow-steps/workflow-actions/filter-action/states/currentStepFiltersComponentState';diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/find-records-action/components/WorkflowFindRecordsFilters.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/find-records-action/components/WorkflowFindRecordsFilters.tsxindex fe8e8662883..f620989e09a 100644--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/find-records-action/components/WorkflowFindRecordsFilters.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/find-records-action/components/WorkflowFindRecordsFilters.tsx@@ -8,9 +8,9 @@ import { isRecordFilterGroupChildARecordFilterGroup } from '@/object-record/advaimport { currentRecordFilterGroupsComponentState } from '@/object-record/record-filter-group/states/currentRecordFilterGroupsComponentState';import { currentRecordFiltersComponentState } from '@/object-record/record-filter/states/currentRecordFiltersComponentState';import { computeRecordGqlOperationFilter } from '@/object-record/record-filter/utils/computeRecordGqlOperationFilter';-import { getSnapshotValue } from '@/ui/utilities/recoil-scope/utils/getSnapshotValue';import { useRecoilComponentCallbackStateV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentCallbackStateV2';import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';+import { getSnapshotValue } from '@/ui/utilities/state/utils/getSnapshotValue';import { WorkflowAdvancedFilterRecordFilterColumn } from '@/workflow/workflow-steps/workflow-actions/find-records-action/components/WorkflowAdvancedFilterRecordFilterColumn';import { WorkflowAdvancedFilterRecordFilterGroupColumn } from '@/workflow/workflow-steps/workflow-actions/find-records-action/components/WorkflowAdvancedFilterRecordFilterGroupColumn';import { FindRecordsActionFilter } from '@/workflow/workflow-steps/workflow-actions/find-records-action/components/WorkflowEditActionFindRecords';diff --git a/packages/twenty-front/src/pages/settings/data-model/SettingsObjects.tsx b/packages/twenty-front/src/pages/settings/data-model/SettingsObjects.tsxindex 4d7f24058d9..c88b25a3638 100644--- a/packages/twenty-front/src/pages/settings/data-model/SettingsObjects.tsx+++ b/packages/twenty-front/src/pages/settings/data-model/SettingsObjects.tsx@@ -235,7 +235,7 @@ export const SettingsObjects = () => {isCustomObject={objectSettingsItem.objectMetadataItem.isCustom}- scopeKey={+ objectMetadataItemNamePlural={objectSettingsItem.objectMetadataItem.namePlural}onActivate={() =>diff --git a/packages/twenty-front/src/testing/decorators/ComponentWithRecoilScopeDecorator.tsx b/packages/twenty-front/src/testing/decorators/ComponentWithRecoilScopeDecorator.tsxdeleted file mode 100644index 86b59fd04d9..00000000000--- a/packages/twenty-front/src/testing/decorators/ComponentWithRecoilScopeDecorator.tsx+++ /dev/null@@ -1,14 +0,0 @@-import { Decorator } from '@storybook/react';--import { RecoilScope } from '@/ui/utilities/recoil-scope/components/RecoilScope';--export const ComponentWithRecoilScopeDecorator: Decorator = (- Story,- context,-) => (- <RecoilScope- CustomRecoilScopeContext={context.parameters.customRecoilScopeContext}- >- <Story />- </RecoilScope>-);diff --git a/packages/twenty-front/src/testing/decorators/PageDecorator.tsx b/packages/twenty-front/src/testing/decorators/PageDecorator.tsxindex 7ae2dbeed43..51df56e591c 100644--- a/packages/twenty-front/src/testing/decorators/PageDecorator.tsx+++ b/packages/twenty-front/src/testing/decorators/PageDecorator.tsx@@ -13,7 +13,7 @@ import { RecoilRoot } from 'recoil';import { ClientConfigProviderEffect } from '@/client-config/components/ClientConfigProviderEffect';import { ApolloCoreClientMockedProvider } from '@/object-metadata/hooks/__mocks__/ApolloCoreClientMockedProvider';-import { SnackBarComponentInstanceContextProvider } from '@/ui/feedback/snack-bar-manager/scopes/SnackBarComponentInstanceContextProvider';+import { DefaultLayout } from '@/ui/layout/page/components/DefaultLayout';import { UserProviderEffect } from '@/users/components/UserProviderEffect';import { ClientConfigProvider } from '~/modules/client-config/components/ClientConfigProvider';@@ -28,6 +28,7 @@ import { RecordFilterGroupsComponentInstanceContext } from '@/object-record/recoimport { RecordFiltersComponentInstanceContext } from '@/object-record/record-filter/states/context/RecordFiltersComponentInstanceContext';import { RecordSortsComponentInstanceContext } from '@/object-record/record-sort/states/context/RecordSortsComponentInstanceContext';import { PrefetchDataProvider } from '@/prefetch/components/PrefetchDataProvider';+import { SnackBarComponentInstanceContext } from '@/ui/feedback/snack-bar-manager/contexts/SnackBarComponentInstanceContext';import { WorkspaceProviderEffect } from '@/workspace/components/WorkspaceProviderEffect';import { i18n } from '@lingui/core';import { I18nProvider } from '@lingui/react';@@ -77,7 +78,9 @@ await dynamicActivate(SOURCE_LOCALE);const Providers = () => {return (<RecoilRoot>- <SnackBarComponentInstanceContextProvider snackBarComponentInstanceId="snack-bar-manager">+ <SnackBarComponentInstanceContext.Provider+ value={{ instanceId: 'snack-bar-manager' }}+ ><RecoilDebugObserverEffect /><ApolloProvider client={mockedApolloClient}><I18nProvider i18n={i18n}>@@ -125,7 +128,7 @@ const Providers = () => {</ClientConfigProvider></I18nProvider></ApolloProvider>- </SnackBarComponentInstanceContextProvider>+ </SnackBarComponentInstanceContext.Provider></RecoilRoot>);};diff --git a/packages/twenty-front/src/testing/decorators/SnackBarDecorator.tsx b/packages/twenty-front/src/testing/decorators/SnackBarDecorator.tsxindex 6e89147dc34..d6e3b906d79 100644--- a/packages/twenty-front/src/testing/decorators/SnackBarDecorator.tsx+++ b/packages/twenty-front/src/testing/decorators/SnackBarDecorator.tsx@@ -1,9 +1,10 @@+import { SnackBarComponentInstanceContext } from '@/ui/feedback/snack-bar-manager/contexts/SnackBarComponentInstanceContext';import { Decorator } from '@storybook/react';-import { SnackBarComponentInstanceContextProvider } from '@/ui/feedback/snack-bar-manager/scopes/SnackBarComponentInstanceContextProvider';-export const SnackBarDecorator: Decorator = (Story) => (- <SnackBarComponentInstanceContextProvider snackBarComponentInstanceId="snack-bar-manager">+ <SnackBarComponentInstanceContext.Provider+ value={{ instanceId: 'snack-bar-manager' }}+ ><Story />- </SnackBarComponentInstanceContextProvider>+ </SnackBarComponentInstanceContext.Provider>);diff --git a/packages/twenty-front/src/testing/jest/getJestMetadataAndApolloMocksWrapper.tsx b/packages/twenty-front/src/testing/jest/getJestMetadataAndApolloMocksWrapper.tsxindex 94520d5c182..21f454ee355 100644--- a/packages/twenty-front/src/testing/jest/getJestMetadataAndApolloMocksWrapper.tsx+++ b/packages/twenty-front/src/testing/jest/getJestMetadataAndApolloMocksWrapper.tsx@@ -6,7 +6,8 @@ import { ContextStoreComponentInstanceContext } from '@/context-store/states/conimport { RecordFilterGroupsComponentInstanceContext } from '@/object-record/record-filter-group/states/context/RecordFilterGroupsComponentInstanceContext';import { RecordFiltersComponentInstanceContext } from '@/object-record/record-filter/states/context/RecordFiltersComponentInstanceContext';import { RecordSortsComponentInstanceContext } from '@/object-record/record-sort/states/context/RecordSortsComponentInstanceContext';-import { SnackBarComponentInstanceContextProvider } from '@/ui/feedback/snack-bar-manager/scopes/SnackBarComponentInstanceContextProvider';++import { SnackBarComponentInstanceContext } from '@/ui/feedback/snack-bar-manager/contexts/SnackBarComponentInstanceContext';import { ViewComponentInstanceContext } from '@/views/states/contexts/ViewComponentInstanceContext';import { InMemoryCache } from '@apollo/client';import { JestContextStoreSetter } from '~/testing/jest/JestContextStoreSetter';@@ -25,7 +26,9 @@ export const getJestMetadataAndApolloMocksWrapper = ({}) => {return ({ children }: { children: ReactNode }) => (<RecoilRoot initializeState={onInitializeRecoilSnapshot}>- <SnackBarComponentInstanceContextProvider snackBarComponentInstanceId="snack-bar-manager">+ <SnackBarComponentInstanceContext.Provider+ value={{ instanceId: 'snack-bar-manager' }}+ ><MockedProvider mocks={apolloMocks} addTypename={false} cache={cache}><RecordFilterGroupsComponentInstanceContext.Providervalue={{ instanceId: 'instanceId' }}@@ -53,7 +56,7 @@ export const getJestMetadataAndApolloMocksWrapper = ({</RecordFiltersComponentInstanceContext.Provider></RecordFilterGroupsComponentInstanceContext.Provider></MockedProvider>- </SnackBarComponentInstanceContextProvider>+ </SnackBarComponentInstanceContext.Provider></RecoilRoot>);};diff --git a/packages/twenty-front/src/types/ScopeContextProps.ts b/packages/twenty-front/src/types/ScopeContextProps.tsdeleted file mode 100644index dcb49f3c955..00000000000--- a/packages/twenty-front/src/types/ScopeContextProps.ts+++ /dev/null@@ -1,3 +0,0 @@-export type ScopeContextProps<T = unknown> = {- scopeId: string;-} & T;diff --git a/packages/twenty-website/src/content/twenty-ui/input/select.mdx b/packages/twenty-website/src/content/twenty-ui/input/select.mdxindex 05bfe171be8..48375c7c150 100644--- a/packages/twenty-website/src/content/twenty-ui/input/select.mdx+++ b/packages/twenty-website/src/content/twenty-ui/input/select.mdx@@ -21,7 +21,6 @@ export const MyComponent = () => {<SelectclassNamedisabled={false}- dropdownScopeId="exampleDropdown"label="Select an option"options={[{ value: 'option1', label: 'Option A', Icon: IconTwentyStar },@@ -40,7 +39,6 @@ export const MyComponent = () => {<ArticlePropsTable options={[['className', 'string', 'Optional CSS class for additional styling'],['disabled', 'boolean', 'When set to `true`, disables user interaction with the component'],- ['dropdownScopeId', 'string', 'Required prop that uniquely identifies the dropdown scope'],['label', 'string', 'The label to describe the purpose of the `Select` component'],['onChange', 'function', 'The function called when the selected values change'],['options', 'array', "Represents the options available for the `Selected` component. It's an array of objects where each object has a `value` (the unique identifier), `label` (the unique identifier), and an optional `Icon`"],