File tree Expand file tree Collapse file tree 4 files changed +12
-5
lines changed
frontend/javascripts/viewer
right-border-tabs/trees_tab Expand file tree Collapse file tree 4 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ type SetTreeVisibilityAction = ReturnType<typeof setTreeVisibilityAction>;
2727type SetExpandedTreeGroupsByKeysAction = ReturnType < typeof setExpandedTreeGroupsByKeysAction > ;
2828type SetExpandedTreeGroupsByIdsAction = ReturnType < typeof setExpandedTreeGroupsByIdsAction > ;
2929type ExpandParentGroupsOfTreeAction = ReturnType < typeof expandParentGroupsOfTreeAction > ;
30+ type FocusTreeAction = ReturnType < typeof focusTreeAction > ;
3031type ToggleAllTreesAction = ReturnType < typeof toggleAllTreesAction > ;
3132type ToggleInactiveTreesAction = ReturnType < typeof toggleInactiveTreesAction > ;
3233type ToggleTreeGroupAction = ReturnType < typeof toggleTreeGroupAction > ;
@@ -119,6 +120,7 @@ export type SkeletonTracingAction =
119120 | SetExpandedTreeGroupsByKeysAction
120121 | SetExpandedTreeGroupsByIdsAction
121122 | ExpandParentGroupsOfTreeAction
123+ | FocusTreeAction
122124 | ToggleInactiveTreesAction
123125 | ToggleTreeGroupAction
124126 | NoAction
@@ -401,6 +403,13 @@ export const expandParentGroupsOfTreeAction = (tree: Tree) =>
401403 tree,
402404 } ) as const ;
403405
406+ export const focusTreeAction = ( tree : Tree ) => {
407+ return {
408+ type : "FOCUS_TREE" ,
409+ tree,
410+ } as const ;
411+ } ;
412+
404413export const setTreeVisibilityAction = ( treeId : number | null | undefined , isVisible : boolean ) =>
405414 ( {
406415 type : "SET_TREE_VISIBILITY" ,
Original file line number Diff line number Diff line change @@ -558,7 +558,6 @@ function SkeletonTracingReducer(
558558 }
559559
560560 case "EXPAND_PARENT_GROUPS_OF_TREE" : {
561- console . log ( "Expanding parent groups of tree in reducer" ) ;
562561 const { tree } = action ;
563562 if ( tree . groupId == null || skeletonTracing == null ) {
564563 return state ;
Original file line number Diff line number Diff line change @@ -110,6 +110,7 @@ import {
110110 deleteBranchpointByIdAction ,
111111 deleteEdgeAction ,
112112 expandParentGroupsOfTreeAction ,
113+ focusTreeAction ,
113114 mergeTreesAction ,
114115 setActiveNodeAction ,
115116 setTreeVisibilityAction ,
@@ -624,6 +625,7 @@ function getNodeContextMenuOptions({
624625 key : "focus-tree" ,
625626 onClick : ( ) => {
626627 Store . dispatch ( expandParentGroupsOfTreeAction ( clickedTree ) ) ;
628+ Store . dispatch ( focusTreeAction ( clickedTree ) ) ;
627629 } ,
628630 label : "Focus Tree in Skeleton Tab" ,
629631 }
Original file line number Diff line number Diff line change @@ -297,10 +297,7 @@ function TreeHierarchyView(props: Props) {
297297 // This is necessary outside of the useEffect hooks because a longer delay is needed to ensure the active tree has been rendered.
298298 setTimeout ( scrollToActiveTree , 900 ) ;
299299
300- useReduxActionListener ( "EXPAND_PARENT_GROUPS_OF_TREE" , ( ) => {
301- console . log ( "EXPAND_PARENT_GROUPS_OF_TREE action received, scrolling to active tree" ) ;
302- scrollToActiveTree ( ) ;
303- } ) ;
300+ useReduxActionListener ( "FOCUS_TREE" , scrollToActiveTree ) ;
304301
305302 return (
306303 < >
You can’t perform that action at this time.
0 commit comments