@agimon-ai/po-git 0.0.0-alpha.26 → 0.0.0-alpha.28

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.
@@ -1,5 +1,5 @@
1
1
  import { createApiClient, defineActivityGroup, defineChannelFile, defineFill, defineGlobalStore, defineLeaderBinding, defineRepositorySettingsPanel, defineSessionStore, defineToolRenderer, defineWebLifecycle, defineWebPlugin, sessionApiAddress } from "@agimon-ai/po-core/web";
2
- import { BranchIcon, Button, CheckIcon, ChevronDownIcon, ChevronUpIcon, Dialog, DialogContent, DialogTitle, DiffView, Dot, DropdownMenuItem, EmptyState, Input, MessageIcon, MessageItem, MessageItemBody, ReviewCommentDraft, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, SettingsActions, SettingsCard, SettingsNote, SettingsRow, SettingsRowDescription, SettingsRowText, SettingsRowTitle, SettingsSection, SettingsSectionDescription, SettingsSectionHeader, SettingsSectionTitle, ShieldIcon, Spinner, StatusBadge, Tabs, TabsContent, TabsList, TabsTrigger, buildReviewPrompt } from "@agimon-ai/po-web-components";
2
+ import { ArrowRightIcon, BranchIcon, Button, CheckIcon, ChevronDownIcon, ChevronUpIcon, Dialog, DialogContent, DialogTitle, DiffView, Dot, DropdownMenuItem, EmptyState, Input, MessageIcon, MessageItem, MessageItemBody, ReviewCommentDraft, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, SettingsActions, SettingsCard, SettingsNote, SettingsRow, SettingsRowDescription, SettingsRowText, SettingsRowTitle, SettingsSection, SettingsSectionDescription, SettingsSectionHeader, SettingsSectionTitle, ShieldIcon, Spinner, StatusBadge, Tabs, TabsContent, TabsList, TabsTrigger, buildReviewPrompt } from "@agimon-ai/po-web-components";
3
3
  import { createElement, useCallback, useEffect, useId, useRef, useState } from "react";
4
4
  import { sealedTransport } from "@agimon-ai/po-web-security/browser";
