[ENG-2621] Fix bug where status in workflow header is not correctly updated #1156
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe your changes and why you are making these changes
Previously, we were hardcoding the workflow status to show an indicator for the execution status of the most recent workflow run. That had two issues:
1 was fixable simply by updating the index of the status check to match the selected run, but 2 was a tougher challenge because we would have to load the whole workflow state again, which would cause the whole page to go white and then re-render.
#1108 introduced the workflow history store which enabled us to fix this problem more simply. Now, the workflow header reads the status from the workflow history rather than from the workflow reducers
dagResults
list. The refresh button can simply refresh the workflow history store, and the status will update accordingly. This PR also fixes 1 by doing the index management that I mentioned above.This PR also does a little bit of work to prevent flashing as things render on the UI. Previously, we would return null when loading metadata, which would cause a bunch of layout shifts to happen when the metadata finally loaded. This PR's updates are not perfect, but we essentially enter some "empty" states when metadata is loading, so elements render and then update when the metadata loads. As you can see, this still causes some flashing when the state ultimately loads, but the layout does not shift.
Related issue number (if any)
ENG-2621
Loom demo (if any)
https://www.loom.com/share/822115ef4be14e7fa0ec9a7b5bc6862e
Checklist before requesting a review
python3 scripts/run_linters.py -h
for usage).run_integration_test
: Runs integration testsskip_integration_test
: Skips integration tests (Should be used when changes are ONLY documentation/UI)