profiler icon indicating copy to clipboard operation
profiler copied to clipboard

Add an option to hide tracks by type

Open gregtatum opened this issue 4 years ago • 11 comments

This is part of the overall work with: #2764

Example usage:

  • Right click a memory track
  • Choose "Hide all memory tracks"
  • All memory track should be closed.

Mockup:

image

gregtatum avatar Sep 10 '20 16:09 gregtatum

The render function for the context menu will need to detect what TYPE of track was clicked, then add this option to hide all of the tracks by that type:

https://github.com/firefox-devtools/profiler/blob/c4f68f423c7035a094952311addd0af5bec209e7/src/components/timeline/TrackContextMenu.js#L489-L532

Only valid types should have this options. Here are all the track types as of the time of filing this issue:

export type GlobalTrack =
  | {| +type: 'process', +pid: Pid, +mainThreadIndex: ThreadIndex | null |}
  | {| +type: 'screenshots', +id: string, +threadIndex: ThreadIndex |}
  | {| +type: 'visual-progress' |}
  | {| +type: 'perceptual-visual-progress' |}
  | {| +type: 'contentful-visual-progress' |};

export type LocalTrack =
  | {| +type: 'thread', +threadIndex: ThreadIndex |}
  | {| +type: 'network', +threadIndex: ThreadIndex |}
  | {| +type: 'memory', +counterIndex: CounterIndex |}
  | {| +type: 'ipc', +threadIndex: ThreadIndex |}
  | {| +type: 'event-delay', +threadIndex: ThreadIndex |};

From this list I would think the following should be able to be hidden:

  • screenshots
  • network
  • memory
  • ipc
  • event-delay

A new hideAllTracksByType action will need to be created. I'm guessing a good starting point would be to check out the isolateProcess and similar actions for ideas on how to get started. The action will need to add all of those track types to the hidden local tracks and hidden global tracks. Care should be taken to see everywhere the HIDE_LOCAL_TRACK and HIDE_GLOBAL_TRACK actions are being listened to in the reducers, as the HIDE_ALL_TRACKS_BY_TYPE action may need to be added there as well.

Also, check out the hiddenGlobalTracks, and hiddenLocalTracksByPid.

A test will also need to be added that shows that this feature works, it will be similar to the "isolate" tests:

https://github.com/firefox-devtools/profiler/blob/c4f68f423c7035a094952311addd0af5bec209e7/src/test/components/TrackContextMenu.test.js#L109-L139

gregtatum avatar Sep 10 '20 16:09 gregtatum

Hello, I got approved as outreachy applicant can I work on these issues?

codershona avatar Oct 07 '20 17:10 codershona

Hi @codershona! Sure, assigning the issue to you. Please let us know if you need anything!

canova avatar Oct 07 '20 17:10 canova

I'm clearing the assignee here for inactivity. If you still want to look at it, please leave a message!

julienw avatar Nov 09 '20 15:11 julienw

Hey, may i work on this ?

dhanesh12twice avatar Jan 07 '21 10:01 dhanesh12twice

hey @dhanesh12twice , I already assigned you to another issue, let's focus on that first. Thanks!

julienw avatar Jan 11 '21 11:01 julienw

Hey @julienw, I would like to work on this one! :)

rbrishabh avatar Jan 11 '21 13:01 rbrishabh

hey @rbrishabh, yes sure :-) It's not super easy but this should be interesting!

julienw avatar Jan 11 '21 17:01 julienw

hey @rbrishabh , how is it going?

julienw avatar Jan 22 '21 13:01 julienw

hi @julienw! Had a busy week with work! Getting to this during the weekend. Sorry for the delay!

rbrishabh avatar Jan 27 '21 20:01 rbrishabh

Thanks for the update! No worries, just checking if you were still looking at this :-)

julienw avatar Jan 28 '21 10:01 julienw