diff --git a/src/components/timeline/FullTimeline.tsx b/src/components/timeline/FullTimeline.tsx index 35b0c38db2..97eb3b65d3 100644 --- a/src/components/timeline/FullTimeline.tsx +++ b/src/components/timeline/FullTimeline.tsx @@ -19,7 +19,7 @@ import { getProfileTimelineUnit, getGlobalTracks, getGlobalTrackReferences, - getHiddenTrackCount, + getTrackCount, getGlobalTrackOrder, getPanelLayoutGeneration, } from 'firefox-profiler/selectors'; @@ -39,7 +39,7 @@ import type { GlobalTrack, InitialSelectedTrackReference, GlobalTrackReference, - HiddenTrackCount, + TrackCount, Milliseconds, StartEndRange, TimelineUnit, @@ -60,7 +60,7 @@ type StateProps = { readonly panelLayoutGeneration: number; readonly zeroAt: Milliseconds; readonly profileTimelineUnit: TimelineUnit; - readonly hiddenTrackCount: HiddenTrackCount; + readonly trackCount: TrackCount; }; type DispatchProps = { @@ -75,7 +75,7 @@ type State = { }; class TimelineSettingsHiddenTracks extends React.PureComponent<{ - readonly hiddenTrackCount: HiddenTrackCount; + readonly trackCount: TrackCount; readonly changeRightClickedTrack: typeof changeRightClickedTrack; }> { _showMenu = (event: React.MouseEvent) => { @@ -90,7 +90,7 @@ class TimelineSettingsHiddenTracks extends React.PureComponent<{ }; override render() { - const { hiddenTrackCount } = this.props; + const { trackCount } = this.props; return ( , }} vars={{ - visibleTrackCount: hiddenTrackCount.total - hiddenTrackCount.hidden, - totalTrackCount: hiddenTrackCount.total, + visibleTrackCount: trackCount.total - trackCount.hidden, + totalTrackCount: trackCount.total, }} > @@ -146,7 +146,7 @@ class FullTimelineImpl extends React.PureComponent { width, globalTrackReferences, panelLayoutGeneration, - hiddenTrackCount, + trackCount, changeRightClickedTrack, innerElementRef, } = this.props; @@ -155,9 +155,9 @@ class FullTimelineImpl extends React.PureComponent { <>
- {hiddenTrackCount.total > 1 ? ( + {trackCount.total > 1 ? ( ) : ( @@ -196,7 +196,7 @@ class FullTimelineImpl extends React.PureComponent { - {hiddenTrackCount.total > 1 ? : null} + {trackCount.total > 1 ? : null} ); } @@ -215,7 +215,7 @@ export const FullTimeline = explicitConnect< zeroAt: getZeroAt(state), profileTimelineUnit: getProfileTimelineUnit(state), panelLayoutGeneration: getPanelLayoutGeneration(state), - hiddenTrackCount: getHiddenTrackCount(state), + trackCount: getTrackCount(state), }), mapDispatchToProps: { changeGlobalTrackOrder, diff --git a/src/selectors/profile.ts b/src/selectors/profile.ts index 38d2e68e9e..a0fa0b175d 100644 --- a/src/selectors/profile.ts +++ b/src/selectors/profile.ts @@ -56,7 +56,7 @@ import type { TrackReference, LastNonShiftClickInformation, PreviewSelection, - HiddenTrackCount, + TrackCount, Selector, DangerousSelectorWithArguments, State, @@ -609,7 +609,7 @@ export const getLocalTrackName = ( * then all its children are as well. This function walks all of the data to determine * the correct hidden counts. */ -export const getHiddenTrackCount: Selector = createSelector( +export const getTrackCount: Selector = createSelector( getGlobalTracks, getLocalTracksByPid, UrlState.getHiddenLocalTracksByPid, diff --git a/src/test/store/tracks.test.ts b/src/test/store/tracks.test.ts index 8a664ef478..4a128f35be 100644 --- a/src/test/store/tracks.test.ts +++ b/src/test/store/tracks.test.ts @@ -624,7 +624,7 @@ describe('ordering and hiding', function () { it('can count hidden local tracks', function () { const { getState, dispatch, workerTrackIndex, tabPid } = init(); dispatch(hideLocalTrack(tabPid, workerTrackIndex)); - expect(ProfileViewSelectors.getHiddenTrackCount(getState())).toEqual({ + expect(ProfileViewSelectors.getTrackCount(getState())).toEqual({ hidden: 1, total: 4, }); @@ -633,7 +633,7 @@ describe('ordering and hiding', function () { it('can count hidden global tracks and their hidden local tracks', function () { const { getState, dispatch, tabTrackIndex } = init(); dispatch(hideGlobalTrack(tabTrackIndex)); - expect(ProfileViewSelectors.getHiddenTrackCount(getState())).toEqual({ + expect(ProfileViewSelectors.getTrackCount(getState())).toEqual({ hidden: 3, total: 4, }); diff --git a/src/types/actions.ts b/src/types/actions.ts index cf2465ee78..940b018500 100644 --- a/src/types/actions.ts +++ b/src/types/actions.ts @@ -95,7 +95,7 @@ export type PreviewSelection = { /** * The counts for how many tracks are hidden in the timeline. */ -export type HiddenTrackCount = { +export type TrackCount = { readonly hidden: number; readonly total: number; };