Repository navigation
feat(web): add a project to a named machine in one click when there is nothing to decide - #1650
incognitojam wants to merge 22 commits into
Conversation
Upstream divergenceBoth sides are compared with upstream at the in-order tip
Upstream files that start to differ (6)
Upstream files whose difference changes (9)
|
68d8309 to
41a65cc
Compare
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
481cb61 to
e84295a
Compare
3aaec36 to
dd3faca
Compare
…s nothing to decide
…ch machine as an action
…s, and never starts once the dialog shows
…s one pick at a time, and reads as an action
…even if another add replaces it
… can always be cancelled, and warns about an existing folder
…ops another client's, and the refusal names its add
…is really gone" This reverts commit 9091f0d.
…nt add waits its turn instead of being refused
…s a clone being sent, and the row follows the machine chosen in the dialog
…r takes that add over
…it instead of a queue
…second clone, and an unanswered start after a cancel says so
dd3faca to
629fb1c
Compare
|
This PR changes the test suite by +21 test cases (browser +9, unit +11, server +1). Keep tests that would fail for a real reason, and test logic below the UI where it can be. See Testing. |
Note
Picking Add to build-server in the machine menu starts the clone straight away when there is nothing to decide, and the composer shows its progress from the click. The dialog still opens when
.env-style files would be copied, the folder already exists, the checks fail or cannot run, or they take more than 3 seconds.Adding a project to another machine always opened a dialog. Usually every field in it was already right and there was nothing to decide, but adding still took an extra screen and another click.
The composer's machine menu, both in a new thread and in a project's chat, now lists each machine the project could go to as an action below a divider, with the folder the clone will land in beneath it. Add with options… opens the full dialog. Settings → Projects → Checkouts keeps opening the dialog.
.env,.env.*,.envrcor.dev.varswould be copiedAdd with options… and the Settings button are disabled rather than left open because they open the same dialog the one-click add uses while it decides; opening it would replace that add.
The rows come back when the add ends: its dialog closes, its clone is listed, its start fails (the dialog then shows why), or a cancel has settled. A request that never answers cannot hold them forever. Reading the files to copy, the start request, and the cancel's own requests each count as failed after 30 seconds, and waiting for the clone to be listed was already capped at 10 seconds. So the longest the rows can stay disabled without a dialog on screen is about 70 seconds.
Cancelling after the clone request went out, from the row or by closing the dialog after Clone. The row goes at once; the Add rows stay disabled until the cancel has settled, so a new add cannot start while the old one is still being cleared away. If the start request then goes unanswered, the notice says the project may still be there. The client acts only on a clone this add started:
Two server behaviours this PR does not change: discarding a partial clone leaves the destination as an empty folder, as Cancel then Remove project in the composer does today; and the server does not report a partial checkout it fails to delete (for example on a permissions error), so the client cannot tell the person about it.
One click counts only checks answered after the click, so a cached answer from an earlier dialog cannot skip a question. Once the dialog has shown, only its Clone button starts the clone.
Server change. A listing of ignored files that git could not make used to come back as an empty list, which looked like "nothing to copy". The result now carries an optional
failedflag. Older clients ignore the flag. A new client talking to an older server cannot tell a failed listing from "no files", so one click there can still leave.envbehind until that server updates.Clone protocol. One click keeps the protocol of the source checkout's remote. When the target rejects SSH, the server already retries over HTTPS. This was run, not only read from the code: build-server ran with SSH set up to be rejected (no usable key, no agent) and a
gitwrapper on itsPATHthat logs each command and its exit status. One click on a project whose remote isgit@github.com:octocat/Hello-World.gitlogged:The clone on build-server ended up with
originset tohttps://github.com/octocat/Hello-World.git.Upstream. Two open upstream PRs change this dialog and will need a hand merge at intake: pingdotgg#31106 (choices for an existing folder) and pingdotgg#34412 (mobile entry point, and moves the copy relay into
client-runtime).The machine menu:
The same menu in dark mode:
The menu on a narrow composer:
One click with nothing to decide, right after the click, in the hello-world thread that started it:
Meanwhile, in another composer (a spoon-knife new thread), both Add rows are disabled with "Preparing…" beneath, and there is no status row:
The hello-world thread once the clone starts, now on build-server (cropped to the composer's lower edge):
.envfiles would be copied, so it asks:A clone that fails, with Retry:
Preparing… in dark mode:
The
.envdialog in dark mode:The existing-folder warning, light and dark:
Ignored files could not be listed, light and dark:
The project chat's menu:
After picking Add to build-server in the project chat, it is on build-server and shows the clone (cropped to the composer's lower edge):
How this was checked: against a production build of the web client, on an isolated server ("studio-mac") with a second local server connected as "build-server", both using synthetic data. The projects are clones of
octocat/Hello-Worldandoctocat/Spoon-Knife, plus a project whose remote repository does not exist.New thread, nothing to decide, production build, timings from the page (
PerformanceObserverlong tasks over 50 ms, composer row polled every 20 ms):The first click loads code the page has not used yet. The tasks around 1 s are the composer switching to the new project on build-server, the same work as picking a project by hand. Nothing blocks for half a second; the roughly 580 ms seen earlier came from the development build.
Project chat: "Preparing…" at 86 ms, then the header and row switched to build-server at 235 ms with the typed message kept.
Cancel: clicked during "Preparing…" at about 0.2 s. The row went away, the draft stayed on studio-mac, and nothing was cloned. A new pick afterwards cloned as normal.
One add at a time: hello-world was picked in its new thread, and the spoon-knife thread's menu was opened 0.7 s later. Both its Add rows reported
aria-disabled=truewith "Preparing…" from 724 ms after the click until 3485 ms, when hello-world's clone was listed, and then came back enabled. The spoon-knife composer showed no status row.Rows freed by the dialog: when the checks took over 3 seconds and the dialog opened, closing it with Cancel left both rows enabled again.
Asking: the
.envand existing-folder cases opened the dialog as captured. The failure case ended on "Failed to clone … Git authentication failed" with Retry.Tests: a server test covers the
failedflag (and an existing server test covers cancel deleting the partial checkout); unit tests cover the four cancel outcomes above; unit tests cover the decision table, freshness, and mapping a failed or unsupported listing to a question; unit tests cover a start request or a cancel that is never answered failing after 30 seconds; browser tests cover any other add (another machine, another draft, or the dialog) being ignored while one is decided, the status row showing only while its draft is on the project being added, the rows freed when the project vanishes or the start fails, the rows staying disabled until a cancelled request settles, a dialog that remounts while its clone request is out starting no second clone and keeping that request's "Starting…", error and Cancel, the notice when a cancelled start goes unanswered, and closing the dialog after Clone, with its Cancel button or Escape, cancelling and removing that clone.Captures that needed time: a
gitwrapper on studio-mac paused the ignored-file listing for 2.6 s (under the 3-second limit), or made it fail, so the disabled rows and the failed-listing warning could be captured.Not exercised at runtime: the 3-second timer itself; the 30-second limits on a request that never answers; the disabled Settings button; the status row hiding when its draft is switched to another project. Each is covered by the tests above.
In the narrow menu capture, the grey background on "studio-mac" and "New worktree" is the menu's existing style for the checked item in each group (
data-checked), unchanged here.Paths in captures are rewritten to
/Users/dev. Captures of a composer on build-server are cropped to its lower edge: that fixture runs with a scratch home folder and no provider sign-in, so its composer shows Open provider settings.Written by
claude/claude-opus-5-5, reviewed bycodex/gpt-6-astra, in styal 🧵.