@@ -13,6 +13,7 @@ import { PARAMS_LOADED } from '../utils/config-params';
1313import {
1414 closeStudy ,
1515 loadNetworkModificationTreeSuccess ,
16+ networkModificationTreeNodesUpdated ,
1617 openStudy ,
1718 resetEquipmentsPostComputation ,
1819 setCurrentRootNetworkUuid ,
@@ -37,7 +38,7 @@ import NetworkModificationTreeModel from './graph/network-modification-tree-mode
3738import { getFirstNodeOfType } from './graph/util/model-functions' ;
3839import { BUILD_STATUS } from './network/constants' ;
3940import { useAllComputingStatus } from './computing-status/use-all-computing-status' ;
40- import { fetchNetworkModificationTree } from '../services/study/tree-subtree' ;
41+ import { fetchNetworkModificationTree , fetchNetworkModificationTreeNode } from '../services/study/tree-subtree' ;
4142import { fetchNetworkExistence , fetchRootNetworkIndexationStatus } from '../services/study/network' ;
4243import { fetchStudy , recreateStudyNetwork , reindexAllRootNetwork } from 'services/study/study' ;
4344
@@ -271,9 +272,26 @@ export function StudyContainer() {
271272 }
272273 displayErrorNotifications ( eventData ) ;
273274 dispatch ( studyUpdated ( eventData ) ) ;
275+
276+ // Handle build status updates globally so all workspaces open in other browser tabs update currentTreeNode
277+ // This fixes the issue where tabs without tree panel don't get updates
278+ if (
279+ updateTypeHeader === NotificationType . NODE_BUILD_STATUS_UPDATED &&
280+ eventData . headers . rootNetworkUuid === currentRootNetworkUuidRef . current
281+ ) {
282+ // Fetch updated nodes and dispatch to Redux to sync currentTreeNode
283+ const updatedNodeIds = eventData . headers . nodes ;
284+ Promise . all (
285+ updatedNodeIds . map ( ( nodeId ) =>
286+ fetchNetworkModificationTreeNode ( studyUuid , nodeId , currentRootNetworkUuidRef . current )
287+ )
288+ ) . then ( ( values ) => {
289+ dispatch ( networkModificationTreeNodesUpdated ( values ) ) ;
290+ } ) ;
291+ }
274292 } ,
275293 // Note: dispatch doesn't change
276- [ dispatch , displayErrorNotifications , sendAlert ]
294+ [ dispatch , displayErrorNotifications , sendAlert , studyUuid ]
277295 ) ;
278296
279297 useNotificationsListener ( NotificationsUrlKeys . STUDY , { listenerCallbackMessage : handleStudyUpdate } ) ;
0 commit comments