Skip to content

batches: workspaces preview polish

Warren Gifford requested to merge kr/workspaces-preview-improvements into main

Created by: courier-new

A mass of updates to the WorkspacesPreview that either made https://github.com/sourcegraph/sourcegraph/issues/29525 easier or just paired well with it. 🙂

I feel a lot better shipping this as beta! https://github.com/sourcegraph/sourcegraph/issues/30466 is the only remaining improvement I think we'd still like to see to the WorkspacesPreview before then.

Major improvements

  • Stable layout: The elements of the preview don't jump around depending on the loading state, which was initially very disruptive and seemingly unpolished.
  • Cancel button (https://github.com/sourcegraph/sourcegraph/issues/29525): Preview taking too long? Just cancel it! Leaves the existing results from the workspaces preview resolution on screen in "stale" form.
  • Cached results: The results from your previous workspaces preview resolution will remain visible in the list while you wait for the next resolution job to finish. Cached results also appear if you come back to the editor later!
  • Smarter stale checking: The batch spec is only considered stale if the on statement or importChangesets statement changed, rather than the naive dirty/clean check previously. This is going to require more work on the backend first and has been dropped for now!
  • Less obstructive example: The on example code snippet is now hidden behind an accordion, as opposed to always being visible. It also now features a handy "copy" button!
  • No more race conditions(?): Reworked query logic to put dependent effects together with more declarative logic controlling it in an attempt to eliminate race conditions.

...And many more smaller improvements!

  • Disabled filters while resolution job is in progress
  • Micromanaged UI state to prevent "flickering" between state transitions
  • Instructional text is smaller and italicized, like in the designs
  • Fun new loading text while resolution is in progress (follow up: still needs more 🐴)

Videos to demonstrate!!

Shows off creation through preview: watch for cancel invocation and smoother UI transitions! https://user-images.githubusercontent.com/8942601/152944108-599c26b7-b230-4b75-b0f8-c8336151bb3c.mov

Shows off persistent workspaces cache! https://user-images.githubusercontent.com/8942601/152944428-732144cb-2810-4183-ba44-fb80daf015ce.mov

Merge request reports

Loading