Rename Jotai state hooks and utilities to consistent Atom-based naming (#18209)

## Summary

Rename all Jotai-based state management hooks and utilities to a
consistent naming convention that:
1. Removes legacy Recoil naming (`useRecoilXxxV2`, `createXxxV2`)
2. Always includes `Atom` in the name to distinguish from jotai native
hooks
3. Follows a consistent ordering: `Atom` → `Component` → `Family` →
`Type` (`State`/`Selector`)
4. Includes the type qualifier (`State` or `Selector`) in all
value-reading hooks to avoid naming conflicts with jotai's native
`useAtomValue`

## Naming Convention

**Hooks**:
`use[Set]Atom[Component][Family][State|Selector][Value|State|CallbackState]`
**Utils**: `createAtom[Component][Family][State|Selector]`

## Changes

### Hooks renamed (definition files + all usages across ~1,500 files):

| Old Name (Recoil) | Intermediate (Atom) | Final Name |
|---|---|---|
| `useRecoilValueV2` | `useAtomValue` | **`useAtomStateValue`** |
| `useRecoilStateV2` | `useAtomState` | `useAtomState` |
| `useSetRecoilStateV2` | `useSetAtomState` | `useSetAtomState` |
| `useFamilyRecoilValueV2` | `useFamilyAtomValue` |
**`useAtomFamilyStateValue`** |
| `useSetFamilyRecoilStateV2` | `useSetFamilyAtomState` |
**`useSetAtomFamilyState`** |
| `useFamilySelectorValueV2` | `useFamilySelectorValue` |
**`useAtomFamilySelectorValue`** |
| `useFamilySelectorStateV2` | `useFamilySelectorState` |
**`useAtomFamilySelectorState`** |
| `useRecoilComponentValueV2` | `useAtomComponentValue` |
**`useAtomComponentStateValue`** |
| `useRecoilComponentStateV2` | `useAtomComponentState` |
`useAtomComponentState` |
| `useSetRecoilComponentStateV2` | `useSetAtomComponentState` |
`useSetAtomComponentState` |
| `useRecoilComponentFamilyValueV2` | `useAtomComponentFamilyValue` |
**`useAtomComponentFamilyStateValue`** |
| `useRecoilComponentFamilyStateV2` | `useAtomComponentFamilyState` |
`useAtomComponentFamilyState` |
| `useSetRecoilComponentFamilyStateV2` |
`useSetAtomComponentFamilyState` | `useSetAtomComponentFamilyState` |
| `useRecoilComponentSelectorValueV2` | `useAtomComponentSelectorValue`
| `useAtomComponentSelectorValue` |
| `useRecoilComponentFamilySelectorValueV2` |
`useAtomComponentFamilySelectorValue` |
`useAtomComponentFamilySelectorValue` |
| `useRecoilComponentStateCallbackStateV2` |
`useAtomComponentStateCallbackState` |
`useAtomComponentStateCallbackState` |
| `useRecoilComponentSelectorCallbackStateV2` |
`useAtomComponentSelectorCallbackState` |
`useAtomComponentSelectorCallbackState` |
| `useRecoilComponentFamilyStateCallbackStateV2` |
`useAtomComponentFamilyStateCallbackState` |
`useAtomComponentFamilyStateCallbackState` |
| `useRecoilComponentFamilySelectorCallbackStateV2` |
`useAtomComponentFamilySelectorCallbackState` |
`useAtomComponentFamilySelectorCallbackState` |

### Utilities renamed:

| Old Name (Recoil) | Final Name |
|---|---|
| `createStateV2` | **`createAtomState`** |
| `createFamilyStateV2` | **`createAtomFamilyState`** |
| `createSelectorV2` | **`createAtomSelector`** |
| `createFamilySelectorV2` | **`createAtomFamilySelector`** |
| `createWritableSelectorV2` | **`createAtomWritableSelector`** |
| `createWritableFamilySelectorV2` |
**`createAtomWritableFamilySelector`** |
| `createComponentStateV2` | **`createAtomComponentState`** |
| `createComponentFamilyStateV2` | **`createAtomComponentFamilyState`**
|
| `createComponentSelectorV2` | **`createAtomComponentSelector`** |
| `createComponentFamilySelectorV2` |
**`createAtomComponentFamilySelector`** |

## Details

- All definition files renamed to match new convention
- All import paths and usages updated across the entire `twenty-front`
package
- Jotai's native `useAtomValue` is aliased as `useJotaiAtomValue` in the
wrapper hook to avoid collision
- Legacy Recoil files in `state/utils/` and `component-state/utils/`
left untouched (separate naming scope)
- Typecheck passes cleanly
This commit is contained in:
Charles Bochet
2026-02-25 01:55:46 +01:00
committed by GitHub
parent eaf9fe27b2
commit d81f006979
1890 changed files with 6399 additions and 6420 deletions
@@ -1,5 +1,5 @@
import { workflowRunIteratorSubStepIterationIndexComponentState } from '@/command-menu/pages/workflow/step/view-run/states/workflowRunIteratorSubStepIterationIndexComponentState';
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentValueV2';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { useWorkflowRun } from '@/workflow/hooks/useWorkflowRun';
import { useWorkflowRunIdOrThrow } from '@/workflow/hooks/useWorkflowRunIdOrThrow';
import { getStepDefinitionOrThrow } from '@/workflow/utils/getStepDefinitionOrThrow';
@@ -29,7 +29,7 @@ export const WorkflowRunStepInputDetail = ({ stepId }: { stepId: string }) => {
(step) => step.id === stepId,
);
const workflowRunIteratorSubStepIterationIndex = useRecoilComponentValueV2(
const workflowRunIteratorSubStepIterationIndex = useAtomComponentStateValue(
workflowRunIteratorSubStepIterationIndexComponentState,
);
@@ -5,10 +5,10 @@ import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';
import { RightDrawerFooter } from '@/ui/layout/right-drawer/components/RightDrawerFooter';
import { SelectableListItem } from '@/ui/layout/selectable-list/components/SelectableListItem';
import { selectedItemIdComponentState } from '@/ui/layout/selectable-list/states/selectedItemIdComponentState';
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentValueV2';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { useDeleteStep } from '@/workflow/workflow-steps/hooks/useDeleteStep';
import { useDuplicateStep } from '@/workflow/workflow-steps/hooks/useDuplicateStep';
import { useRecoilValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilValueV2';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { workflowAiAgentActionAgentStateV2 } from '@/workflow/workflow-steps/workflow-actions/ai-agent-action/states/workflowAiAgentActionAgentStateV2';
import { useLingui } from '@lingui/react/macro';
import { useId } from 'react';
@@ -44,7 +44,7 @@ export const WorkflowStepFooter = ({
} = useWorkflowCommandMenu();
const { deleteStep } = useDeleteStep();
const navigateSettings = useNavigateSettings();
const workflowAiAgentActionAgent = useRecoilValueV2(
const workflowAiAgentActionAgent = useAtomStateValue(
workflowAiAgentActionAgentStateV2,
);
const shouldPinDeleteButton =
@@ -98,7 +98,7 @@ export const WorkflowStepFooter = ({
}
};
const selectedItemId = useRecoilComponentValueV2(
const selectedItemId = useAtomComponentStateValue(
selectedItemIdComponentState,
dropdownId,
);
@@ -1,6 +1,6 @@
import { useRecoilComponentFamilyStateV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentFamilyStateV2';
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentValueV2';
import { useSetRecoilComponentStateV2 } from '@/ui/utilities/state/jotai/hooks/useSetRecoilComponentStateV2';
import { useAtomComponentFamilyState } from '@/ui/utilities/state/jotai/hooks/useAtomComponentFamilyState';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { useSetAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useSetAtomComponentState';
import { currentStepFilterGroupsComponentState } from '@/workflow/workflow-steps/filters/states/currentStepFilterGroupsComponentState';
import { currentStepFiltersComponentState } from '@/workflow/workflow-steps/filters/states/currentStepFiltersComponentState';
import { hasInitializedCurrentStepFilterGroupsComponentFamilyState } from '@/workflow/workflow-steps/filters/states/hasInitializedCurrentStepFilterGroupsComponentFamilyState';
@@ -31,7 +31,7 @@ export const WorkflowEditActionFilterBodyEffect = ({
const [
hasInitializedCurrentStepFilters,
setHasInitializedCurrentStepFilters,
] = useRecoilComponentFamilyStateV2(
] = useAtomComponentFamilyState(
hasInitializedCurrentStepFiltersComponentFamilyState,
{ stepId },
);
@@ -39,23 +39,23 @@ export const WorkflowEditActionFilterBodyEffect = ({
const [
hasInitializedCurrentStepFilterGroups,
setHasInitializedCurrentStepFilterGroups,
] = useRecoilComponentFamilyStateV2(
] = useAtomComponentFamilyState(
hasInitializedCurrentStepFilterGroupsComponentFamilyState,
{ stepId },
);
const currentStepFilters = useRecoilComponentValueV2(
const currentStepFilters = useAtomComponentStateValue(
currentStepFiltersComponentState,
);
const currentStepFilterGroups = useRecoilComponentValueV2(
const currentStepFilterGroups = useAtomComponentStateValue(
currentStepFilterGroupsComponentState,
);
const setCurrentStepFilters = useSetRecoilComponentStateV2(
const setCurrentStepFilters = useSetAtomComponentState(
currentStepFiltersComponentState,
);
const setCurrentStepFilterGroups = useSetRecoilComponentStateV2(
const setCurrentStepFilterGroups = useSetAtomComponentState(
currentStepFilterGroupsComponentState,
);
@@ -1,5 +1,5 @@
import { useRecoilComponentStateCallbackStateV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentStateCallbackStateV2';
import { useSetRecoilComponentFamilyStateV2 } from '@/ui/utilities/state/jotai/hooks/useSetRecoilComponentFamilyStateV2';
import { useAtomComponentStateCallbackState } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateCallbackState';
import { useSetAtomComponentFamilyState } from '@/ui/utilities/state/jotai/hooks/useSetAtomComponentFamilyState';
import { WorkflowStepFilterContext } from '@/workflow/workflow-steps/filters/states/context/WorkflowStepFilterContext';
import { currentStepFilterGroupsComponentState } from '@/workflow/workflow-steps/filters/states/currentStepFilterGroupsComponentState';
import { currentStepFiltersComponentState } from '@/workflow/workflow-steps/filters/states/currentStepFiltersComponentState';
@@ -19,22 +19,21 @@ export const useAddRootStepFilter = () => {
const { stepId, onFilterSettingsUpdate } = useContext(
WorkflowStepFilterContext,
);
const currentStepFilterGroups = useRecoilComponentStateCallbackStateV2(
const currentStepFilterGroups = useAtomComponentStateCallbackState(
currentStepFilterGroupsComponentState,
);
const currentStepFilters = useRecoilComponentStateCallbackStateV2(
const currentStepFilters = useAtomComponentStateCallbackState(
currentStepFiltersComponentState,
);
const setHasInitializedCurrentStepFilters =
useSetRecoilComponentFamilyStateV2(
hasInitializedCurrentStepFiltersComponentFamilyState,
{ stepId },
);
const setHasInitializedCurrentStepFilters = useSetAtomComponentFamilyState(
hasInitializedCurrentStepFiltersComponentFamilyState,
{ stepId },
);
const setHasInitializedCurrentStepFilterGroups =
useSetRecoilComponentFamilyStateV2(
useSetAtomComponentFamilyState(
hasInitializedCurrentStepFilterGroupsComponentFamilyState,
{ stepId },
);
@@ -1,4 +1,4 @@
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentValueV2';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { currentStepFilterGroupsComponentState } from '@/workflow/workflow-steps/filters/states/currentStepFilterGroupsComponentState';
import { currentStepFiltersComponentState } from '@/workflow/workflow-steps/filters/states/currentStepFiltersComponentState';
import { type StepFilter, type StepFilterGroup } from 'twenty-shared/types';
@@ -9,11 +9,11 @@ export const useChildStepFiltersAndChildStepFilterGroups = ({
}: {
stepFilterGroupId: string;
}) => {
const stepFilterGroups = useRecoilComponentValueV2(
const stepFilterGroups = useAtomComponentStateValue(
currentStepFilterGroupsComponentState,
);
const stepFilters = useRecoilComponentValueV2(
const stepFilters = useAtomComponentStateValue(
currentStepFiltersComponentState,
);
@@ -1,11 +1,11 @@
import { useRecoilComponentSelectorValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentSelectorValueV2';
import { useAtomComponentSelectorValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentSelectorValue';
import { createStepSelector } from '@/workflow/states/selectors/stepSelector';
import { useMemo } from 'react';
import { isDefined } from 'twenty-shared/utils';
export const useFilterCounter = ({ stepId }: { stepId: string }) => {
const stepSelector = useMemo(() => createStepSelector(stepId), [stepId]);
const step = useRecoilComponentSelectorValueV2(stepSelector);
const step = useAtomComponentSelectorValue(stepSelector);
if (!isDefined(step)) {
return {
@@ -1,4 +1,4 @@
import { useRecoilComponentStateCallbackStateV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentStateCallbackStateV2';
import { useAtomComponentStateCallbackState } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateCallbackState';
import { currentStepFilterGroupsComponentState } from '@/workflow/workflow-steps/filters/states/currentStepFilterGroupsComponentState';
import { currentStepFiltersComponentState } from '@/workflow/workflow-steps/filters/states/currentStepFiltersComponentState';
import { useStore } from 'jotai';
@@ -9,11 +9,11 @@ import { WorkflowStepFilterContext } from '@/workflow/workflow-steps/filters/sta
export const useRemoveStepFilter = () => {
const { onFilterSettingsUpdate } = useContext(WorkflowStepFilterContext);
const currentStepFilters = useRecoilComponentStateCallbackStateV2(
const currentStepFilters = useAtomComponentStateCallbackState(
currentStepFiltersComponentState,
);
const currentStepFilterGroups = useRecoilComponentStateCallbackStateV2(
const currentStepFilterGroups = useAtomComponentStateCallbackState(
currentStepFilterGroupsComponentState,
);
@@ -1,4 +1,4 @@
import { useRecoilComponentStateCallbackStateV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentStateCallbackStateV2';
import { useAtomComponentStateCallbackState } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateCallbackState';
import { WorkflowStepFilterContext } from '@/workflow/workflow-steps/filters/states/context/WorkflowStepFilterContext';
import { currentStepFilterGroupsComponentState } from '@/workflow/workflow-steps/filters/states/currentStepFilterGroupsComponentState';
import { currentStepFiltersComponentState } from '@/workflow/workflow-steps/filters/states/currentStepFiltersComponentState';
@@ -9,11 +9,11 @@ import { isDefined } from 'twenty-shared/utils';
export const useRemoveStepFilterGroup = () => {
const { onFilterSettingsUpdate } = useContext(WorkflowStepFilterContext);
const currentStepFilterGroups = useRecoilComponentStateCallbackStateV2(
const currentStepFilterGroups = useAtomComponentStateCallbackState(
currentStepFilterGroupsComponentState,
);
const currentStepFilters = useRecoilComponentStateCallbackStateV2(
const currentStepFilters = useAtomComponentStateCallbackState(
currentStepFiltersComponentState,
);
@@ -1,4 +1,4 @@
import { useRecoilComponentStateCallbackStateV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentStateCallbackStateV2';
import { useAtomComponentStateCallbackState } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateCallbackState';
import { WorkflowStepFilterContext } from '@/workflow/workflow-steps/filters/states/context/WorkflowStepFilterContext';
import { currentStepFilterGroupsComponentState } from '@/workflow/workflow-steps/filters/states/currentStepFilterGroupsComponentState';
import { currentStepFiltersComponentState } from '@/workflow/workflow-steps/filters/states/currentStepFiltersComponentState';
@@ -8,11 +8,11 @@ import { type StepFilter, type StepFilterGroup } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
export const useUpsertStepFilterSettings = () => {
const currentStepFilterGroups = useRecoilComponentStateCallbackStateV2(
const currentStepFilterGroups = useAtomComponentStateCallbackState(
currentStepFilterGroupsComponentState,
);
const currentStepFilters = useRecoilComponentStateCallbackStateV2(
const currentStepFilters = useAtomComponentStateCallbackState(
currentStepFiltersComponentState,
);
const { onFilterSettingsUpdate } = useContext(WorkflowStepFilterContext);
@@ -1,8 +1,8 @@
import { createComponentStateV2 } from '@/ui/utilities/state/jotai/utils/createComponentStateV2';
import { createAtomComponentState } from '@/ui/utilities/state/jotai/utils/createAtomComponentState';
import { StepFilterGroupsComponentInstanceContext } from '@/workflow/workflow-steps/filters/states/context/StepFilterGroupsComponentInstanceContext';
import { type StepFilterGroup } from 'twenty-shared/types';
export const currentStepFilterGroupsComponentState = createComponentStateV2<
export const currentStepFilterGroupsComponentState = createAtomComponentState<
StepFilterGroup[]
>({
key: 'currentStepFilterGroupsComponentState',
@@ -1,8 +1,8 @@
import { createComponentStateV2 } from '@/ui/utilities/state/jotai/utils/createComponentStateV2';
import { createAtomComponentState } from '@/ui/utilities/state/jotai/utils/createAtomComponentState';
import { StepFiltersComponentInstanceContext } from '@/workflow/workflow-steps/filters/states/context/StepFiltersComponentInstanceContext';
import { type StepFilter } from 'twenty-shared/types';
export const currentStepFiltersComponentState = createComponentStateV2<
export const currentStepFiltersComponentState = createAtomComponentState<
StepFilter[]
>({
key: 'currentStepFiltersComponentState',
@@ -1,8 +1,8 @@
import { createComponentFamilyStateV2 } from '@/ui/utilities/state/jotai/utils/createComponentFamilyStateV2';
import { createAtomComponentFamilyState } from '@/ui/utilities/state/jotai/utils/createAtomComponentFamilyState';
import { StepFilterGroupsComponentInstanceContext } from '@/workflow/workflow-steps/filters/states/context/StepFilterGroupsComponentInstanceContext';
export const hasInitializedCurrentStepFilterGroupsComponentFamilyState =
createComponentFamilyStateV2<boolean, { stepId: string }>({
createAtomComponentFamilyState<boolean, { stepId: string }>({
key: 'hasInitializedCurrentStepFilterGroupsComponentFamilyState',
defaultValue: false,
componentInstanceContext: StepFilterGroupsComponentInstanceContext,
@@ -1,8 +1,8 @@
import { createComponentFamilyStateV2 } from '@/ui/utilities/state/jotai/utils/createComponentFamilyStateV2';
import { createAtomComponentFamilyState } from '@/ui/utilities/state/jotai/utils/createAtomComponentFamilyState';
import { StepFiltersComponentInstanceContext } from '@/workflow/workflow-steps/filters/states/context/StepFiltersComponentInstanceContext';
export const hasInitializedCurrentStepFiltersComponentFamilyState =
createComponentFamilyStateV2<boolean, { stepId: string }>({
createAtomComponentFamilyState<boolean, { stepId: string }>({
key: 'hasInitializedCurrentStepFiltersComponentFamilyState',
defaultValue: false,
componentInstanceContext: StepFiltersComponentInstanceContext,
@@ -1,11 +1,11 @@
import { createComponentSelectorV2 } from '@/ui/utilities/state/jotai/utils/createComponentSelectorV2';
import { createAtomComponentSelector } from '@/ui/utilities/state/jotai/utils/createAtomComponentSelector';
import { StepFilterGroupsComponentInstanceContext } from '@/workflow/workflow-steps/filters/states/context/StepFilterGroupsComponentInstanceContext';
import { currentStepFilterGroupsComponentState } from '@/workflow/workflow-steps/filters/states/currentStepFilterGroupsComponentState';
import { type StepFilterGroup } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
export const rootLevelStepFilterGroupComponentSelector =
createComponentSelectorV2<StepFilterGroup | undefined>({
createAtomComponentSelector<StepFilterGroup | undefined>({
key: 'rootLevelStepFilterGroupComponentSelector',
get:
({ instanceId }) =>
@@ -1,4 +1,4 @@
import { useSetRecoilComponentStateV2 } from '@/ui/utilities/state/jotai/hooks/useSetRecoilComponentStateV2';
import { useSetAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useSetAtomComponentState';
import { useGetUpdatableWorkflowVersionOrThrow } from '@/workflow/hooks/useGetUpdatableWorkflowVersionOrThrow';
import { workflowLastCreatedStepIdComponentState } from '@/workflow/states/workflowLastCreatedStepIdComponentState';
import { type WorkflowActionType } from '@/workflow/types/Workflow';
@@ -18,10 +18,10 @@ import { v4 } from 'uuid';
export const useCreateStep = () => {
const [isLoading, setIsLoading] = useState(false);
const { createWorkflowVersionStep } = useCreateWorkflowVersionStep();
const setWorkflowSelectedNode = useSetRecoilComponentStateV2(
const setWorkflowSelectedNode = useSetAtomComponentState(
workflowSelectedNodeComponentState,
);
const setWorkflowLastCreatedStepId = useSetRecoilComponentStateV2(
const setWorkflowLastCreatedStepId = useSetAtomComponentState(
workflowLastCreatedStepIdComponentState,
);
@@ -8,7 +8,7 @@ import {
} from '~/generated/graphql';
import { useUpdateWorkflowVersionCache } from '@/workflow/workflow-steps/hooks/useUpdateWorkflowVersionCache';
import { flowComponentState } from '@/workflow/states/flowComponentState';
import { useSetRecoilComponentStateV2 } from '@/ui/utilities/state/jotai/hooks/useSetRecoilComponentStateV2';
import { useSetAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useSetAtomComponentState';
import { isDefined } from 'twenty-shared/utils';
export const useCreateWorkflowVersionStep = () => {
@@ -16,7 +16,7 @@ export const useCreateWorkflowVersionStep = () => {
const { updateWorkflowVersionCache } = useUpdateWorkflowVersionCache();
const setFlow = useSetRecoilComponentStateV2(flowComponentState);
const setFlow = useSetAtomComponentState(flowComponentState);
const [mutate] = useMutation<
CreateWorkflowVersionStepMutation,
@@ -1,5 +1,5 @@
import { useCommandMenu } from '@/command-menu/hooks/useCommandMenu';
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentValueV2';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { useGetUpdatableWorkflowVersionOrThrow } from '@/workflow/hooks/useGetUpdatableWorkflowVersionOrThrow';
import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';
import { workflowVisualizerWorkflowIdComponentState } from '@/workflow/states/workflowVisualizerWorkflowIdComponentState';
@@ -17,7 +17,7 @@ export const useDeleteStep = () => {
const { getUpdatableWorkflowVersion } =
useGetUpdatableWorkflowVersionOrThrow();
const { closeCommandMenu } = useCommandMenu();
const workflowVisualizerWorkflowId = useRecoilComponentValueV2(
const workflowVisualizerWorkflowId = useAtomComponentStateValue(
workflowVisualizerWorkflowIdComponentState,
);
const workflow = useWorkflowWithCurrentVersion(workflowVisualizerWorkflowId);
@@ -1,4 +1,4 @@
import { useSetRecoilComponentStateV2 } from '@/ui/utilities/state/jotai/hooks/useSetRecoilComponentStateV2';
import { useSetAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useSetAtomComponentState';
import { useGetUpdatableWorkflowVersionOrThrow } from '@/workflow/hooks/useGetUpdatableWorkflowVersionOrThrow';
import { workflowLastCreatedStepIdComponentState } from '@/workflow/states/workflowLastCreatedStepIdComponentState';
import { workflowSelectedNodeComponentState } from '@/workflow/workflow-diagram/states/workflowSelectedNodeComponentState';
@@ -10,10 +10,10 @@ import { isDefined } from 'twenty-shared/utils';
export const useDuplicateStep = () => {
const [isLoading, setIsLoading] = useState(false);
const { duplicateWorkflowVersionStep } = useDuplicateWorkflowVersionStep();
const setWorkflowSelectedNode = useSetRecoilComponentStateV2(
const setWorkflowSelectedNode = useSetAtomComponentState(
workflowSelectedNodeComponentState,
);
const setWorkflowLastCreatedStepId = useSetRecoilComponentStateV2(
const setWorkflowLastCreatedStepId = useSetAtomComponentState(
workflowLastCreatedStepIdComponentState,
);
@@ -1,5 +1,5 @@
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import { useSetRecoilComponentStateV2 } from '@/ui/utilities/state/jotai/hooks/useSetRecoilComponentStateV2';
import { useSetAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useSetAtomComponentState';
import { DUPLICATE_WORKFLOW_VERSION_STEP } from '@/workflow/graphql/mutations/duplicateWorkflowVersionStep';
import { flowComponentState } from '@/workflow/states/flowComponentState';
import { useUpdateWorkflowVersionCache } from '@/workflow/workflow-steps/hooks/useUpdateWorkflowVersionCache';
@@ -16,7 +16,7 @@ export const useDuplicateWorkflowVersionStep = () => {
const { updateWorkflowVersionCache } = useUpdateWorkflowVersionCache();
const setFlow = useSetRecoilComponentStateV2(flowComponentState);
const setFlow = useSetAtomComponentState(flowComponentState);
const [mutate] = useMutation<
DuplicateWorkflowVersionStepMutation,
@@ -1,5 +1,5 @@
import { workflowRunIteratorSubStepIterationIndexComponentState } from '@/command-menu/pages/workflow/step/view-run/states/workflowRunIteratorSubStepIterationIndexComponentState';
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentValueV2';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { useWorkflowRun } from '@/workflow/hooks/useWorkflowRun';
import { useWorkflowRunIdOrThrow } from '@/workflow/hooks/useWorkflowRunIdOrThrow';
import { isDefined } from 'twenty-shared/utils';
@@ -9,7 +9,7 @@ export const useWorkflowRunStepInfo = ({ stepId }: { stepId: string }) => {
const workflowRunId = useWorkflowRunIdOrThrow();
const workflowRun = useWorkflowRun({ workflowRunId });
const workflowRunIteratorSubStepIterationIndex = useRecoilComponentValueV2(
const workflowRunIteratorSubStepIterationIndex = useAtomComponentStateValue(
workflowRunIteratorSubStepIterationIndexComponentState,
);
@@ -1,4 +1,4 @@
import { createComponentStateV2 } from '@/ui/utilities/state/jotai/utils/createComponentStateV2';
import { createAtomComponentState } from '@/ui/utilities/state/jotai/utils/createAtomComponentState';
import { WorkflowVisualizerComponentInstanceContext } from '@/workflow/workflow-diagram/states/contexts/WorkflowVisualizerComponentInstanceContext';
import { type WorkflowStepConnectionOptions } from '@/workflow/workflow-diagram/workflow-iterator/types/WorkflowStepConnectionOptions';
@@ -10,7 +10,7 @@ type WorkflowInsertStepIdsState = {
};
export const workflowInsertStepIdsComponentState =
createComponentStateV2<WorkflowInsertStepIdsState>({
createAtomComponentState<WorkflowInsertStepIdsState>({
key: 'workflowInsertStepIdsComponentState',
defaultValue: {
parentStepId: undefined,
@@ -3,8 +3,8 @@ import { useActionRolePermissionFlagConfig } from '@/settings/roles/role-permiss
import { TextInput } from '@/ui/input/components/TextInput';
import { type WorkflowAiAgentAction } from '@/workflow/types/Workflow';
import { useWorkflowAiAgentPermissionActions } from '@/workflow/workflow-steps/workflow-actions/ai-agent-action/hooks/useWorkflowAiAgentPermissionActions';
import { useRecoilStateV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilStateV2';
import { useRecoilValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilValueV2';
import { useAtomState } from '@/ui/utilities/state/jotai/hooks/useAtomState';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { workflowAiAgentActionAgentStateV2 } from '@/workflow/workflow-steps/workflow-actions/ai-agent-action/states/workflowAiAgentActionAgentStateV2';
import { workflowAiAgentPermissionsIsAddingPermissionStateV2 } from '@/workflow/workflow-steps/workflow-actions/ai-agent-action/states/workflowAiAgentPermissionsIsAddingPermissionStateV2';
import { workflowAiAgentPermissionsSelectedObjectIdStateV2 } from '@/workflow/workflow-steps/workflow-actions/ai-agent-action/states/workflowAiAgentPermissionsSelectedObjectIdStateV2';
@@ -75,18 +75,18 @@ export const WorkflowAiAgentPermissionsTab = ({
isAgentLoading,
refetchAgent,
}: WorkflowAiAgentPermissionsTabProps) => {
const workflowAiAgentActionAgent = useRecoilValueV2(
const workflowAiAgentActionAgent = useAtomStateValue(
workflowAiAgentActionAgentStateV2,
);
const [
workflowAiAgentPermissionsSelectedObjectId,
setWorkflowAiAgentPermissionsSelectedObjectId,
] = useRecoilStateV2(workflowAiAgentPermissionsSelectedObjectIdStateV2);
] = useAtomState(workflowAiAgentPermissionsSelectedObjectIdStateV2);
const [
workflowAiAgentPermissionsIsAddingPermission,
setWorkflowAiAgentPermissionsIsAddingPermission,
] = useRecoilStateV2(workflowAiAgentPermissionsIsAddingPermissionStateV2);
] = useAtomState(workflowAiAgentPermissionsIsAddingPermissionStateV2);
const { alphaSortedActiveNonSystemObjectMetadataItems: objectMetadataItems } =
useFilteredObjectMetadataItems();
@@ -1,6 +1,6 @@
import { FormTextFieldInput } from '@/object-record/record-field/ui/form-types/components/FormTextFieldInput';
import { Select } from '@/ui/input/components/Select';
import { useRecoilValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilValueV2';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { workflowAiAgentActionAgentStateV2 } from '@/workflow/workflow-steps/workflow-actions/ai-agent-action/states/workflowAiAgentActionAgentStateV2';
import { WorkflowVariablePicker } from '@/workflow/workflow-variables/components/WorkflowVariablePicker';
import { t } from '@lingui/core/macro';
@@ -32,7 +32,7 @@ export const WorkflowAiAgentPromptTab = ({
onModelConfigurationChange,
onResponseFormatChange,
}: WorkflowAiAgentPromptTabProps) => {
const workflowAiAgentActionAgent = useRecoilValueV2(
const workflowAiAgentActionAgent = useAtomStateValue(
workflowAiAgentActionAgentStateV2,
);
return (
@@ -3,7 +3,7 @@ import { useAiModelOptions } from '@/ai/hooks/useAiModelOptions';
import { TabList } from '@/ui/layout/tab-list/components/TabList';
import { activeTabIdComponentState } from '@/ui/layout/tab-list/states/activeTabIdComponentState';
import { type SingleTabProps } from '@/ui/layout/tab-list/types/SingleTabProps';
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentValueV2';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { useFlowOrThrow } from '@/workflow/hooks/useFlowOrThrow';
import { type WorkflowAiAgentAction } from '@/workflow/types/Workflow';
import { WorkflowStepBody } from '@/workflow/workflow-steps/components/WorkflowStepBody';
@@ -12,7 +12,7 @@ import { useUpdateWorkflowVersionStep } from '@/workflow/workflow-steps/hooks/us
import { WorkflowAiAgentPermissionsTab } from '@/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsTab';
import { WORKFLOW_AI_AGENT_TABS } from '@/workflow/workflow-steps/workflow-actions/ai-agent-action/constants/WorkflowAiAgentTabs';
import { useResetWorkflowAiAgentPermissionsStateOnCommandMenuClose } from '@/workflow/workflow-steps/workflow-actions/ai-agent-action/hooks/useResetWorkflowAiAgentPermissionsStateOnCommandMenuClose';
import { useRecoilStateV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilStateV2';
import { useAtomState } from '@/ui/utilities/state/jotai/hooks/useAtomState';
import { workflowAiAgentActionAgentStateV2 } from '@/workflow/workflow-steps/workflow-actions/ai-agent-action/states/workflowAiAgentActionAgentStateV2';
import { workflowAiAgentPermissionsIsAddingPermissionStateV2 } from '@/workflow/workflow-steps/workflow-actions/ai-agent-action/states/workflowAiAgentPermissionsIsAddingPermissionStateV2';
import styled from '@emotion/styled';
@@ -66,7 +66,7 @@ export const WorkflowEditActionAiAgent = ({
const componentInstanceId = `${WORKFLOW_AI_AGENT_TAB_LIST_COMPONENT_ID}-${action.id}`;
const agentId = action.settings.input.agentId;
const [workflowAiAgentActionAgent, setWorkflowAiAgentActionAgent] =
useRecoilStateV2(workflowAiAgentActionAgentStateV2);
useAtomState(workflowAiAgentActionAgentStateV2);
const { loading: agentLoading, refetch: refetchAgent } = useFindOneAgentQuery(
{
variables: { id: agentId || '' },
@@ -204,7 +204,7 @@ export const WorkflowEditActionAiAgent = ({
},
];
const activeTabId = useRecoilComponentValueV2(
const activeTabId = useAtomComponentStateValue(
activeTabIdComponentState,
componentInstanceId,
);
@@ -217,7 +217,7 @@ export const WorkflowEditActionAiAgent = ({
const [
workflowAiAgentPermissionsIsAddingPermission,
setWorkflowAiAgentPermissionsIsAddingPermission,
] = useRecoilStateV2(workflowAiAgentPermissionsIsAddingPermissionStateV2);
] = useAtomState(workflowAiAgentPermissionsIsAddingPermissionStateV2);
const role = rolesData?.getRoles.find(
(item) => item.id === workflowAiAgentActionAgent?.roleId,
@@ -1,17 +1,17 @@
import { useListenToSidePanelClosing } from '@/ui/layout/right-drawer/hooks/useListenToSidePanelClosing';
import { useSetRecoilStateV2 } from '@/ui/utilities/state/jotai/hooks/useSetRecoilStateV2';
import { useSetAtomState } from '@/ui/utilities/state/jotai/hooks/useSetAtomState';
import { workflowAiAgentActionAgentStateV2 } from '@/workflow/workflow-steps/workflow-actions/ai-agent-action/states/workflowAiAgentActionAgentStateV2';
import { workflowAiAgentPermissionsIsAddingPermissionStateV2 } from '@/workflow/workflow-steps/workflow-actions/ai-agent-action/states/workflowAiAgentPermissionsIsAddingPermissionStateV2';
import { workflowAiAgentPermissionsSelectedObjectIdStateV2 } from '@/workflow/workflow-steps/workflow-actions/ai-agent-action/states/workflowAiAgentPermissionsSelectedObjectIdStateV2';
export const useResetWorkflowAiAgentPermissionsStateOnCommandMenuClose = () => {
const setSelectedObjectId = useSetRecoilStateV2(
const setSelectedObjectId = useSetAtomState(
workflowAiAgentPermissionsSelectedObjectIdStateV2,
);
const setIsAddingPermission = useSetRecoilStateV2(
const setIsAddingPermission = useSetAtomState(
workflowAiAgentPermissionsIsAddingPermissionStateV2,
);
const setAgentState = useSetRecoilStateV2(workflowAiAgentActionAgentStateV2);
const setAgentState = useSetAtomState(workflowAiAgentActionAgentStateV2);
const resetPermissionState = () => {
setSelectedObjectId(undefined);
@@ -4,7 +4,7 @@ import { useActionRolePermissionFlagConfig } from '@/settings/roles/role-permiss
import { useSettingsRolePermissionFlagConfig } from '@/settings/roles/role-permissions/permission-flags/hooks/useSettingsRolePermissionFlagConfig';
import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
import { CRUD_PERMISSIONS } from '@/workflow/workflow-steps/workflow-actions/ai-agent-action/constants/WorkflowAiAgentCrudPermissions';
import { useRecoilStateV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilStateV2';
import { useAtomState } from '@/ui/utilities/state/jotai/hooks/useAtomState';
import { workflowAiAgentActionAgentStateV2 } from '@/workflow/workflow-steps/workflow-actions/ai-agent-action/states/workflowAiAgentActionAgentStateV2';
import { workflowAiAgentPermissionsIsAddingPermissionStateV2 } from '@/workflow/workflow-steps/workflow-actions/ai-agent-action/states/workflowAiAgentPermissionsIsAddingPermissionStateV2';
import { workflowAiAgentPermissionsSelectedObjectIdStateV2 } from '@/workflow/workflow-steps/workflow-actions/ai-agent-action/states/workflowAiAgentPermissionsSelectedObjectIdStateV2';
@@ -37,7 +37,7 @@ export const useWorkflowAiAgentPermissionActions = ({
}: UseWorkflowAiAgentPermissionActionsParams) => {
const { enqueueSuccessSnackBar } = useSnackBar();
const [workflowAiAgentActionAgent, setWorkflowAiAgentActionAgent] =
useRecoilStateV2(workflowAiAgentActionAgentStateV2);
useAtomState(workflowAiAgentActionAgentStateV2);
const { alphaSortedActiveNonSystemObjectMetadataItems: objectMetadataItems } =
useFilteredObjectMetadataItems();
const settingsPermissionsConfig = useSettingsRolePermissionFlagConfig({
@@ -47,10 +47,10 @@ export const useWorkflowAiAgentPermissionActions = ({
assignmentCapabilities: { canBeAssignedToAgents: true },
});
const [, setWorkflowAiAgentPermissionsSelectedObjectId] = useRecoilStateV2(
const [, setWorkflowAiAgentPermissionsSelectedObjectId] = useAtomState(
workflowAiAgentPermissionsSelectedObjectIdStateV2,
);
const [, setWorkflowAiAgentPermissionsIsAddingPermission] = useRecoilStateV2(
const [, setWorkflowAiAgentPermissionsIsAddingPermission] = useAtomState(
workflowAiAgentPermissionsIsAddingPermissionStateV2,
);
@@ -1,8 +1,8 @@
import { type Agent } from '~/generated-metadata/graphql';
import { createStateV2 } from '@/ui/utilities/state/jotai/utils/createStateV2';
import { createAtomState } from '@/ui/utilities/state/jotai/utils/createAtomState';
export const workflowAiAgentActionAgentStateV2 = createStateV2<
export const workflowAiAgentActionAgentStateV2 = createAtomState<
Agent | undefined
>({
key: 'workflowAiAgentActionAgentStateV2',
@@ -1,7 +1,7 @@
import { createStateV2 } from '@/ui/utilities/state/jotai/utils/createStateV2';
import { createAtomState } from '@/ui/utilities/state/jotai/utils/createAtomState';
export const workflowAiAgentPermissionsIsAddingPermissionStateV2 =
createStateV2<boolean>({
createAtomState<boolean>({
key: 'workflowAiAgentPermissionsIsAddingPermissionStateV2',
defaultValue: false,
});
@@ -1,8 +1,7 @@
import { createStateV2 } from '@/ui/utilities/state/jotai/utils/createStateV2';
import { createAtomState } from '@/ui/utilities/state/jotai/utils/createAtomState';
export const workflowAiAgentPermissionsSelectedObjectIdStateV2 = createStateV2<
string | undefined
>({
key: 'workflowAiAgentPermissionsSelectedObjectIdStateV2',
defaultValue: undefined,
});
export const workflowAiAgentPermissionsSelectedObjectIdStateV2 =
createAtomState<string | undefined>({
key: 'workflowAiAgentPermissionsSelectedObjectIdStateV2',
defaultValue: undefined,
});
@@ -17,13 +17,13 @@ import { TabList } from '@/ui/layout/tab-list/components/TabList';
import { activeTabIdComponentState } from '@/ui/layout/tab-list/states/activeTabIdComponentState';
import { useHotkeysOnFocusedElement } from '@/ui/utilities/hotkey/hooks/useHotkeysOnFocusedElement';
import { useListenClickOutside } from '@/ui/utilities/pointer-event/hooks/useListenClickOutside';
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentValueV2';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { WorkflowStepBody } from '@/workflow/workflow-steps/components/WorkflowStepBody';
import { WorkflowCodeEditor } from '@/workflow/workflow-steps/workflow-actions/code-action/components/WorkflowCodeEditor';
import { WorkflowEditActionCodeFields } from '@/workflow/workflow-steps/workflow-actions/code-action/components/WorkflowEditActionCodeFields';
import { WORKFLOW_LOGIC_FUNCTION_TAB_LIST_COMPONENT_ID } from '@/workflow/workflow-steps/workflow-actions/code-action/constants/WorkflowLogicFunctionTabListComponentId';
import { useFamilyRecoilValueV2 } from '@/ui/utilities/state/jotai/hooks/useFamilyRecoilValueV2';
import { useSetFamilyRecoilStateV2 } from '@/ui/utilities/state/jotai/hooks/useSetFamilyRecoilStateV2';
import { useAtomFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilyStateValue';
import { useSetAtomFamilyState } from '@/ui/utilities/state/jotai/hooks/useSetAtomFamilyState';
import { logicFunctionTestDataFamilyState } from '@/workflow/workflow-steps/workflow-actions/code-action/states/logicFunctionTestDataFamilyState';
import { WorkflowLogicFunctionTabId } from '@/workflow/workflow-steps/workflow-actions/code-action/types/WorkflowLogicFunctionTabId';
import { getWrongExportedFunctionMarkers } from '@/workflow/workflow-steps/workflow-actions/code-action/utils/getWrongExportedFunctionMarkers';
@@ -95,14 +95,14 @@ export const WorkflowEditActionCode = ({
const isMobile = useIsMobile();
const logicFunctionId = action.settings.input.logicFunctionId;
const fullScreenFocusId = `code-editor-fullscreen-${logicFunctionId}`;
const activeTabId = useRecoilComponentValueV2(
const activeTabId = useAtomComponentStateValue(
activeTabIdComponentState,
WORKFLOW_LOGIC_FUNCTION_TAB_LIST_COMPONENT_ID,
);
const { getUpdatableWorkflowVersion } =
useGetUpdatableWorkflowVersionOrThrow();
const workflowVisualizerWorkflowId = useRecoilComponentValueV2(
const workflowVisualizerWorkflowId = useAtomComponentStateValue(
workflowVisualizerWorkflowIdComponentState,
);
const workflow = useWorkflowWithCurrentVersion(workflowVisualizerWorkflowId);
@@ -128,11 +128,11 @@ export const WorkflowEditActionCode = ({
id: logicFunctionId,
});
const logicFunctionTestData = useFamilyRecoilValueV2(
const logicFunctionTestData = useAtomFamilyStateValue(
logicFunctionTestDataFamilyState,
logicFunctionId,
);
const setLogicFunctionTestData = useSetFamilyRecoilStateV2(
const setLogicFunctionTestData = useSetAtomFamilyState(
logicFunctionTestDataFamilyState,
logicFunctionId,
);
@@ -1,4 +1,4 @@
import { createFamilyStateV2 } from '@/ui/utilities/state/jotai/utils/createFamilyStateV2';
import { createAtomFamilyState } from '@/ui/utilities/state/jotai/utils/createAtomFamilyState';
import { LogicFunctionExecutionStatus } from '~/generated-metadata/graphql';
export type LogicFunctionTestData = {
@@ -21,7 +21,7 @@ export const DEFAULT_OUTPUT_VALUE = {
status: LogicFunctionExecutionStatus.IDLE,
};
export const logicFunctionTestDataFamilyState = createFamilyStateV2<
export const logicFunctionTestDataFamilyState = createAtomFamilyState<
LogicFunctionTestData,
string
>({
@@ -17,7 +17,7 @@ import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/GenericDropdownContentWidth';
import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentValueV2';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';
import { workflowVisualizerWorkflowIdComponentState } from '@/workflow/states/workflowVisualizerWorkflowIdComponentState';
import { WorkflowStepBody } from '@/workflow/workflow-steps/components/WorkflowStepBody';
@@ -26,7 +26,7 @@ import { useEmailForm } from '@/workflow/workflow-steps/workflow-actions/hooks/u
import { WorkflowVariablePicker } from '@/workflow/workflow-variables/components/WorkflowVariablePicker';
import { useTheme } from '@emotion/react';
import { t } from '@lingui/core/macro';
import { useRecoilValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilValueV2';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { useEffect, useState } from 'react';
import { ConnectedAccountProvider, SettingsPath } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
@@ -57,12 +57,12 @@ export const WorkflowEditActionEmailBase = ({
actionOptions,
}: WorkflowEditActionEmailBaseProps) => {
const theme = useTheme();
const currentWorkspaceMember = useRecoilValueV2(currentWorkspaceMemberState);
const currentWorkspaceMember = useAtomStateValue(currentWorkspaceMemberState);
const { triggerApisOAuth } = useTriggerApisOAuth();
const { enqueueErrorSnackBar } = useSnackBar();
const { uploadAttachmentFile } = useUploadAttachmentFile();
const workflowVisualizerWorkflowId = useRecoilComponentValueV2(
const workflowVisualizerWorkflowId = useAtomComponentStateValue(
workflowVisualizerWorkflowIdComponentState,
);
@@ -1,5 +1,5 @@
import { InputLabel } from '@/ui/input/components/InputLabel';
import { useRecoilComponentSelectorValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentSelectorValueV2';
import { useAtomComponentSelectorValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentSelectorValue';
import { type WorkflowFilterAction } from '@/workflow/types/Workflow';
import { WorkflowStepBody } from '@/workflow/workflow-steps/components/WorkflowStepBody';
import { WorkflowStepFilterAddFilterRuleSelect } from '@/workflow/workflow-steps/filters/components/WorkflowStepFilterAddFilterRuleSelect';
@@ -49,7 +49,7 @@ export const WorkflowEditActionFilterBody = ({
action,
actionOptions,
}: WorkflowEditActionFilterBodyProps) => {
const rootStepFilterGroup = useRecoilComponentSelectorValueV2(
const rootStepFilterGroup = useAtomComponentSelectorValue(
rootLevelStepFilterGroupComponentSelector,
);
@@ -3,7 +3,7 @@ import { type ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataI
import { AdvancedFilterCommandMenuContainer } from '@/object-record/advanced-filter/command-menu/components/AdvancedFilterCommandMenuContainer';
import { currentRecordFilterGroupsComponentState } from '@/object-record/record-filter-group/states/currentRecordFilterGroupsComponentState';
import { currentRecordFiltersComponentState } from '@/object-record/record-filter/states/currentRecordFiltersComponentState';
import { useRecoilComponentStateCallbackStateV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentStateCallbackStateV2';
import { useAtomComponentStateCallbackState } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateCallbackState';
import { type FindRecordsActionFilter } from '@/workflow/workflow-steps/workflow-actions/find-records-action/components/WorkflowEditActionFindRecords';
import { WorkflowVariablePicker } from '@/workflow/workflow-variables/components/WorkflowVariablePicker';
@@ -20,11 +20,11 @@ export const WorkflowFindRecordsFilters = ({
onChange: (filter: FindRecordsActionFilter) => void;
readonly?: boolean;
}) => {
const currentRecordFilterGroups = useRecoilComponentStateCallbackStateV2(
const currentRecordFilterGroups = useAtomComponentStateCallbackState(
currentRecordFilterGroupsComponentState,
);
const currentRecordFilters = useRecoilComponentStateCallbackStateV2(
const currentRecordFilters = useAtomComponentStateCallbackState(
currentRecordFiltersComponentState,
);
@@ -1,8 +1,8 @@
import { useSetAdvancedFilterDropdownStates } from '@/object-record/advanced-filter/hooks/useSetAdvancedFilterDropdownAllRowsStates';
import { currentRecordFilterGroupsComponentState } from '@/object-record/record-filter-group/states/currentRecordFilterGroupsComponentState';
import { currentRecordFiltersComponentState } from '@/object-record/record-filter/states/currentRecordFiltersComponentState';
import { useRecoilComponentFamilyStateV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentFamilyStateV2';
import { useSetRecoilComponentStateV2 } from '@/ui/utilities/state/jotai/hooks/useSetRecoilComponentStateV2';
import { useAtomComponentFamilyState } from '@/ui/utilities/state/jotai/hooks/useAtomComponentFamilyState';
import { useSetAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useSetAtomComponentState';
import { hasInitializedCurrentRecordFilterGroupsComponentFamilyState } from '@/views/states/hasInitializedCurrentRecordFilterGroupsComponentFamilyState';
import { hasInitializedCurrentRecordFiltersComponentFamilyState } from '@/views/states/hasInitializedCurrentRecordFiltersComponentFamilyState';
import { type FindRecordsActionFilter } from '@/workflow/workflow-steps/workflow-actions/find-records-action/components/WorkflowEditActionFindRecords';
@@ -17,7 +17,7 @@ export const WorkflowFindRecordsFiltersEffect = ({
const [
hasInitializedCurrentRecordFilters,
setHasInitializedCurrentRecordFilters,
] = useRecoilComponentFamilyStateV2(
] = useAtomComponentFamilyState(
hasInitializedCurrentRecordFiltersComponentFamilyState,
{},
);
@@ -25,16 +25,16 @@ export const WorkflowFindRecordsFiltersEffect = ({
const [
hasInitializedCurrentRecordFilterGroups,
setHasInitializedCurrentRecordFilterGroups,
] = useRecoilComponentFamilyStateV2(
] = useAtomComponentFamilyState(
hasInitializedCurrentRecordFilterGroupsComponentFamilyState,
{},
);
const setCurrentRecordFilters = useSetRecoilComponentStateV2(
const setCurrentRecordFilters = useSetAtomComponentState(
currentRecordFiltersComponentState,
);
const setCurrentRecordFilterGroups = useSetRecoilComponentStateV2(
const setCurrentRecordFilterGroups = useSetAtomComponentState(
currentRecordFilterGroupsComponentState,
);
@@ -3,8 +3,8 @@ import { FormTextFieldInput } from '@/object-record/record-field/ui/form-types/c
import { type WorkflowStep } from '@/workflow/types/Workflow';
import { getWorkflowVariablesUsedInStep } from '@/workflow/workflow-steps/utils/getWorkflowVariablesUsedInStep';
import { type HttpRequestFormData } from '@/workflow/workflow-steps/workflow-actions/http-request-action/constants/HttpRequest';
import { useFamilyRecoilValueV2 } from '@/ui/utilities/state/jotai/hooks/useFamilyRecoilValueV2';
import { useSetFamilyRecoilStateV2 } from '@/ui/utilities/state/jotai/hooks/useSetFamilyRecoilStateV2';
import { useAtomFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilyStateValue';
import { useSetAtomFamilyState } from '@/ui/utilities/state/jotai/hooks/useSetAtomFamilyState';
import { httpRequestTestDataFamilyState } from '@/workflow/workflow-steps/workflow-actions/http-request-action/states/httpRequestTestDataFamilyState';
import { t } from '@lingui/core/macro';
import styled from '@emotion/styled';
@@ -26,11 +26,11 @@ export const HttpRequestTestVariableInput = ({
actionId,
readonly,
}: HttpRequestTestVariableInputProps) => {
const httpRequestTestData = useFamilyRecoilValueV2(
const httpRequestTestData = useAtomFamilyStateValue(
httpRequestTestDataFamilyState,
actionId,
);
const setHttpRequestTestData = useSetFamilyRecoilStateV2(
const setHttpRequestTestData = useSetAtomFamilyState(
httpRequestTestDataFamilyState,
actionId,
);
@@ -8,7 +8,7 @@ import { CmdEnterActionButton } from '@/action-menu/components/CmdEnterActionBut
import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/GenericDropdownContentWidth';
import { TabList } from '@/ui/layout/tab-list/components/TabList';
import { activeTabIdComponentState } from '@/ui/layout/tab-list/states/activeTabIdComponentState';
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentValueV2';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { WorkflowStepFooter } from '@/workflow/workflow-steps/components/WorkflowStepFooter';
import { getBodyTypeFromHeaders } from '@/workflow/workflow-steps/workflow-actions/http-request-action/utils/getBodyTypeFromHeaders';
import { isMethodWithBody } from '@/workflow/workflow-steps/workflow-actions/http-request-action/utils/isMethodWithBody';
@@ -90,7 +90,7 @@ export const WorkflowEditActionHttpRequest = ({
}: WorkflowEditActionHttpRequestProps) => {
const { t } = useLingui();
const theme = useTheme();
const activeTabId = useRecoilComponentValueV2(
const activeTabId = useAtomComponentStateValue(
activeTabIdComponentState,
WORKFLOW_HTTP_REQUEST_TAB_LIST_COMPONENT_ID,
);
@@ -4,8 +4,8 @@ import {
type HttpRequestFormData,
} from '@/workflow/workflow-steps/workflow-actions/http-request-action/constants/HttpRequest';
import { TEST_HTTP_REQUEST } from '@/workflow/workflow-steps/workflow-actions/http-request-action/graphql/mutations/testHttpRequest';
import { useFamilyRecoilValueV2 } from '@/ui/utilities/state/jotai/hooks/useFamilyRecoilValueV2';
import { useSetFamilyRecoilStateV2 } from '@/ui/utilities/state/jotai/hooks/useSetFamilyRecoilStateV2';
import { useAtomFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilyStateValue';
import { useSetAtomFamilyState } from '@/ui/utilities/state/jotai/hooks/useSetAtomFamilyState';
import { httpRequestTestDataFamilyState } from '@/workflow/workflow-steps/workflow-actions/http-request-action/states/httpRequestTestDataFamilyState';
import { useMutation } from '@apollo/client';
import { t } from '@lingui/core/macro';
@@ -44,11 +44,11 @@ const convertFlatVariablesToNestedContext = (flatVariables: {
export const useTestHttpRequest = (actionId: string) => {
const apolloCoreClient = useApolloCoreClient();
const [isTesting, setIsTesting] = useState(false);
const httpRequestTestData = useFamilyRecoilValueV2(
const httpRequestTestData = useAtomFamilyStateValue(
httpRequestTestDataFamilyState,
actionId,
);
const setHttpRequestTestData = useSetFamilyRecoilStateV2(
const setHttpRequestTestData = useSetAtomFamilyState(
httpRequestTestDataFamilyState,
actionId,
);
@@ -1,8 +1,8 @@
import { createFamilyStateV2 } from '@/ui/utilities/state/jotai/utils/createFamilyStateV2';
import { createAtomFamilyState } from '@/ui/utilities/state/jotai/utils/createAtomFamilyState';
import { DEFAULT_HTTP_REQUEST_OUTPUT_VALUE } from '@/workflow/workflow-steps/workflow-actions/http-request-action/constants/HttpRequest';
import { type HttpRequestTestData } from '@/workflow/workflow-steps/workflow-actions/http-request-action/types/HttpRequestTestData';
export const httpRequestTestDataFamilyState = createFamilyStateV2<
export const httpRequestTestDataFamilyState = createAtomFamilyState<
HttpRequestTestData,
string
>({
@@ -1,6 +1,6 @@
import { InputLabel } from '@/ui/input/components/InputLabel';
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentValueV2';
import { useSetRecoilComponentStateV2 } from '@/ui/utilities/state/jotai/hooks/useSetRecoilComponentStateV2';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { useSetAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useSetAtomComponentState';
import { useGetUpdatableWorkflowVersionOrThrow } from '@/workflow/hooks/useGetUpdatableWorkflowVersionOrThrow';
import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';
import { workflowVisualizerWorkflowIdComponentState } from '@/workflow/states/workflowVisualizerWorkflowIdComponentState';
@@ -68,21 +68,21 @@ export const WorkflowEditActionIfElseBody = ({
const { updateWorkflowVersionPosition } = useTidyUpWorkflowVersion();
const { deleteWorkflowVersionStep } = useDeleteWorkflowVersionStep();
const { deleteStepsOutputSchema } = useStepsOutputSchema();
const workflowVisualizerWorkflowId = useRecoilComponentValueV2(
const workflowVisualizerWorkflowId = useAtomComponentStateValue(
workflowVisualizerWorkflowIdComponentState,
);
const workflow = useWorkflowWithCurrentVersion(workflowVisualizerWorkflowId);
const currentStepFilters = useRecoilComponentValueV2(
const currentStepFilters = useAtomComponentStateValue(
currentStepFiltersComponentState,
);
const currentStepFilterGroups = useRecoilComponentValueV2(
const currentStepFilterGroups = useAtomComponentStateValue(
currentStepFilterGroupsComponentState,
);
const setCurrentStepFilters = useSetRecoilComponentStateV2(
const setCurrentStepFilters = useSetAtomComponentState(
currentStepFiltersComponentState,
);
const setCurrentStepFilterGroups = useSetRecoilComponentStateV2(
const setCurrentStepFilterGroups = useSetAtomComponentState(
currentStepFilterGroupsComponentState,
);
@@ -1,5 +1,5 @@
import { workflowRunIteratorSubStepIterationIndexComponentState } from '@/command-menu/pages/workflow/step/view-run/states/workflowRunIteratorSubStepIterationIndexComponentState';
import { useRecoilComponentStateV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentStateV2';
import { useAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useAtomComponentState';
import { useFlowOrThrow } from '@/workflow/hooks/useFlowOrThrow';
import { useWorkflowRun } from '@/workflow/hooks/useWorkflowRun';
import { useWorkflowRunIdOrThrow } from '@/workflow/hooks/useWorkflowRunIdOrThrow';
@@ -37,7 +37,7 @@ export const WorkflowIteratorSubStepSwitcher = ({
const [
workflowRunIteratorSubStepIterationIndex,
setWorkflowRunIteratorSubStepIterationIndex,
] = useRecoilComponentStateV2(
] = useAtomComponentState(
workflowRunIteratorSubStepIterationIndexComponentState,
);