Page MenuHomePhabricator

Add a ?timestamp= option that allows you to jump to a specific line of run logs

Authored by bengotow on Sun, Nov 15, 7:05 AM.



This diff adds a new option ?timestamp=<unix> that allows you to jump to a specific log line within a run.

Note: there's a workaround here where we try up to 20 times to scroll to the desired position. If we scroll and find
that there is more scrolling to do, we scroll again. I spent a few hours trying to figure out why react-virtualized
gives the wrong Y position for the target row on the first pass, and in my tests (with a fairly small number of logs),
it only ever required two passes. I set the threshold to 20 because it seems like react-virtualized "gives up" measuring
rows after a while and just starts using the default row height. Not super happy with this solution, but because
it can be done within a single animation frame there is no visual jitter or jumping.

Right now there is no way to copy a link to a specific timestamp, would be a good next step I think!

Test Plan

Observe that you can jump to a log line

Diff Detail

R1 dagster
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

I do not understand javascript but like the outcome!

This revision is now accepted and ready to land.Mon, Nov 16, 4:31 PM