Repository navigation
feat(test-runs): undo an approval or rejection from its toast (U5) - #446
Merged
Merged
Conversation
Approved/Rejected toasts carry an Undo button for 6 s: one run in the details dialog, bulk approve/reject in the run list, and the matching variations dialog. When a bulk action partly fails, Undo reverts only the runs that went through. Undo calls POST /test-runs/revert (WP15) and says "Undone" / "N test runs restored."; a refusal (409) shows the backend's message. Reverted runs drop out of the variations dialog's "acted" memory, so go-to-next visits them again. The Undo button disables after its first click so a double click reverts once. The dismiss button moves to DismissNotificationButton so an undo toast keeps it. testRunService shares one POST-ids request between the bulk calls and revert. The functions coverage threshold goes up to 87. Needs api-v6.0.0 (backend #443): older APIs answer 404 on revert.
… without an action The undo toast's 6 s no longer overrides the dialog's 2 s by spread order; a toast with an action keeps its own time, and a comment confirmation is pinned to two seconds.
An undo that finished after the next approval closed that approval's toast, and with it its Undo. Undo results now go through enqueueAside, which shows a toast without replacing the current confirmation.
CPU throttling is relative to the machine, and a GitHub runner takes 270-600 ms where a laptop takes 130-180, so the 400 ms limit failed on slower runners without any slowdown in the app. Local runs keep 400.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



Adds Undo to the Approved/Rejected toasts (API-SYNC WP15, frontend item U5).
What the reviewer gets
testRun_updatedfor each reverted run, which the socket context already applies. In the variations dialog, reverted runs are forgotten as "acted", so go-to-next visits them again.Notes
enqueueAsideand does not close the toast of a newer approval.DismissNotificationButton, so an undo toast keeps it.testRunServiceshares one POST-ids request between the bulk calls andrevert.aria-hidden. Keyboard access to toasts in the dialog is out of scope.Tests
revertin the service; undo inApproveRejectButtons,BulkOperationandMatchingVariationsDialog(partial results, 409, double click, a late result next to a newer toast, go-to-next after undo).page.clock.screens.spec.tsgets "project page after a bulk approval, with undo" in light and dark; the baselines were made in Docker and reviewed.npm run lint(0 errors),typecheck,test(918),build,test:pw:docker(363) all pass locally.