Skip to content

batches: implement edit workflow with better page hierarchy

Administrator requested to merge kr/merge-execution-pages-6 into main

Created by: courier-new

Closes https://github.com/sourcegraph/sourcegraph/issues/33395.

I tried to split off as much as this as possible in the previous PRs, but I think we've just got to bite the bullet on the rest of this. Apologies and endless gratitude in advance for any part of this you are able to review. 🙇‍♀️ I swear roughly half of all the lines changed here are from storybook story coverage. But the upside to that is, we finally have good storybook coverage on all the major SSBC components! 🙌 🎉

I'd highly recommend giving it a try on the demo app and checking out all the stories under the batches/batch-spec namespace before trying to review the code here -- the changes make the most sense when you've already observed the end result. 😅

Biggest decision here is that I opted for React Context over zustand. This is because we have a ton of logic and data fetching closely tied up in the state for the server-side execution workflow, and that's more natural for me to express with Context and pure React hooks. But this could always be refactored to zustand later if that's the direction the frontend is going. The point is that it's nicely packaged up in a hook that all the pages can easily access, not that the hook is implemented with X specific state manager/data provider.

Note that this also incorporates @adeola-ak's changes from https://github.com/sourcegraph/sourcegraph/pull/34449 (which were already approved and are just waiting on a finalized link to include in for the "Request a demo" button), in order to pre-empt the merge conflicts between them. 🙂

Test plan

Added like a bajilion and a half stories covering all sorts of states. Tested manually extensively. Logic is intended to be left the same, this just restructures components and reintegrates pieces together differently.

Merge request reports

Loading