Skip to content

Commit 1109c11

Browse files
authored
Rename hiddenTrackCount to trackCount. (#5665)
1 parent 9f99ec8 commit 1109c11

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

src/components/timeline/FullTimeline.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
getProfileTimelineUnit,
2020
getGlobalTracks,
2121
getGlobalTrackReferences,
22-
getHiddenTrackCount,
22+
getTrackCount,
2323
getGlobalTrackOrder,
2424
getPanelLayoutGeneration,
2525
} from 'firefox-profiler/selectors';
@@ -39,7 +39,7 @@ import type {
3939
GlobalTrack,
4040
InitialSelectedTrackReference,
4141
GlobalTrackReference,
42-
HiddenTrackCount,
42+
TrackCount,
4343
Milliseconds,
4444
StartEndRange,
4545
TimelineUnit,
@@ -60,7 +60,7 @@ type StateProps = {
6060
readonly panelLayoutGeneration: number;
6161
readonly zeroAt: Milliseconds;
6262
readonly profileTimelineUnit: TimelineUnit;
63-
readonly hiddenTrackCount: HiddenTrackCount;
63+
readonly trackCount: TrackCount;
6464
};
6565

6666
type DispatchProps = {
@@ -75,7 +75,7 @@ type State = {
7575
};
7676

7777
class TimelineSettingsHiddenTracks extends React.PureComponent<{
78-
readonly hiddenTrackCount: HiddenTrackCount;
78+
readonly trackCount: TrackCount;
7979
readonly changeRightClickedTrack: typeof changeRightClickedTrack;
8080
}> {
8181
_showMenu = (event: React.MouseEvent<HTMLElement>) => {
@@ -90,7 +90,7 @@ class TimelineSettingsHiddenTracks extends React.PureComponent<{
9090
};
9191

9292
override render() {
93-
const { hiddenTrackCount } = this.props;
93+
const { trackCount } = this.props;
9494

9595
return (
9696
<Localized
@@ -99,8 +99,8 @@ class TimelineSettingsHiddenTracks extends React.PureComponent<{
9999
span: <span className="timelineSettingsHiddenTracksNumber" />,
100100
}}
101101
vars={{
102-
visibleTrackCount: hiddenTrackCount.total - hiddenTrackCount.hidden,
103-
totalTrackCount: hiddenTrackCount.total,
102+
visibleTrackCount: trackCount.total - trackCount.hidden,
103+
totalTrackCount: trackCount.total,
104104
}}
105105
>
106106
<button
@@ -109,11 +109,11 @@ class TimelineSettingsHiddenTracks extends React.PureComponent<{
109109
className="timelineSettingsHiddenTracks"
110110
>
111111
<span className="timelineSettingsHiddenTracksNumber">
112-
{hiddenTrackCount.total - hiddenTrackCount.hidden}
112+
{trackCount.total - trackCount.hidden}
113113
</span>
114114
{' / '}
115115
<span className="timelineSettingsHiddenTracksNumber">
116-
{hiddenTrackCount.total}{' '}
116+
{trackCount.total}{' '}
117117
</span>
118118
tracks
119119
</button>
@@ -146,7 +146,7 @@ class FullTimelineImpl extends React.PureComponent<Props, State> {
146146
width,
147147
globalTrackReferences,
148148
panelLayoutGeneration,
149-
hiddenTrackCount,
149+
trackCount,
150150
changeRightClickedTrack,
151151
innerElementRef,
152152
} = this.props;
@@ -155,9 +155,9 @@ class FullTimelineImpl extends React.PureComponent<Props, State> {
155155
<>
156156
<TimelineSelection width={width}>
157157
<div className="timelineHeader">
158-
{hiddenTrackCount.total > 1 ? (
158+
{trackCount.total > 1 ? (
159159
<TimelineSettingsHiddenTracks
160-
hiddenTrackCount={hiddenTrackCount}
160+
trackCount={trackCount}
161161
changeRightClickedTrack={changeRightClickedTrack}
162162
/>
163163
) : (
@@ -196,7 +196,7 @@ class FullTimelineImpl extends React.PureComponent<Props, State> {
196196
</Reorderable>
197197
</OverflowEdgeIndicator>
198198
</TimelineSelection>
199-
{hiddenTrackCount.total > 1 ? <TimelineTrackContextMenu /> : null}
199+
{trackCount.total > 1 ? <TimelineTrackContextMenu /> : null}
200200
</>
201201
);
202202
}
@@ -215,7 +215,7 @@ export const FullTimeline = explicitConnect<
215215
zeroAt: getZeroAt(state),
216216
profileTimelineUnit: getProfileTimelineUnit(state),
217217
panelLayoutGeneration: getPanelLayoutGeneration(state),
218-
hiddenTrackCount: getHiddenTrackCount(state),
218+
trackCount: getTrackCount(state),
219219
}),
220220
mapDispatchToProps: {
221221
changeGlobalTrackOrder,

src/selectors/profile.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ import type {
5656
TrackReference,
5757
LastNonShiftClickInformation,
5858
PreviewSelection,
59-
HiddenTrackCount,
59+
TrackCount,
6060
Selector,
6161
DangerousSelectorWithArguments,
6262
State,
@@ -609,7 +609,7 @@ export const getLocalTrackName = (
609609
* then all its children are as well. This function walks all of the data to determine
610610
* the correct hidden counts.
611611
*/
612-
export const getHiddenTrackCount: Selector<HiddenTrackCount> = createSelector(
612+
export const getTrackCount: Selector<TrackCount> = createSelector(
613613
getGlobalTracks,
614614
getLocalTracksByPid,
615615
UrlState.getHiddenLocalTracksByPid,

src/test/store/tracks.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ describe('ordering and hiding', function () {
624624
it('can count hidden local tracks', function () {
625625
const { getState, dispatch, workerTrackIndex, tabPid } = init();
626626
dispatch(hideLocalTrack(tabPid, workerTrackIndex));
627-
expect(ProfileViewSelectors.getHiddenTrackCount(getState())).toEqual({
627+
expect(ProfileViewSelectors.getTrackCount(getState())).toEqual({
628628
hidden: 1,
629629
total: 4,
630630
});
@@ -633,7 +633,7 @@ describe('ordering and hiding', function () {
633633
it('can count hidden global tracks and their hidden local tracks', function () {
634634
const { getState, dispatch, tabTrackIndex } = init();
635635
dispatch(hideGlobalTrack(tabTrackIndex));
636-
expect(ProfileViewSelectors.getHiddenTrackCount(getState())).toEqual({
636+
expect(ProfileViewSelectors.getTrackCount(getState())).toEqual({
637637
hidden: 3,
638638
total: 4,
639639
});

src/types/actions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export type PreviewSelection = {
9595
/**
9696
* The counts for how many tracks are hidden in the timeline.
9797
*/
98-
export type HiddenTrackCount = {
98+
export type TrackCount = {
9999
readonly hidden: number;
100100
readonly total: number;
101101
};

0 commit comments

Comments
 (0)