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>;
27
27
type SetExpandedTreeGroupsByKeysAction = ReturnType < typeof setExpandedTreeGroupsByKeysAction > ;
28
28
type SetExpandedTreeGroupsByIdsAction = ReturnType < typeof setExpandedTreeGroupsByIdsAction > ;
29
29
type ExpandParentGroupsOfTreeAction = ReturnType < typeof expandParentGroupsOfTreeAction > ;
30
+ type FocusTreeAction = ReturnType < typeof focusTreeAction > ;
30
31
type ToggleAllTreesAction = ReturnType < typeof toggleAllTreesAction > ;
31
32
type ToggleInactiveTreesAction = ReturnType < typeof toggleInactiveTreesAction > ;
32
33
type ToggleTreeGroupAction = ReturnType < typeof toggleTreeGroupAction > ;
@@ -119,6 +120,7 @@ export type SkeletonTracingAction =
119
120
| SetExpandedTreeGroupsByKeysAction
120
121
| SetExpandedTreeGroupsByIdsAction
121
122
| ExpandParentGroupsOfTreeAction
123
+ | FocusTreeAction
122
124
| ToggleInactiveTreesAction
123
125
| ToggleTreeGroupAction
124
126
| NoAction
@@ -401,6 +403,13 @@ export const expandParentGroupsOfTreeAction = (tree: Tree) =>
401
403
tree,
402
404
} ) as const ;
403
405
406
+ export const focusTreeAction = ( tree : Tree ) => {
407
+ return {
408
+ type : "FOCUS_TREE" ,
409
+ tree,
410
+ } as const ;
411
+ } ;
412
+
404
413
export const setTreeVisibilityAction = ( treeId : number | null | undefined , isVisible : boolean ) =>
405
414
( {
406
415
type : "SET_TREE_VISIBILITY" ,
Original file line number Diff line number Diff line change @@ -558,7 +558,6 @@ function SkeletonTracingReducer(
558
558
}
559
559
560
560
case "EXPAND_PARENT_GROUPS_OF_TREE" : {
561
- console . log ( "Expanding parent groups of tree in reducer" ) ;
562
561
const { tree } = action ;
563
562
if ( tree . groupId == null || skeletonTracing == null ) {
564
563
return state ;
Original file line number Diff line number Diff line change @@ -110,6 +110,7 @@ import {
110
110
deleteBranchpointByIdAction ,
111
111
deleteEdgeAction ,
112
112
expandParentGroupsOfTreeAction ,
113
+ focusTreeAction ,
113
114
mergeTreesAction ,
114
115
setActiveNodeAction ,
115
116
setTreeVisibilityAction ,
@@ -624,6 +625,7 @@ function getNodeContextMenuOptions({
624
625
key : "focus-tree" ,
625
626
onClick : ( ) => {
626
627
Store . dispatch ( expandParentGroupsOfTreeAction ( clickedTree ) ) ;
628
+ Store . dispatch ( focusTreeAction ( clickedTree ) ) ;
627
629
} ,
628
630
label : "Focus Tree in Skeleton Tab" ,
629
631
}
Original file line number Diff line number Diff line change @@ -297,10 +297,7 @@ function TreeHierarchyView(props: Props) {
297
297
// This is necessary outside of the useEffect hooks because a longer delay is needed to ensure the active tree has been rendered.
298
298
setTimeout ( scrollToActiveTree , 900 ) ;
299
299
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 ) ;
304
301
305
302
return (
306
303
< >
You can’t perform that action at this time.
0 commit comments