Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions src/components/timeline/FullTimeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
getProfileTimelineUnit,
getGlobalTracks,
getGlobalTrackReferences,
getHiddenTrackCount,
getTrackCount,
getGlobalTrackOrder,
getPanelLayoutGeneration,
} from 'firefox-profiler/selectors';
Expand All @@ -39,7 +39,7 @@ import type {
GlobalTrack,
InitialSelectedTrackReference,
GlobalTrackReference,
HiddenTrackCount,
TrackCount,
Milliseconds,
StartEndRange,
TimelineUnit,
Expand All @@ -60,7 +60,7 @@ type StateProps = {
readonly panelLayoutGeneration: number;
readonly zeroAt: Milliseconds;
readonly profileTimelineUnit: TimelineUnit;
readonly hiddenTrackCount: HiddenTrackCount;
readonly trackCount: TrackCount;
};

type DispatchProps = {
Expand All @@ -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<HTMLElement>) => {
Expand All @@ -90,7 +90,7 @@ class TimelineSettingsHiddenTracks extends React.PureComponent<{
};

override render() {
const { hiddenTrackCount } = this.props;
const { trackCount } = this.props;

return (
<Localized
Expand All @@ -99,8 +99,8 @@ class TimelineSettingsHiddenTracks extends React.PureComponent<{
span: <span className="timelineSettingsHiddenTracksNumber" />,
}}
vars={{
visibleTrackCount: hiddenTrackCount.total - hiddenTrackCount.hidden,
totalTrackCount: hiddenTrackCount.total,
visibleTrackCount: trackCount.total - trackCount.hidden,
totalTrackCount: trackCount.total,
}}
>
<button
Expand All @@ -109,11 +109,11 @@ class TimelineSettingsHiddenTracks extends React.PureComponent<{
className="timelineSettingsHiddenTracks"
>
<span className="timelineSettingsHiddenTracksNumber">
{hiddenTrackCount.total - hiddenTrackCount.hidden}
{trackCount.total - trackCount.hidden}
</span>
{' / '}
<span className="timelineSettingsHiddenTracksNumber">
{hiddenTrackCount.total}{' '}
{trackCount.total}{' '}
</span>
tracks
</button>
Expand Down Expand Up @@ -146,7 +146,7 @@ class FullTimelineImpl extends React.PureComponent<Props, State> {
width,
globalTrackReferences,
panelLayoutGeneration,
hiddenTrackCount,
trackCount,
changeRightClickedTrack,
innerElementRef,
} = this.props;
Expand All @@ -155,9 +155,9 @@ class FullTimelineImpl extends React.PureComponent<Props, State> {
<>
<TimelineSelection width={width}>
<div className="timelineHeader">
{hiddenTrackCount.total > 1 ? (
{trackCount.total > 1 ? (
<TimelineSettingsHiddenTracks
hiddenTrackCount={hiddenTrackCount}
trackCount={trackCount}
changeRightClickedTrack={changeRightClickedTrack}
/>
) : (
Expand Down Expand Up @@ -196,7 +196,7 @@ class FullTimelineImpl extends React.PureComponent<Props, State> {
</Reorderable>
</OverflowEdgeIndicator>
</TimelineSelection>
{hiddenTrackCount.total > 1 ? <TimelineTrackContextMenu /> : null}
{trackCount.total > 1 ? <TimelineTrackContextMenu /> : null}
</>
);
}
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/selectors/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import type {
TrackReference,
LastNonShiftClickInformation,
PreviewSelection,
HiddenTrackCount,
TrackCount,
Selector,
DangerousSelectorWithArguments,
State,
Expand Down Expand Up @@ -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<HiddenTrackCount> = createSelector(
export const getTrackCount: Selector<TrackCount> = createSelector(
getGlobalTracks,
getLocalTracksByPid,
UrlState.getHiddenLocalTracksByPid,
Expand Down
4 changes: 2 additions & 2 deletions src/test/store/tracks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand All @@ -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,
});
Expand Down
2 changes: 1 addition & 1 deletion src/types/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down