Keep background composer work out of creation progress (#2794)

* fix(composer): keep background context out of loading state

Pull request link resolution can block a new workspace until its checkout target is known, but it is not submission work. Keep that safety gate while reserving the send-button spinner and drop lockout for actual submission or upload progress.

* test(composer): cover link resolution at browser boundary

Exercise the real new-workspace composer while pull request context resolves, including the submit presentation and file-drop path. Keep the two presentation booleans local to their only caller instead of exporting policy solely for an internal-state unit test.

* fix(composer): preserve background lookup ownership

Composer edits could release the resolving gate while a pull request lookup still owned the request, briefly allowing workspace creation from the wrong branch. Track logical candidates independently of unrelated draft changes and settle each reference independently so only invalid work releases early.

* fix(composer): preserve pasted PR selection order

* fix(composer): renew re-added PR lookups

* fix(composer): track pasted PR source order

* fix(composer): preserve resolved attachment order

* fix(composer): coordinate active lookup order
This commit is contained in:
Mohamed Boudra
2026-08-02 18:37:07 +02:00
committed by GitHub
parent ccb668b3b4
commit f682156302
4 changed files with 552 additions and 66 deletions
+14 -1
View File
@@ -50,6 +50,13 @@ import {
waitForSidebarHydration,
waitForWorkspaceInSidebar,
} from "../support/helpers/workspace-ui";
import { dropFileOnComposer, expectAttachmentPill } from "../support/helpers/composer";
const BACKGROUND_RESOLUTION_FILE = {
name: "background-context.json",
mimeType: "application/json",
buffer: Buffer.from(JSON.stringify({ composer: "background-resolution" })),
};
interface WorkspaceStatusGroupEvent {
rowTestId: string;
@@ -848,7 +855,13 @@ test.describe("New workspace flow", () => {
await pasteGithubPrUrl(page, context, pr.url);
await expect(page.getByTestId("workspace-create-submit")).toBeDisabled();
const createButton = page.getByTestId("workspace-create-submit");
await expect(createButton).toBeDisabled();
await expect(createButton.getByRole("progressbar")).toHaveCount(0);
await dropFileOnComposer(page, BACKGROUND_RESOLUTION_FILE);
await expectAttachmentPill(page, "composer-file-attachment-pill");
await expectComposerGithubAttachmentPill(page, {
number: pr.number,
title: pr.title,