Move work in progress MR widget to be the last one displayed
Deferred from an MR to show the Rebase button widget instead of the WIP widget.
There may be primarily code maintenance solutions to make this UI move.
There are two problems with the code relating to the MR Widgets:
- There's a single test that tests each widget and depends on their source code order
- The way the widgets are shown depends implicitly on their source order in a long
if/else if
block
The former of these will be addressed by #228611, but the source block is still very complex and brittle.
In the first issue linked above, this brittleness led to only a partial solution to the desired outcome. The desired outcome was that the work in progress widget appeared last.
Because the Unresolved Discussions check includes a check for WIP, it has to come after the Work in Progress check.
So, there's one more thing to investigate: Are the widgets correctly isolated and scoped? What's the business reason that the UI is instructed to show that there are Unresolved Discussions when the MR is a work in progress even if there are zero discussions?
If we:
- Isolate and scope each widget
- Ensure that a given set of variables can only result in one widget (a use-case for a finite state machine?)
- Eliminate the implicit importance of the source order of the widgets
then moving the widgets around should be trivial!