From 5ab7a710ed0dec07ca507c50b4a8256518f815e3 Mon Sep 17 00:00:00 2001 From: Yousif Yassi Date: Thu, 23 Oct 2025 10:47:06 -0400 Subject: [PATCH 1/3] fix: FIT-851: The Assign Annotators/ Reviewers modal does NOT always open from Task Actions --- web/libs/datamanager/src/stores/AppStore.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/libs/datamanager/src/stores/AppStore.js b/web/libs/datamanager/src/stores/AppStore.js index 5f6c92ba2dcb..aebe6918e3b0 100644 --- a/web/libs/datamanager/src/stores/AppStore.js +++ b/web/libs/datamanager/src/stores/AppStore.js @@ -751,7 +751,7 @@ export const AppStore = types } if (actionCallback instanceof Function) { - const result = yield actionCallback(actionParams, view); + const result = actionCallback(actionParams, view); self.SDK.invoke("actionDialogOkComplete", actionId, { result, view: viewReloaded, From d0a1b1cecf554c7177b2540e32696416a152aea0 Mon Sep 17 00:00:00 2001 From: Yousif Yassi Date: Fri, 24 Oct 2025 15:53:19 -0400 Subject: [PATCH 2/3] removed memoize and unneded call to actions --- .../components/DataManager/Toolbar/ActionsButton.jsx | 12 ++++++------ web/libs/datamanager/src/stores/AppStore.js | 5 ----- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/web/libs/datamanager/src/components/DataManager/Toolbar/ActionsButton.jsx b/web/libs/datamanager/src/components/DataManager/Toolbar/ActionsButton.jsx index 38985c22eb8c..759da72412db 100644 --- a/web/libs/datamanager/src/components/DataManager/Toolbar/ActionsButton.jsx +++ b/web/libs/datamanager/src/components/DataManager/Toolbar/ActionsButton.jsx @@ -1,7 +1,7 @@ import { IconChevronDown, IconChevronRight, IconTrash } from "@humansignal/icons"; import { Button, Spinner, Tooltip } from "@humansignal/ui"; import { inject, observer } from "mobx-react"; -import { useCallback, useEffect, useMemo, useRef, useState } from "react"; +import { useCallback, useEffect, useRef, useState } from "react"; import { Block, Elem } from "../../../utils/bem"; import { FF_LOPS_E_3, isFF } from "../../../utils/feature-flags"; import { Dropdown } from "../../Common/Dropdown/DropdownComponent"; @@ -205,19 +205,19 @@ export const ActionsButton = injector( const selectedCount = store.currentView.selectedCount; const [isOpen, setIsOpen] = useState(false); const [isLoading, setIsLoading] = useState(false); + const fetchedActionsRef = useRef(false); - const actions = useMemo(() => { - return store.availableActions.filter((a) => !a.hidden).sort((a, b) => a.order - b.order); - }, [store.availableActions]); + const actions = store.availableActions.filter((a) => !a.hidden).sort((a, b) => a.order - b.order); useEffect(() => { - if (isOpen && actions.length === 0) { + if (isOpen && !fetchedActionsRef.current) { setIsLoading(true); store.fetchActions().finally(() => { setIsLoading(false); }); + fetchedActionsRef.current = true; } - }, [isOpen, actions, store]); + }, [isOpen, store]); const actionButtons = actions.map((action) => ( diff --git a/web/libs/datamanager/src/stores/AppStore.js b/web/libs/datamanager/src/stores/AppStore.js index aebe6918e3b0..a49ed1a60bd6 100644 --- a/web/libs/datamanager/src/stores/AppStore.js +++ b/web/libs/datamanager/src/stores/AppStore.js @@ -583,11 +583,6 @@ export const AppStore = types } if (!isLabelStream || (self.project?.show_annotation_history && task)) { - if (self.SDK.type === "dm") { - // Fetch actions in background to avoid blocking the main thread - setTimeout(() => self.fetchActions(), 0); - } - if (self.SDK.settings?.onlyVirtualTabs && self.project?.show_annotation_history && !task) { requests.push( self.viewsStore.addView( From b5a4baf075574451735edaa6724037c38c04bc3a Mon Sep 17 00:00:00 2001 From: Yousif Yassi Date: Fri, 24 Oct 2025 15:56:56 -0400 Subject: [PATCH 3/3] added test id --- .../components/DataManager/Toolbar/ActionsButton.jsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/web/libs/datamanager/src/components/DataManager/Toolbar/ActionsButton.jsx b/web/libs/datamanager/src/components/DataManager/Toolbar/ActionsButton.jsx index 759da72412db..9fee5753f349 100644 --- a/web/libs/datamanager/src/components/DataManager/Toolbar/ActionsButton.jsx +++ b/web/libs/datamanager/src/components/DataManager/Toolbar/ActionsButton.jsx @@ -227,7 +227,15 @@ export const ActionsButton = injector( return ( {isLoading ? Loading actions... : actionButtons} + + {isLoading ? ( + + Loading actions... + + ) : ( + actionButtons + )} + } openUpwardForShortViewport={false} disabled={!hasSelected}