5
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -2478,8 +2478,10 @@ function GitReviewPanel({ sessionId, sendSessionFrame }) {
2478
2478
  * The '# git' group's branch row: this session's code change against its base.
2479
2479
  *
2480
2480
  * DESIGN PATTERNS:
2481
- * - One lane, branch and `+A -R`. Files, base, upstream and a paused rebase live
2482
- * in the review tab's header, which this lane opens.
2481
+ * - One lane, branch and `+A -R`, straight on the group body like every other
2482
+ * activity group: the dock already draws the card, so no inner card or heading.
2483
+ * Files, base, upstream and a paused rebase live in the review tab's header,
2484
+ * which this lane opens.
2483
2485
  * - Stays clickable at zero, because the review tab is also where pull, push
2484
2486
  * and rebase live.
2485
2487
  * - Reads the focused session's checkout, whether it is a worktree or not.
@@ -2501,42 +2503,41 @@ function DiffActivityView({ changes, pending, onReview, branch }) {
2501
2503
  const zero = changes?.added === 0 && changes?.removed === 0;
2502
2504
  const against = changes?.base === void 0 ? "uncommitted" : `vs ${changes.base}`;
2503
2505
  return /* @__PURE__ */ jsxs("div", {
2504
- className: "rounded-lg border border-po-border-soft bg-po-panel p-4",
2505
- children: [
2506
- /* @__PURE__ */ jsx("h2", {
2507
- className: "mb-3 text-lg font-semibold text-po-hi",
2508
- children: "Changes"
2509
- }),
2510
- /* @__PURE__ */ jsxs(Button, {
2511
- variant: "ghost",
2512
- size: "xs",
2513
- "data-testid": "activity-diff-changes",
2514
- className: "h-auto min-h-0 w-full min-w-0 gap-2 px-0 py-0 hover:bg-transparent",
2515
- "aria-label": changes ? `review ${changes.branch ?? "detached HEAD"} changes: ${changes.added} added, ${changes.removed} removed ${against}` : "Changes not reported yet",
2516
- title: changes ? `${changes.files} ${changes.files === 1 ? "file" : "files"} ${against}` : void 0,
2517
- onClick: onReview,
2518
- children: [/* @__PURE__ */ jsx("span", {
2519
- className: "min-w-0 flex-1 truncate text-left font-mono text-base font-normal text-po-hi",
2520
- children: changes?.branch ?? branch ?? "detached HEAD"
2521
- }), !changes || zero ? /* @__PURE__ */ jsx("span", {
2522
- className: "text-sm font-normal text-po-dim",
2523
- children: zero ? "No changes yet" : "Not reported yet"
2524
- }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("span", {
2506
+ className: "flex min-w-0 flex-col gap-1",
2507
+ children: [/* @__PURE__ */ jsxs(Button, {
2508
+ variant: "ghost",
2509
+ size: "card",
2510
+ "data-testid": "activity-diff-changes",
2511
+ className: "min-w-0 flex-row items-center gap-2 rounded-md px-1 py-1 font-normal hover:bg-po-panel",
2512
+ "aria-label": changes ? `review ${changes.branch ?? "detached HEAD"} changes: ${changes.added} added, ${changes.removed} removed ${against}` : "Changes not reported yet",
2513
+ title: changes ? `${changes.files} ${changes.files === 1 ? "file" : "files"} ${against}` : void 0,
2514
+ onClick: onReview,
2515
+ children: [/* @__PURE__ */ jsx("span", {
2516
+ className: "min-w-0 flex-1 truncate text-left font-mono text-sm text-po-hi",
2517
+ children: changes?.branch ?? branch ?? "detached HEAD"
2518
+ }), !changes || zero ? /* @__PURE__ */ jsx("span", {
2519
+ className: "shrink-0 text-sm text-po-dim",
2520
+ children: zero ? "No changes yet" : "Not reported yet"
2521
+ }) : /* @__PURE__ */ jsxs("span", {
2522
+ className: "flex shrink-0 gap-2 text-sm",
2523
+ children: [/* @__PURE__ */ jsxs("span", {
2525
2524
  className: "text-po-green",
2526
2525
  children: ["+", changes.added]
2527
2526
  }), /* @__PURE__ */ jsxs("span", {
2528
2527
  className: "text-po-red",
2529
2528
  children: ["-", changes.removed]
2530
- })] })]
2531
- }),
2532
- pending && /* @__PURE__ */ jsxs("p", {
2533
- className: "mt-2 flex items-center gap-2 text-sm text-po-dim",
2534
- children: [/* @__PURE__ */ jsx(Spinner, {
2535
- className: "size-3",
2536
- label: pending
2537
- }), pending]
2538
- })
2539
- ]
2529
+ })]
2530
+ })]
2531
+ }), pending && /* @__PURE__ */ jsxs("p", {
2532
+ className: "flex items-center gap-2 px-1 text-sm text-po-dim",
2533
+ children: [/* @__PURE__ */ jsx(Spinner, {
2534
+ className: "size-3",
2535
+ label: pending
2536
+ }), /* @__PURE__ */ jsx("span", {
2537
+ className: "inline-block first-letter:uppercase",
2538
+ children: pending
2539
+ })]
2540
+ })]
2540
2541
  });
2541
2542
  }
2542
2543
  //#endregion
