@agimon-ai/po-git 0.0.0-alpha.196 → 0.0.0-alpha.198

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -71,6 +71,14 @@ const RIFT_INSTALL_COMMAND = "npm install -g rift-snapshot";
71
71
  //#endregion
72
72
  //#region src/extensions/workspaces/(frontend)/_lib/newSessionForm.ts
73
73
  const MAX_LISTED = 200;
74
+ /** Full checkout is explicit; a locked default remains visible even if absent from the catalog. */
75
+ function sparseOptions(branches) {
76
+ return [.../* @__PURE__ */ new Set([
77
+ "full",
78
+ ...branches.sparseProfiles ?? [],
79
+ ...branches.defaultSparseProfile === void 0 ? [] : [branches.defaultSparseProfile]
80
+ ])];
81
+ }
74
82
  /** The last segment of a path: enough to name a checkout without spelling out where it lives. */
75
83
  function folderName(path) {
76
84
  return path.split(/[\\/]/).filter((part) => part !== "").pop() ?? path;
@@ -121,10 +129,12 @@ function launchSelection(state) {
121
129
  return state.profile === void 0 ? void 0 : { profile: state.profile };
122
130
  }
123
131
  /** The worktree create request for the form, or undefined in plain mode. */
124
- function createRequest(state) {
132
+ function createRequest(state, branches) {
125
133
  const name = state.name.trim();
126
134
  const chosen = launchSelection(state);
135
+ const sparseProfile = branches?.defaultSparseProfile ?? state.sparseProfile;
127
136
  const named = {
137
+ ...sparseProfile === void 0 ? {} : { sparseProfile },
128
138
  ...name === "" ? {} : { name },
129
139
  ...chosen === void 0 ? {} : { selection: chosen }
130
140
  };
@@ -153,7 +163,7 @@ function Field$1({ label, children }) {
153
163
  });
154
164
  }
155
165
  /** Inline presentation also lets story capture inspect content, rather than a portal-only root. */
156
- function GitNewSessionDialogView({ workspaceRoot, branches, loadError = "", initialForm, busy = false, error = "", riftMissing = false, profileCatalog, onClose, onCreate, onDeleteBranch, onOpenBranchFolder }) {
166
+ function GitNewSessionDialogView({ workspaceRoot, branches, loadError = "", initialForm, busy = false, error = "", riftMissing = false, profileCatalog, sparseCheckout, onClose, onCreate, onDeleteBranch, onOpenBranchFolder }) {
157
167
  const t = useT();
158
168
  const [form, setForm] = useState({
159
169
  mode: "existing",
@@ -413,6 +423,24 @@ function GitNewSessionDialogView({ workspaceRoot, branches, loadError = "", init
413
423
  disabled: busy
414
424
  })
415
425
  }),
426
+ mode !== "plain" && sparseCheckout !== void 0 ? /* @__PURE__ */ jsxs(Field$1, {
427
+ label: t("git.ui.sparseCheckout", "Sparse checkout"),
428
+ children: [/* @__PURE__ */ jsxs(Select, {
429
+ value: sparseCheckout.defaultSparseProfile ?? form.sparseProfile ?? "full",
430
+ onValueChange: (sparseProfile) => update({ sparseProfile }),
431
+ disabled: busy || sparseCheckout.defaultSparseProfile !== void 0,
432
+ children: [/* @__PURE__ */ jsx(SelectTrigger, {
433
+ "aria-label": t("git.ui.sparseCheckout", "Sparse checkout"),
434
+ children: /* @__PURE__ */ jsx(SelectValue, {})
435
+ }), /* @__PURE__ */ jsx(SelectContent, { children: sparseOptions(sparseCheckout).map((profile) => /* @__PURE__ */ jsx(SelectItem, {
436
+ value: profile,
437
+ children: profile === "full" ? t("git.ui.fullCheckout", "Full checkout") : profile
438
+ }, profile)) })]
439
+ }), sparseCheckout.defaultSparseProfile === void 0 ? null : /* @__PURE__ */ jsx("span", {
440
+ className: "text-sm text-po-dim",
441
+ children: t("git.ui.workspaceSparseDefault", "Set by this workspace")
442
+ })]
443
+ }) : null,
416
444
  profileCatalog === void 0 ? null : /* @__PURE__ */ jsx(ProfilePicker, {
417
445
  profiles: profileCatalog.profiles,
418
446
  status: profileCatalog.status,