@@ -321,44 +321,6 @@ class WingTreeViewImpl extends PureComponent<Props> {
321321 }
322322}
323323
324- // Build the StateProps for a given wing. Both wings have the same prop
325- // shape; only the wing-specific selector identifiers differ.
326- function makeMapStateToProps (
327- getView : ( state : State ) => WingViewType ,
328- selectors : {
329- getCallTree : ( state : State ) => CallTreeType ;
330- getCallNodeInfo : ( state : State ) => CallNodeInfo ;
331- getSelectedCallNodeIndex : ( state : State ) => IndexIntoCallNodeTable | null ;
332- getRightClickedCallNodeIndex : (
333- state : State
334- ) => IndexIntoCallNodeTable | null ;
335- getExpandedCallNodeIndexes : (
336- state : State
337- ) => Array < IndexIntoCallNodeTable | null > ;
338- }
339- ) {
340- return ( state : State ) : StateProps => ( {
341- threadsKey : getSelectedThreadsKey ( state ) ,
342- scrollToSelectionGeneration : getScrollToSelectionGeneration ( state ) ,
343- tree : selectors . getCallTree ( state ) ,
344- callNodeInfo : selectors . getCallNodeInfo ( state ) ,
345- categories : getCategories ( state ) ,
346- selectedCallNodeIndex : selectors . getSelectedCallNodeIndex ( state ) ,
347- rightClickedCallNodeIndex : selectors . getRightClickedCallNodeIndex ( state ) ,
348- expandedCallNodeIndexes : selectors . getExpandedCallNodeIndexes ( state ) ,
349- searchStringsRegExp : getSearchStringsAsRegExp ( state ) ,
350- disableOverscan : getPreviewSelectionIsBeingModified ( state ) ,
351- // Use the filtered call node max depth, rather than the preview filtered
352- // call node max depth so that the width of the TreeView component is stable
353- // across preview selections.
354- callNodeMaxDepthPlusOne :
355- selectedThreadSelectors . getFilteredCallNodeMaxDepthPlusOne ( state ) ,
356- weightType : selectedThreadSelectors . getWeightTypeForCallTree ( state ) ,
357- tableViewOptions : getCurrentTableViewOptions ( state ) ,
358- view : getView ( state ) ,
359- } ) ;
360- }
361-
362324function makeMapDispatchToProps ( wing : WingName ) {
363325 return {
364326 changeSelectedCallNode : (
@@ -415,30 +377,53 @@ function LowerWingComponent(
415377}
416378
417379export const UpperWing = explicitConnect < { } , StateProps , DispatchProps > ( {
418- mapStateToProps : makeMapStateToProps ( getUpperWingView , {
419- getCallTree : selectedThreadSelectors . getUpperWingCallTree ,
420- getCallNodeInfo : selectedThreadSelectors . getUpperWingCallNodeInfo ,
421- getSelectedCallNodeIndex :
422- selectedThreadSelectors . getUpperWingSelectedCallNodeIndex ,
423- getRightClickedCallNodeIndex :
424- selectedThreadSelectors . getUpperWingRightClickedCallNodeIndex ,
425- getExpandedCallNodeIndexes :
426- selectedThreadSelectors . getUpperWingExpandedCallNodeIndexes ,
380+ mapStateToProps : ( state : State ) : StateProps => ( {
381+ threadsKey : getSelectedThreadsKey ( state ) ,
382+ scrollToSelectionGeneration : getScrollToSelectionGeneration ( state ) ,
383+ tree : selectedThreadSelectors . getUpperWingCallTree ( state ) ,
384+ callNodeInfo : selectedThreadSelectors . getUpperWingCallNodeInfo ( state ) ,
385+ categories : getCategories ( state ) ,
386+ selectedCallNodeIndex :
387+ selectedThreadSelectors . getUpperWingSelectedCallNodeIndex ( state ) ,
388+ rightClickedCallNodeIndex :
389+ selectedThreadSelectors . getUpperWingRightClickedCallNodeIndex ( state ) ,
390+ expandedCallNodeIndexes :
391+ selectedThreadSelectors . getUpperWingExpandedCallNodeIndexes ( state ) ,
392+ searchStringsRegExp : getSearchStringsAsRegExp ( state ) ,
393+ disableOverscan : getPreviewSelectionIsBeingModified ( state ) ,
394+ // Use the filtered call node max depth, rather than the preview filtered
395+ // call node max depth so that the width of the TreeView component is stable
396+ // across preview selections.
397+ callNodeMaxDepthPlusOne :
398+ selectedThreadSelectors . getFilteredCallNodeMaxDepthPlusOne ( state ) ,
399+ weightType : selectedThreadSelectors . getWeightTypeForCallTree ( state ) ,
400+ tableViewOptions : getCurrentTableViewOptions ( state ) ,
401+ view : getUpperWingView ( state ) ,
427402 } ) ,
428403 mapDispatchToProps : makeMapDispatchToProps ( 'upper' ) ,
429404 component : UpperWingComponent ,
430405} ) ;
431406
432407export const LowerWing = explicitConnect < { } , StateProps , DispatchProps > ( {
433- mapStateToProps : makeMapStateToProps ( getLowerWingView , {
434- getCallTree : selectedThreadSelectors . getLowerWingCallTree ,
435- getCallNodeInfo : selectedThreadSelectors . getLowerWingCallNodeInfo ,
436- getSelectedCallNodeIndex :
437- selectedThreadSelectors . getLowerWingSelectedCallNodeIndex ,
438- getRightClickedCallNodeIndex :
439- selectedThreadSelectors . getLowerWingRightClickedCallNodeIndex ,
440- getExpandedCallNodeIndexes :
441- selectedThreadSelectors . getLowerWingExpandedCallNodeIndexes ,
408+ mapStateToProps : ( state : State ) : StateProps => ( {
409+ threadsKey : getSelectedThreadsKey ( state ) ,
410+ scrollToSelectionGeneration : getScrollToSelectionGeneration ( state ) ,
411+ tree : selectedThreadSelectors . getLowerWingCallTree ( state ) ,
412+ callNodeInfo : selectedThreadSelectors . getLowerWingCallNodeInfo ( state ) ,
413+ categories : getCategories ( state ) ,
414+ selectedCallNodeIndex :
415+ selectedThreadSelectors . getLowerWingSelectedCallNodeIndex ( state ) ,
416+ rightClickedCallNodeIndex :
417+ selectedThreadSelectors . getLowerWingRightClickedCallNodeIndex ( state ) ,
418+ expandedCallNodeIndexes :
419+ selectedThreadSelectors . getLowerWingExpandedCallNodeIndexes ( state ) ,
420+ searchStringsRegExp : getSearchStringsAsRegExp ( state ) ,
421+ disableOverscan : getPreviewSelectionIsBeingModified ( state ) ,
422+ callNodeMaxDepthPlusOne :
423+ selectedThreadSelectors . getFilteredCallNodeMaxDepthPlusOne ( state ) ,
424+ weightType : selectedThreadSelectors . getWeightTypeForCallTree ( state ) ,
425+ tableViewOptions : getCurrentTableViewOptions ( state ) ,
426+ view : getLowerWingView ( state ) ,
442427 } ) ,
443428 mapDispatchToProps : makeMapDispatchToProps ( 'lower' ) ,
444429 component : LowerWingComponent ,
0 commit comments