feat: non-blocking worktree creation with in-tab progress (#4729)
* feat: non-blocking worktree creation with in-tab progress The Create Worktree modal stayed open with a spinning button for the full create IPC (base-ref git fetch + `git worktree add`, ~10-15s on heavy repos) and only dismissed once it resolved, so the user stared at a frozen modal with no way to work elsewhere. Run creation in the background instead. On submit the modal closes immediately and an in-tab "Creating worktree…" panel shows live setup status, wiring the previously-unused `createWorktree:progress` main->renderer event via a per-creation correlation id. A sidebar row tracks each in-flight create, the user can navigate to other worktrees or cancel while it runs, and on success it swaps to the real worktree + terminal in one frame. Failure shows the error in the panel with retry; remote/runtime targets (no progress events) show an indeterminate spinner. Pending creations live in a separate store map rather than a faked Worktree row, so git-status, the tab model, persistence, and PTY spawning are untouched. Only the composer quick-create path changes; other createWorktree callers keep their synchronous behavior. * refactor: present in-flight worktree creates as inline tabs and rows Rework the two surfaces that show an in-flight create so each reads like the real thing it stands in for. The in-tab panel is now a faux tab: a tab strip carrying the new worktree's name (the title) over a quiet top-left status line, instead of a centered card with a step checklist. An in-flight create reads as a real workspace tab whose content is loading, the title and status never duplicate each other, and the handoff to the terminal stays a same-frame swap. Failure shows the error inline with retry. In the sidebar, a pending create now renders as an inline row under its target repo group — where the worktree will land — replacing the separate strip that pinned every in-flight create to the top of the list. * fix: keep pending worktree rows visible without repo metadata --------- Co-authored-by: Neil <4138956+nwparker@users.noreply.github.com>
This commit is contained in:
@@ -1635,6 +1635,10 @@ export type CreateWorktreeArgs = {
|
||||
/** Optional startup command for callers that want the backend to spawn the
|
||||
* first terminal as soon as the worktree is registered. */
|
||||
startup?: WorktreeStartupLaunch
|
||||
/** Correlates `createWorktree:progress` events back to a specific pending
|
||||
* creation in the renderer, so concurrent background creates each drive
|
||||
* their own status surface. Omitted by synchronous callers. */
|
||||
creationId?: string
|
||||
}
|
||||
|
||||
export type CreateWorktreeResult = {
|
||||
|
||||
Reference in New Issue
Block a user