Show New Workspace isolation controls immediately (#2702)
* fix(workspaces): show isolation without checkout delay * fix(workspaces): trust hydrated project capability * fix(workspaces): resolve branch before creation * fix(workspaces): honor invalidated checkout status * fix(workspaces): preserve isolation while projects load * fix(workspaces): keep provisional project routes usable Route-derived projects do not know their worktree capability. Represent that uncertainty at the placement boundary so remembered worktree intent survives hydration without disabling the New Workspace screen indefinitely.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { CreatePaseoWorktreeInput } from "@getpaseo/client/internal/daemon-client";
|
||||
import type { ForgeSearchItem } from "@getpaseo/protocol/messages";
|
||||
import type { CheckoutStatusPayload } from "@/git/checkout-status-cache";
|
||||
|
||||
export type PickerItem =
|
||||
| { kind: "branch"; name: string }
|
||||
@@ -43,3 +44,16 @@ export function pickerItemToCheckoutRequest(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function resolveCheckoutRequest(
|
||||
selectedItem: PickerItem | null,
|
||||
checkoutStatus: CheckoutStatusPayload,
|
||||
): PickerCheckoutRequest | undefined {
|
||||
const selectedCheckoutRequest = pickerItemToCheckoutRequest(selectedItem);
|
||||
if (selectedCheckoutRequest) return selectedCheckoutRequest;
|
||||
if (!checkoutStatus.currentBranch) return undefined;
|
||||
return {
|
||||
action: "branch-off",
|
||||
refName: checkoutStatus.currentBranch,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user