catapult-project / catapult

Deprecated Catapult GitHub. Please instead use http://crbug.com "Speed>Benchmarks" component for bugs and https://chromium.googlesource.com/catapult for downloading and editing source code..
https://chromium.googlesource.com/catapult
BSD 3-Clause "New" or "Revised" License
1.91k stars 563 forks source link

[trace viewer] quickly finding a named trace #4569

Open nickdesaulniers opened 5 years ago

nickdesaulniers commented 5 years ago

My current workflow looks like: / to search, m to highlight, f to zoom, then mouse wheel to scroll.

It would be nice to have a single hotkey that maybe did all of the above?

nathanrogersgoogle commented 5 years ago

+1 to this.

It seems like a hotkey to put the currently selected event in the vertical center of the screen would be the most general way to solve this (given that the mouse scroll is the most painful part of this)? Although that might not be the most discoverable option. One alternative is putting a button near the arrows for search that does this.

benshayden commented 5 years ago

I think it could automatically zoom+scroll directly to the event when finding. Can you think of any reason not to do that?

I think you can dispatch an event from the FindControl to the timeline-view, which can call a new method on the timeline-track-view to update its displayTransform_:

  1. Change tr-ui-find-control.updateHitCountEl() to call this.dispatchEvent() with a new CustomEvent like 'find-selected'.
  2. Change tr-ui-timeline-view.ready() to call this.findCtl.addEventListener('find-selected', this.onFindSelected.bind(this));
  3. onFindSelected() should call this.trackView.onFindSelected_().
  4. The new method tr-ui-timeline-track-view.onFindSelected() should get the selected event from this.brushingStateController, and update this.displayTransform_() to zoom+pan the event into view.

https://github.com/catapult-project/catapult/blob/master/tracing/tracing/ui/timeline_track_view.html https://github.com/catapult-project/catapult/blob/master/tracing/tracing/ui/timeline_view.html https://github.com/catapult-project/catapult/blob/master/tracing/tracing/ui/find_control.html