StanfordLegion / prof-viewer

Legion Prof Viewer
Apache License 2.0
0 stars 5 forks source link

Zoom to item scrolls to processor, not task #47

Closed elliottslaughter closed 8 months ago

elliottslaughter commented 8 months ago

When you click "Zoom to Item", it performs a vertical scroll to the processor containing the item, but currently does not scroll to the specific item. For sufficiently large processors, this means the item can be off the screen.

The current implementation of ItemLink does not contain a row required to implement correct vertical scroll-to-item:

https://github.com/StanfordLegion/prof-viewer/blob/0657ead1d50c6fd354ab2cee03417721d674b93d/src/data.rs#L54-L64

There are a couple of options:

  1. Require ItemLink to contain row. This means anyone generating an ItemLink needs to run the algorithm to compute the stacking of tasks on a processor. I think this is infeasible.
  2. Perform a second scroll once the SlotTile is loaded so that we can determine which row the item is on and then scroll correctly. Because fetching a tile is a deferred operation, this can potentially introduce jankiness into the UI, but I think two scrolls are better than one because at least it will get the correct processor onto the screen while the tile is loading.
elliottslaughter commented 8 months ago

Fixed by #49.