@@ -2544,7 +2545,7 @@ function DiffActivityView({ changes, pending, onReview, branch }) {
2544
2545
  function WorktreesActivitySection(props) {
2545
2546
  const session = useStore(worktreeActivity.store, (state) => worktreeActivity.select(state, props.sessionId));
2546
2547
  return /* @__PURE__ */ jsxs("div", {
2547
- className: "flex min-w-0 flex-col gap-6",
2548
+ className: "flex min-w-0 flex-col gap-1",
2548
2549
  children: [/* @__PURE__ */ jsx(DiffActivitySection, { ...props }), /* @__PURE__ */ jsx(WorktreesActivityView, {
2549
2550
  worktrees: session.worktrees.filter((w) => w.sessionId !== props.sessionId),
2550
2551
  pending: session.pending,
@@ -2558,52 +2559,45 @@ function WorktreesActivitySection(props) {
2558
2559
  }
2559
2560
  function WorktreesActivityView({ worktrees, pending, onOpen, onCreate, startingIds = [] }) {
2560
2561
  return /* @__PURE__ */ jsxs("div", {
2561
- className: "rounded-lg border border-po-border-soft bg-po-panel p-4",
2562
- children: [
2563
- /* @__PURE__ */ jsx("h2", {
2564
- className: `${worktrees.length === 0 ? "mb-3" : "mb-2"} text-lg font-semibold text-po-hi`,
2565
- children: "Worktrees"
2566
- }),
2567
- pending && /* @__PURE__ */ jsxs("p", {
2568
- className: "flex items-center gap-2 text-sm text-po-dim",
2569
- children: [/* @__PURE__ */ jsx(Spinner, {
2570
- className: "size-3",
2571
- label: pending
2572
- }), /* @__PURE__ */ jsx("span", {
2573
- className: "inline-block first-letter:uppercase",
2574
- children: pending
2575
- })]
2576
- }),
2577
- worktrees.length === 0 ? /* @__PURE__ */ jsxs("div", {
2578
- className: "flex items-center justify-between",
2579
- children: [/* @__PURE__ */ jsx("span", {
2580
- "data-testid": "activity-summary-git",
2581
- className: "text-sm text-po-dim",
2582
- children: "Idle"
2583
- }), onCreate && /* @__PURE__ */ jsx(Button, {
2584
- variant: "link",
2585
- size: "sm",
2586
- "data-testid": "activity-git-create",
2587
- className: "text-po-blue",
2588
- onClick: onCreate,
2589
- children: "Create a worktree"
2590
- })]
2591
- }) : /* @__PURE__ */ jsx("div", {
2592
- "data-testid": "activity-git-worktrees",
2593
- children: worktrees.map((w) => /* @__PURE__ */ jsx(Button, {
2594
- variant: "ghost",
2595
- size: "card",
2596
- className: "block w-full min-w-0 p-0 text-left font-normal",
2597
- "data-testid": `activity-git-worktree-${w.id}`,
2598
- onClick: onOpen,
2599
- children: /* @__PURE__ */ jsx(WorktreeRow, {
2600
- compact: true,
2601
- worktree: w,
2602
- starting: startingIds.includes(w.id) || !!pending?.includes("starting") && w.sessionId === null && !w.orphaned && !w.unowned
2603
- })
2604
- }, w.id))
2605
- })
2606
- ]
2562
+ className: "flex min-w-0 flex-col gap-1",
2563
+ children: [pending && /* @__PURE__ */ jsxs("p", {
2564
+ className: "flex items-center gap-2 px-1 text-sm text-po-dim",
2565
+ children: [/* @__PURE__ */ jsx(Spinner, {
2566
+ className: "size-3",
2567
+ label: pending
2568
+ }), /* @__PURE__ */ jsx("span", {
2569
+ className: "inline-block first-letter:uppercase",
2570
+ children: pending
2571
+ })]
2572
+ }), worktrees.length === 0 ? onCreate ? /* @__PURE__ */ jsxs(Button, {
2573
+ variant: "link",
2574
+ size: "sm",
2575
+ "data-testid": "activity-git-create",
2576
+ className: "h-auto self-start gap-1 px-1 text-po-green",
2577
+ onClick: onCreate,
2578
+ children: ["Create a worktree", /* @__PURE__ */ jsx(ArrowRightIcon, {
2579
+ "aria-hidden": true,
2580
+ className: "size-3.5"
2581
+ })]
2582
+ }) : /* @__PURE__ */ jsx("span", {
2583
+ "data-testid": "activity-summary-git",
2584
+ className: "px-1 text-sm text-po-dim",
2585
+ children: "Idle"
2586
+ }) : /* @__PURE__ */ jsx("div", {
2587
+ "data-testid": "activity-git-worktrees",
2588
+ children: worktrees.map((w) => /* @__PURE__ */ jsx(Button, {
2589
+ variant: "ghost",
2590
+ size: "card",
2591
+ className: "block w-full min-w-0 p-0 text-left font-normal",
2592
+ "data-testid": `activity-git-worktree-${w.id}`,
2593
+ onClick: onOpen,
2594
+ children: /* @__PURE__ */ jsx(WorktreeRow, {
2595
+ compact: true,
2596
+ worktree: w,
2597
+ starting: startingIds.includes(w.id) || !!pending?.includes("starting") && w.sessionId === null && !w.orphaned && !w.unowned
2598
+ })
2599
+ }, w.id))
2600
+ })]
2607
2601
  });
2608
2602
  }
2609
2603
  //#endregion