@agimon-ai/po-git 0.0.0-alpha.164 → 0.0.0-alpha.166

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,7 +71,18 @@ 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
- /** Local branches first, then remote-only ones, filtered by a case-insensitive substring. */
74
+ /** The last segment of a path: enough to name a checkout without spelling out where it lives. */
75
+ function folderName(path) {
76
+ return path.split(/[\\/]/).filter((part) => part !== "").pop() ?? path;
77
+ }
78
+ /** Where a busy branch is checked out, short enough for one line. */
79
+ function busyNote(busyAt, workspaceRoot) {
80
+ return busyAt === workspaceRoot ? "Checked out here" : `Checked out in ${folderName(busyAt)}`;
81
+ }
82
+ /**
83
+ * Local branches a session can take, then the checked-out ones, then remote-only ones, filtered by a
84
+ * case-insensitive substring.
85
+ */
75
86
  function branchOptions(branches, query) {
76
87
  const needle = query.trim().toLowerCase();
77
88
  const matches = (text) => needle === "" || text.toLowerCase().includes(needle);
@@ -80,7 +91,7 @@ function branchOptions(branches, query) {
80
91
  name: branch.name,
81
92
  current: branch.name === branches.current,
82
93
  ...branch.checkedOutAt === void 0 ? {} : { busyAt: branch.checkedOutAt }
83
- }));
94
+ })).sort((a, b) => Number(a.busyAt !== void 0) - Number(b.busyAt !== void 0));
84
95
  const remote = branches.remote.filter((branch) => matches(`${branch.remote}/${branch.name}`)).map((branch) => ({
85
96
  key: `remote:${branch.remote}/${branch.name}`,
86
97
  name: branch.name,
@@ -182,7 +193,8 @@ function GitNewSessionDialogView({ workspaceRoot, branches, loadError = "", init
182
193
  children: "New session"
183
194
  }), /* @__PURE__ */ jsx("p", {
184
195
  className: "mt-1 font-mono text-sm text-po-dim",
185
- children: workspaceRoot
196
+ title: workspaceRoot,
197
+ children: folderName(workspaceRoot)
186
198
  })]
187
199
  }),
188
200
  /* @__PURE__ */ jsxs("div", {
@@ -265,12 +277,10 @@ function GitNewSessionDialogView({ workspaceRoot, branches, loadError = "", init
265
277
  className: "font-mono break-all",
266
278
  children: branch.remote === void 0 ? branch.name : `${branch.remote}/${branch.name}`
267
279
  }), form.selected?.key === branch.key ? /* @__PURE__ */ jsx(CheckIcon, { className: "size-4 shrink-0" }) : null]
268
- }), branch.busyAt !== void 0 ? /* @__PURE__ */ jsxs("span", {
269
- className: "text-sm text-po-dim",
270
- children: ["Checked out in ", /* @__PURE__ */ jsx("span", {
271
- className: "font-mono break-all",
272
- children: branch.busyAt
273
- })]
280
+ }), branch.busyAt !== void 0 ? /* @__PURE__ */ jsx("span", {
281
+ className: "truncate text-sm text-po-dim",
282
+ title: branch.busyAt,
283
+ children: busyNote(branch.busyAt, workspaceRoot)
274
284
  }) : branch.current ? /* @__PURE__ */ jsx("span", {
275
285
  className: "text-sm text-po-dim",
276
286
  children: "Current"
@@ -409,8 +419,9 @@ function GitNewSessionDialogView({ workspaceRoot, branches, loadError = "", init
409
419
  disabled: busy
410
420
  }),
411
421
  mode !== "plain" ? /* @__PURE__ */ jsx("p", {
422
+ "data-testid": "new-session-hint",
412
423
  className: "text-sm leading-relaxed text-po-dim",
413
- children: "Runs in its own worktree, so this checkout stays as it is."
424
+ children: (loading ? void 0 : problem) ?? "Runs in its own worktree, so this checkout stays as it is."
414
425
  }) : null,
415
426
  riftMissing ? /* @__PURE__ */ jsxs("div", {
416
427
  "data-testid": "rift-install-notice",