feat(lanes): Add Lane repo/worktree mode toggle, manual branch, folder browse
- Repo mode adopts a directory as-is via /lanes/ensure (no worktree, no branch fields) - the right choice for a main repo you want stage detection on. Worktree mode (default) keeps the existing provisioning flow but now requires a manually-typed branch name instead of deriving one from the title. - POST /lanes/worktree accepts an optional `branch`, validated via `git check-ref-format --branch`; omitting it preserves the CLI's existing auto-derived-branch behavior. - New GET /lanes/browse lists a directory's immediate subdirectories, backing a small folder-browse modal on both path fields - browsers cannot expose an absolute path from a native picker, so this is server-backed instead, consistent with the tool's local-first model.
This commit is contained in:
+20
-1
@@ -1922,11 +1922,30 @@ export const api = {
|
||||
* @param body The source repo, a slug/title, and the branch to fork from.
|
||||
* @returns `{ lane }` — the lane row created immediately, before provisioning finishes.
|
||||
*/
|
||||
worktree: (body: { sourceRepo: string; slug?: string; title?: string; base?: string }) =>
|
||||
worktree: (body: {
|
||||
sourceRepo: string;
|
||||
slug?: string;
|
||||
title?: string;
|
||||
base?: string;
|
||||
branch?: string;
|
||||
}) =>
|
||||
request<{ lane: Lane }>("/lanes/worktree", {
|
||||
method: "POST",
|
||||
body: JSON.stringify(body),
|
||||
}),
|
||||
/**
|
||||
* GET /api/lanes/browse — list a directory's immediate subdirectories, for
|
||||
* the Add Lane modal's folder browser. Browsers cannot expose absolute
|
||||
* filesystem paths from a native picker, so this drives a server-backed one.
|
||||
* @param path Absolute path to list; defaults server-side to the home dir.
|
||||
* @returns `{ path, parent, entries }` — `parent` is null at the root.
|
||||
*/
|
||||
browse: (path?: string) =>
|
||||
request<{
|
||||
path: string;
|
||||
parent: string | null;
|
||||
entries: { name: string; path: string; isGitRepo: boolean }[];
|
||||
}>(`/lanes/browse${path ? `?path=${encodeURIComponent(path)}` : ""}`),
|
||||
/**
|
||||
* GET /api/lanes/:id — fetch one lane.
|
||||
* @param id The lane id.
|
||||
|
||||
Reference in New Issue
Block a user