@alivault/pico 0.7.0 → 0.7.2

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.
@@ -2,7 +2,7 @@ import { i as __toESM } from "../_runtime.mjs";
2
2
  import { A as DialogRoot, C as MenuPortal, D as TabsTab, E as TabsList$1, F as DialogBackdrop, I as Separator, K as mergeProps, L as Input, M as DialogPopup, N as DialogDescription$1, O as TabsRoot, P as DialogClose, R as Button, S as MenuPositioner, T as MenuItem, X as require_react, Y as require_jsx_runtime, _ as AccordionRoot, a as CollapsiblePanel, b as MenuSubmenuRoot, c as PopoverPopup, d as PopoverTrigger$1, f as PopoverRoot, g as AccordionItem$1, h as AccordionHeader, i as ContextMenuRoot, j as DialogPortal$1, k as DialogTitle$1, l as PopoverPositioner, m as AccordionTrigger$1, n as Toggle, o as CollapsibleTrigger$1, p as AccordionPanel, r as ContextMenuTrigger$1, s as CollapsibleRoot, t as ToggleGroup, u as PopoverPortal, v as MenuSubmenuTrigger, w as MenuPopup, x as MenuRoot, y as MenuTrigger, z as useRender } from "../_libs/@base-ui/react+[...].mjs";
3
3
  import { t as cva } from "../_libs/class-variance-authority+clsx.mjs";
4
4
  import { A as Command, C as Folder, D as EllipsisVertical, E as Ellipsis, F as ChevronRight, H as ArrowDown, I as ChevronDown, L as Check, M as ChevronsUpDown, N as ChevronsDownUp, O as Download, R as ArrowUp, S as GitCommitHorizontal, T as FileInput, V as ArrowLeft, _ as ListStart, b as ImagePlus, c as Settings2, d as PanelRight, f as PanelLeft, g as OctagonX, i as Undo2, k as Copy, l as Search, m as PanelLeftClose, n as WandSparkles, o as Square, p as PanelLeftOpen, r as Upload, s as SquarePen, t as X, u as Plus, v as ListEnd, w as FolderPlus, x as GitBranch, z as ArrowUpToLine } from "../_libs/lucide-react.mjs";
5
- import { $ as readStoredCenterMessages, A as TooltipTrigger, C as THEME_COLOR_MODE_STORAGE_KEY, D as Tooltip$1, E as TitleTooltip, F as cn, G as normalizePromptImage, H as flattenTree, J as normalizeThemeColorMode, K as normalizeSessionSelectionKeys, L as createContextId, M as appliedThemeClass, O as TooltipContent, P as buildItemsFromSync, Q as readStoredAutoScrollEnabled, R as createInitialSessionState, S as THEME_COLOR_MODES, T as THEME_STORAGE_KEY, U as getSessionTitle, X as previewUrlForImage, Y as normalizeThemeFamily, Z as promptDraftKey, _ as Route, _t as themeColorModeLabel, a as COLLAPSED_DIRECTORIES_STORAGE_KEY, at as readStoredRecentDirectories, b as SIDEBAR_DIRECTORIES_STORAGE_KEY, c as Kbd, ct as readStoredSessionDoneSoundEnabled, d as RECENT_DIRECTORIES_STORAGE_KEY, dt as readStoredThemeColorMode, et as readStoredCollapsedDirectories, f as RIGHT_SIDEBAR_ACTIVE_TAB_STORAGE_KEY, ft as rememberStoredPromptDraft, g as RIGHT_SIDEBAR_WIDTHS_STORAGE_KEY, gt as sessionListEntryKey, h as RIGHT_SIDEBAR_OPEN_STORAGE_KEY, ht as sameContextUsage, i as CENTER_MESSAGES_STORAGE_KEY, it as readStoredPromptDraft, j as VIEWER_CONTEXT_STORAGE_KEY, l as KeyboardShortcutContent, lt as readStoredSidebarDirectories, m as RIGHT_SIDEBAR_HISTORY_HEIGHT_STORAGE_KEY, mt as safeLocalStorageSetItem, n as APPLIED_THEME_STORAGE_KEY, nt as readStoredHideToolBlocks, o as DRAFT_DIRECTORY_STORAGE_KEY, ot as readStoredRightSidebarOpen, p as RIGHT_SIDEBAR_FILE_TREE_WIDTH_STORAGE_KEY, pt as safeLocalStorageGetItem, q as normalizeStoredDirectoryList, r as AUTO_SCROLL_ENABLED_STORAGE_KEY, rt as readStoredPinnedSessionKeys, s as HIDE_TOOL_BLOCKS_STORAGE_KEY, st as readStoredSessionDoneDesktopNotificationsEnabled, tt as readStoredDraftDirectory, u as PINNED_SESSIONS_STORAGE_KEY, ut as readStoredTheme, v as SESSION_DONE_DESKTOP_NOTIFICATIONS_ENABLED_STORAGE_KEY, vt as themeFamilyLabel, w as THEME_FAMILIES, x as Spinner, y as SESSION_DONE_SOUND_ENABLED_STORAGE_KEY, yt as thinkingSummaryText } from "./routes-BL4942vt.mjs";
5
+ import { $ as readStoredCenterMessages, A as TooltipTrigger, C as THEME_COLOR_MODE_STORAGE_KEY, D as Tooltip$1, E as TitleTooltip, F as cn, G as normalizePromptImage, H as flattenTree, J as normalizeThemeColorMode, K as normalizeSessionSelectionKeys, L as createContextId, M as appliedThemeClass, O as TooltipContent, P as buildItemsFromSync, Q as readStoredAutoScrollEnabled, R as createInitialSessionState, S as THEME_COLOR_MODES, T as THEME_STORAGE_KEY, U as getSessionTitle, X as previewUrlForImage, Y as normalizeThemeFamily, Z as promptDraftKey, _ as Route, _t as themeColorModeLabel, a as COLLAPSED_DIRECTORIES_STORAGE_KEY, at as readStoredRecentDirectories, b as SIDEBAR_DIRECTORIES_STORAGE_KEY, c as Kbd, ct as readStoredSessionDoneSoundEnabled, d as RECENT_DIRECTORIES_STORAGE_KEY, dt as readStoredThemeColorMode, et as readStoredCollapsedDirectories, f as RIGHT_SIDEBAR_ACTIVE_TAB_STORAGE_KEY, ft as rememberStoredPromptDraft, g as RIGHT_SIDEBAR_WIDTHS_STORAGE_KEY, gt as sessionListEntryKey, h as RIGHT_SIDEBAR_OPEN_STORAGE_KEY, ht as sameContextUsage, i as CENTER_MESSAGES_STORAGE_KEY, it as readStoredPromptDraft, j as VIEWER_CONTEXT_STORAGE_KEY, l as KeyboardShortcutContent, lt as readStoredSidebarDirectories, m as RIGHT_SIDEBAR_HISTORY_HEIGHT_STORAGE_KEY, mt as safeLocalStorageSetItem, n as APPLIED_THEME_STORAGE_KEY, nt as readStoredHideToolBlocks, o as DRAFT_DIRECTORY_STORAGE_KEY, ot as readStoredRightSidebarOpen, p as RIGHT_SIDEBAR_FILE_TREE_WIDTH_STORAGE_KEY, pt as safeLocalStorageGetItem, q as normalizeStoredDirectoryList, r as AUTO_SCROLL_ENABLED_STORAGE_KEY, rt as readStoredPinnedSessionKeys, s as HIDE_TOOL_BLOCKS_STORAGE_KEY, st as readStoredSessionDoneDesktopNotificationsEnabled, tt as readStoredDraftDirectory, u as PINNED_SESSIONS_STORAGE_KEY, ut as readStoredTheme, v as SESSION_DONE_DESKTOP_NOTIFICATIONS_ENABLED_STORAGE_KEY, vt as themeFamilyLabel, w as THEME_FAMILIES, x as Spinner, y as SESSION_DONE_SOUND_ENABLED_STORAGE_KEY, yt as thinkingSummaryText } from "./routes-qGUeuiKT.mjs";
6
6
  import { i as useQuery, n as useIsMutating, o as useQueryClient, r as useIsFetching, t as useMutation } from "../_libs/tanstack__react-query.mjs";
7
7
  import { t as useHotkeys } from "../_libs/tanstack__react-hotkeys.mjs";
8
8
  import { a as matchesKeyboardEvent, i as batch, o as formatForDisplay, r as createStore } from "../_libs/@tanstack/hotkeys+[...].mjs";
@@ -22,7 +22,7 @@ import { t as remarkGfm } from "../_libs/remark-gfm.mjs";
22
22
  import { a as getBuiltInSpriteSheet, i as getBuiltInFileIconColor, n as FileTree, r as createFileTreeIconResolver, t as useFileTree } from "../_libs/@pierre/trees+[...].mjs";
23
23
  import { a as closestCenter, d as useSensors, f as CSS$1, i as PointerSensor, n as DragOverlay, t as DndContext, u as useSensor } from "../_libs/@dnd-kit/core+[...].mjs";
24
24
  import { a as verticalListSortingStrategy, i as useSortable, n as arrayMove, r as horizontalListSortingStrategy, t as SortableContext } from "../_libs/dnd-kit__sortable.mjs";
25
- //#region node_modules/.nitro/vite/services/ssr/assets/routes-CzdAbU4z.js
25
+ //#region node_modules/.nitro/vite/services/ssr/assets/routes-gwl6FDoG.js
26
26
  var import_react = /* @__PURE__ */ __toESM(require_react());
27
27
  var import_jsx_runtime = require_jsx_runtime();
28
28
  var MOBILE_BREAKPOINT = 768;
@@ -717,6 +717,13 @@ function SidebarMenuButton({ render, isActive = false, variant = "default", size
717
717
  ...tooltip
718
718
  })] });
719
719
  }
720
+ var PICO_DIALOG_CLOSED_EVENT$1 = "pico:dialog-closed";
721
+ function dispatchDialogClosedEvent() {
722
+ if (typeof window === "undefined") return;
723
+ window.setTimeout(() => {
724
+ window.dispatchEvent(new CustomEvent(PICO_DIALOG_CLOSED_EVENT$1));
725
+ }, 160);
726
+ }
720
727
  function blurFocusedElementOutsideDialog() {
721
728
  if (typeof document === "undefined") return;
722
729
  const activeElement = document.activeElement;
@@ -729,6 +736,7 @@ function Dialog$1({ open, ...props }) {
729
736
  import_react.useLayoutEffect(() => {
730
737
  const nextOpen = open === true;
731
738
  if (nextOpen && !wasOpenRef.current) blurFocusedElementOutsideDialog();
739
+ if (!nextOpen && wasOpenRef.current) dispatchDialogClosedEvent();
732
740
  wasOpenRef.current = nextOpen;
733
741
  }, [open]);
734
742
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogRoot, {
@@ -919,10 +927,24 @@ function CommandShortcut({ className, children, ...props }) {
919
927
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(KeyboardShortcutContent, { children })
920
928
  });
921
929
  }
922
- function Drawer$1({ shouldScaleBackground = false, ...props }) {
930
+ var PICO_DIALOG_CLOSED_EVENT = "pico:dialog-closed";
931
+ function dispatchDrawerClosedEvent() {
932
+ if (typeof window === "undefined") return;
933
+ window.setTimeout(() => {
934
+ window.dispatchEvent(new CustomEvent(PICO_DIALOG_CLOSED_EVENT));
935
+ }, 160);
936
+ }
937
+ function Drawer$1({ shouldScaleBackground = false, open, ...props }) {
938
+ const wasOpenRef = import_react.useRef(open === true);
939
+ import_react.useLayoutEffect(() => {
940
+ const nextOpen = open === true;
941
+ if (!nextOpen && wasOpenRef.current) dispatchDrawerClosedEvent();
942
+ wasOpenRef.current = nextOpen;
943
+ }, [open]);
923
944
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Drawer.Root, {
924
945
  "data-slot": "drawer",
925
946
  shouldScaleBackground,
947
+ open,
926
948
  ...props
927
949
  });
928
950
  }
@@ -2283,11 +2305,6 @@ function formatSessionTime(value, now = Date.now()) {
2283
2305
  const years = Math.floor(days / 365);
2284
2306
  return `${Math.max(1, years)}y ${suffix}`;
2285
2307
  }
2286
- function formatSessionMessageCount(value) {
2287
- if (typeof value !== "number" || !Number.isFinite(value) || value < 0) return "";
2288
- const count = Math.floor(value);
2289
- return `${count.toLocaleString()} msg${count === 1 ? "" : "s"}`;
2290
- }
2291
2308
  function sessionActivityTime(entry) {
2292
2309
  const timestamp = entry.lastUserMessageAt || entry.modified;
2293
2310
  if (!timestamp) return 0;
@@ -2325,8 +2342,7 @@ function sessionSearchKeywords(entry, directory) {
2325
2342
  entry.name,
2326
2343
  entry.path,
2327
2344
  entry.cwd,
2328
- directory,
2329
- formatSessionMessageCount(entry.messageCount)
2345
+ directory
2330
2346
  ].filter(Boolean);
2331
2347
  }
2332
2348
  function isActiveSession(entry, activeSessionId, activeSessionPath) {
@@ -2526,7 +2542,7 @@ function AppShellSessionsDialog({ open, onOpenChange, viewerContextId, currentDi
2526
2542
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(CommandList, {
2527
2543
  className: "max-h-none min-h-0 flex-1 md:max-h-[min(70vh,32rem)]",
2528
2544
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CommandEmpty, { children: loading ? "Loading sessions…" : "No sessions found." }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(CommandGroup, {
2529
- heading: `${scope === "all" ? "All sessions" : `Current directory · ${tildePath$1(currentDirectories[0] || "")}`}${loading ? " · loading" : ""}`,
2545
+ heading: `${scope === "all" ? "All sessions" : `Current directory: ${tildePath$1(currentDirectories[0] || "")}`}${loading ? " · loading" : ""}`,
2530
2546
  children: [loading && sortedSessionItems.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(CommandItem, {
2531
2547
  value: "loading:sessions",
2532
2548
  disabled: true,
@@ -2537,7 +2553,6 @@ function AppShellSessionsDialog({ open, onOpenChange, viewerContextId, currentDi
2537
2553
  }) : null, sortedSessionItems.map(({ directory, entry }) => {
2538
2554
  const entryKey = sessionListEntryKey(entry);
2539
2555
  const sessionTime = formatSessionTime(entry.lastUserMessageAt || entry.modified);
2540
- const messageCount = formatSessionMessageCount(entry.messageCount);
2541
2556
  const active = isActiveSession(entry, activeSessionId, activeSessionPath);
2542
2557
  const showUnread = Boolean(entry.unread) && !entry.streaming;
2543
2558
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(CommandItem, {
@@ -2558,28 +2573,23 @@ function AppShellSessionsDialog({ open, onOpenChange, viewerContextId, currentDi
2558
2573
  }),
2559
2574
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2560
2575
  className: "flex min-w-0 flex-1 flex-col gap-0.5",
2561
- children: [
2562
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2563
- className: "truncate font-medium",
2564
- children: entry.title
2565
- }),
2566
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2567
- className: "line-clamp-1 text-xs text-muted-foreground",
2568
- children: tildePath$1(entry.cwd || directory)
2569
- }),
2570
- sessionTime || messageCount ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
2571
- className: "truncate text-[11px] text-muted-foreground/70",
2572
- children: [
2573
- sessionTime,
2574
- sessionTime && messageCount ? " · " : null,
2575
- messageCount
2576
- ]
2577
- }) : null
2578
- ]
2576
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2577
+ className: "truncate font-medium",
2578
+ children: entry.title
2579
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2580
+ className: "line-clamp-1 text-xs text-muted-foreground",
2581
+ children: tildePath$1(entry.cwd || directory)
2582
+ })]
2579
2583
  }),
2580
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CommandShortcut, {
2581
- className: cn("shrink-0 tracking-normal normal-case", !active && "opacity-0"),
2582
- children: "Current"
2584
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2585
+ className: "flex shrink-0 flex-col items-end gap-1",
2586
+ children: [sessionTime ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2587
+ className: "truncate text-[11px] text-muted-foreground/70",
2588
+ children: sessionTime
2589
+ }) : null, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CommandShortcut, {
2590
+ className: cn("ml-0 shrink-0 tracking-normal normal-case", !active && "opacity-0"),
2591
+ children: "Current"
2592
+ })]
2583
2593
  })
2584
2594
  ]
2585
2595
  }, entryKey);
@@ -7432,7 +7442,7 @@ function DropdownMenuShortcut({ className, children, ...props }) {
7432
7442
  function visibleCompletionLabel(item) {
7433
7443
  return item.label || item.value;
7434
7444
  }
7435
- function ComposerAssistMenu({ visibleCompletion, slashMenuState, slashSelectionStore, onHoverCompletion, onApplyCompletion, onHoverSlashCommand, onApplySlashSuggestion }) {
7445
+ function ComposerAssistMenu({ visibleCompletion, slashMenuState, slashSelectionStore, pointerSelectionSuppressed, onHoverCompletion, onMoveCompletion, onApplyCompletion, onHoverSlashCommand, onMoveSlashCommand, onApplySlashSuggestion }) {
7436
7446
  const scrollAreaRef = import_react.useRef(null);
7437
7447
  const slashSelectionIndex = import_react.useSyncExternalStore(slashSelectionStore.subscribe, slashSelectionStore.getSnapshot, slashSelectionStore.getSnapshot);
7438
7448
  const selectedIndex = visibleCompletion ? visibleCompletion.selectedIndex : slashSelectionIndex;
@@ -7454,17 +7464,20 @@ function ComposerAssistMenu({ visibleCompletion, slashMenuState, slashSelectionS
7454
7464
  children: [
7455
7465
  visibleCompletion.items.map((item, index) => {
7456
7466
  const selected = index === visibleCompletion.selectedIndex;
7457
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
7467
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
7458
7468
  type: "button",
7459
7469
  "data-composer-assist-selected": selected ? "true" : void 0,
7460
- className: cn("flex w-full items-start gap-2 rounded-md px-2 py-1.5 text-left text-sm", selected ? "bg-muted" : "hover:bg-muted/70"),
7470
+ className: cn("flex w-full items-start gap-2 rounded-md px-2 py-1.5 text-left text-sm", selected ? "bg-muted" : pointerSelectionSuppressed ? "" : "hover:bg-muted/70"),
7461
7471
  onMouseEnter: () => {
7462
7472
  onHoverCompletion(index);
7463
7473
  },
7474
+ onMouseMove: () => {
7475
+ onMoveCompletion(index);
7476
+ },
7464
7477
  onClick: () => {
7465
7478
  onApplyCompletion(item);
7466
7479
  },
7467
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
7480
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
7468
7481
  className: "min-w-0 flex-1",
7469
7482
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
7470
7483
  className: "block truncate font-medium",
@@ -7473,7 +7486,7 @@ function ComposerAssistMenu({ visibleCompletion, slashMenuState, slashSelectionS
7473
7486
  className: "block truncate text-xs text-muted-foreground",
7474
7487
  children: item.description
7475
7488
  }) : null]
7476
- }), selected ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Check, { className: "mt-0.5 shrink-0" }) : null]
7489
+ })
7477
7490
  }, `${item.value}:${item.description || item.label}`);
7478
7491
  }),
7479
7492
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Separator$1, {}),
@@ -7486,17 +7499,20 @@ function ComposerAssistMenu({ visibleCompletion, slashMenuState, slashSelectionS
7486
7499
  className: "flex flex-col gap-1",
7487
7500
  children: slashMenuState.commands.map((command, index) => {
7488
7501
  const selected = index === slashSelectionIndex;
7489
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
7502
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
7490
7503
  type: "button",
7491
7504
  "data-composer-assist-selected": selected ? "true" : void 0,
7492
- className: cn("flex w-full items-start gap-2 rounded-md px-2 py-1.5 text-left text-sm", selected ? "bg-muted" : "hover:bg-muted/70"),
7505
+ className: cn("flex w-full items-start gap-2 rounded-md px-2 py-1.5 text-left text-sm", selected ? "bg-muted" : pointerSelectionSuppressed ? "" : "hover:bg-muted/70"),
7493
7506
  onMouseEnter: () => {
7494
7507
  onHoverSlashCommand(index);
7495
7508
  },
7509
+ onMouseMove: () => {
7510
+ onMoveSlashCommand(index);
7511
+ },
7496
7512
  onClick: () => {
7497
7513
  onApplySlashSuggestion(command);
7498
7514
  },
7499
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
7515
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
7500
7516
  className: "min-w-0 flex-1",
7501
7517
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
7502
7518
  className: "block truncate font-medium",
@@ -7505,7 +7521,7 @@ function ComposerAssistMenu({ visibleCompletion, slashMenuState, slashSelectionS
7505
7521
  className: "block truncate text-xs text-muted-foreground",
7506
7522
  children: command.description
7507
7523
  }) : null]
7508
- }), selected ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Check, { className: "mt-0.5 shrink-0" }) : null]
7524
+ })
7509
7525
  }, command.name);
7510
7526
  })
7511
7527
  }) : null
@@ -11153,6 +11169,8 @@ var ComposerPromptEditor = import_react.memo(function ComposerPromptEditor({ com
11153
11169
  const [draftSkill, setDraftSkill] = import_react.useState(composerSkill);
11154
11170
  const [hasDraftText, setHasDraftText] = import_react.useState(hasDraftTextRef.current);
11155
11171
  const refreshAssistStateRef = import_react.useRef(() => {});
11172
+ const assistPointerSelectionSuppressedRef = import_react.useRef(false);
11173
+ const [assistPointerSelectionSuppressed, setAssistPointerSelectionSuppressed] = import_react.useState(false);
11156
11174
  const syncDraftToParent = (text, skillName) => {
11157
11175
  onComposerTextChange(serializeComposerDraft({
11158
11176
  text,
@@ -11224,6 +11242,10 @@ var ComposerPromptEditor = import_react.memo(function ComposerPromptEditor({ com
11224
11242
  ]);
11225
11243
  const hasSubmittableContent = hasDraftText || composerImages.length > 0;
11226
11244
  const acceptFollowUps = isStreaming || awaitingFirstTurn;
11245
+ const setAssistPointerSelectionSuppressedValue = (next) => {
11246
+ assistPointerSelectionSuppressedRef.current = next;
11247
+ setAssistPointerSelectionSuppressed(next);
11248
+ };
11227
11249
  const blockInitialSubmit = isSubmitting && !acceptFollowUps;
11228
11250
  const handleComposerMouseDown = (event) => {
11229
11251
  const target = event.target;
@@ -11296,11 +11318,13 @@ var ComposerPromptEditor = import_react.memo(function ComposerPromptEditor({ com
11296
11318
  }
11297
11319
  if (visibleCompletion && (event.key === "ArrowDown" || event.key === "ArrowUp")) {
11298
11320
  event.preventDefault();
11321
+ setAssistPointerSelectionSuppressedValue(true);
11299
11322
  moveCompletionSelection(event.key === "ArrowDown" ? 1 : -1);
11300
11323
  return;
11301
11324
  }
11302
11325
  if (slashMenuState && !visibleCompletion && (event.key === "ArrowDown" || event.key === "ArrowUp")) {
11303
11326
  event.preventDefault();
11327
+ setAssistPointerSelectionSuppressedValue(true);
11304
11328
  moveSlashSelection(event.key === "ArrowDown" ? 1 : -1);
11305
11329
  return;
11306
11330
  }
@@ -11308,11 +11332,15 @@ var ComposerPromptEditor = import_react.memo(function ComposerPromptEditor({ com
11308
11332
  const direction = moveDownShortcut ? 1 : -1;
11309
11333
  if (visibleCompletion) {
11310
11334
  event.preventDefault();
11335
+ event.stopPropagation();
11336
+ setAssistPointerSelectionSuppressedValue(true);
11311
11337
  moveCompletionSelection(direction);
11312
11338
  return;
11313
11339
  }
11314
11340
  if (slashMenuState) {
11315
11341
  event.preventDefault();
11342
+ event.stopPropagation();
11343
+ setAssistPointerSelectionSuppressedValue(true);
11316
11344
  moveSlashSelection(direction);
11317
11345
  }
11318
11346
  }
@@ -11355,6 +11383,22 @@ var ComposerPromptEditor = import_react.memo(function ComposerPromptEditor({ com
11355
11383
  }
11356
11384
  if (event.key === "ArrowUp" && !visibleCompletion && !slashMenuState && !draftText && currentDraftSkill && selectionIsAtStart(promptRef.current)) applyDraft("", void 0, { immediate: true });
11357
11385
  };
11386
+ const handleHoverCompletion = (index) => {
11387
+ if (assistPointerSelectionSuppressedRef.current) return;
11388
+ selectCompletionIndex(index);
11389
+ };
11390
+ const handleMoveCompletion = (index) => {
11391
+ setAssistPointerSelectionSuppressedValue(false);
11392
+ selectCompletionIndex(index);
11393
+ };
11394
+ const handleHoverSlashCommand = (index) => {
11395
+ if (assistPointerSelectionSuppressedRef.current) return;
11396
+ selectSlashIndex(index);
11397
+ };
11398
+ const handleMoveSlashCommand = (index) => {
11399
+ setAssistPointerSelectionSuppressedValue(false);
11400
+ selectSlashIndex(index);
11401
+ };
11358
11402
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
11359
11403
  className: "relative min-h-[90px] cursor-text overflow-visible rounded-t-[18px] border-b border-border/70 bg-card px-3 pt-3 pb-14",
11360
11404
  onMouseDown: handleComposerMouseDown,
@@ -11365,9 +11409,12 @@ var ComposerPromptEditor = import_react.memo(function ComposerPromptEditor({ com
11365
11409
  visibleCompletion,
11366
11410
  slashMenuState,
11367
11411
  slashSelectionStore,
11368
- onHoverCompletion: selectCompletionIndex,
11412
+ pointerSelectionSuppressed: assistPointerSelectionSuppressed,
11413
+ onHoverCompletion: handleHoverCompletion,
11414
+ onMoveCompletion: handleMoveCompletion,
11369
11415
  onApplyCompletion: applyCompletion,
11370
- onHoverSlashCommand: selectSlashIndex,
11416
+ onHoverSlashCommand: handleHoverSlashCommand,
11417
+ onMoveSlashCommand: handleMoveSlashCommand,
11371
11418
  onApplySlashSuggestion: applySlashSuggestion
11372
11419
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
11373
11420
  className: "min-w-0",
@@ -14820,7 +14867,7 @@ var GIT_GRAPH_LANE_COLORS = [
14820
14867
  "#14b8a6"
14821
14868
  ];
14822
14869
  var GIT_GRAPH_NULL_VERTEX_ID = -1;
14823
- var GIT_GRAPH_ROW_HEIGHT = 20;
14870
+ var GIT_GRAPH_ROW_HEIGHT = 32;
14824
14871
  var GIT_GRAPH_COMMIT_DETAILS_HEIGHT = 150;
14825
14872
  var GIT_GRAPH_LANE_WIDTH = 14;
14826
14873
  var GIT_GRAPH_OFFSET_X = 12;
@@ -15106,7 +15153,7 @@ function GitCommitRow({ graphWidth, line, value }) {
15106
15153
  });
15107
15154
  };
15108
15155
  if (!parsed.hash && !parsed.subject) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
15109
- className: "flex h-5 max-w-full min-w-0 items-center font-mono text-[13px] leading-5",
15156
+ className: "flex h-8 max-w-full min-w-0 items-center font-mono text-[13px] leading-5",
15110
15157
  children: parsed.subject ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
15111
15158
  className: "min-w-0 flex-1 truncate text-foreground",
15112
15159
  children: parsed.subject
@@ -15117,7 +15164,7 @@ function GitCommitRow({ graphWidth, line, value }) {
15117
15164
  className: "border-0",
15118
15165
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ContextMenu$1, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ContextMenuTrigger, { render: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AccordionTrigger, {
15119
15166
  headerClassName: "min-w-0",
15120
- className: "h-5 min-h-5 w-full items-center gap-2 rounded-none px-1.5 py-0 font-mono text-[13px] leading-5 font-normal transition-colors hover:bg-muted/50 hover:text-foreground hover:no-underline focus-visible:ring-0 aria-expanded:bg-muted aria-expanded:text-foreground **:data-[slot=accordion-trigger-icon]:size-4",
15167
+ className: "h-8 min-h-8 w-full items-center gap-2 rounded-none px-1.5 py-0 font-mono text-[13px] leading-5 font-normal transition-colors hover:bg-muted/50 hover:text-foreground hover:no-underline focus-visible:ring-0 aria-expanded:bg-muted aria-expanded:text-foreground **:data-[slot=accordion-trigger-icon]:size-4",
15121
15168
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
15122
15169
  className: "min-w-0 flex-1 truncate text-foreground",
15123
15170
  style: { paddingLeft: graphWidth },
@@ -15784,6 +15831,18 @@ function ReviewFileAccordionItem({ viewerContextId, cwd, active, diffStyle, file
15784
15831
  }
15785
15832
  });
15786
15833
  const actionPending = stageMutation.isPending || discardMutation.isPending;
15834
+ const openFile = (event) => {
15835
+ event?.stopPropagation();
15836
+ onOpenFile?.(file.path, { pin: true });
15837
+ };
15838
+ const discardFileChanges = (event) => {
15839
+ event?.stopPropagation();
15840
+ discardMutation.mutate();
15841
+ };
15842
+ const stageFileChanges = (event) => {
15843
+ event?.stopPropagation();
15844
+ stageMutation.mutate();
15845
+ };
15787
15846
  import_react.useEffect(() => {
15788
15847
  setFullContextRequested(false);
15789
15848
  }, [value]);
@@ -15828,7 +15887,7 @@ function ReviewFileAccordionItem({ viewerContextId, cwd, active, diffStyle, file
15828
15887
  })
15829
15888
  ]
15830
15889
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
15831
- className: "mr-2 flex self-center overflow-hidden rounded-lg border border-border/70 bg-card/80 shadow-sm",
15890
+ className: "mr-2 hidden self-center overflow-hidden rounded-lg border border-border/70 bg-card/80 shadow-sm md:flex",
15832
15891
  children: [
15833
15892
  onOpenFile ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TitleTooltip, {
15834
15893
  title: "Open file",
@@ -15839,10 +15898,7 @@ function ReviewFileAccordionItem({ viewerContextId, cwd, active, diffStyle, file
15839
15898
  size: "icon-xs",
15840
15899
  "aria-label": `Open ${file.path}`,
15841
15900
  className: "rounded-none border-0",
15842
- onClick: (event) => {
15843
- event.stopPropagation();
15844
- onOpenFile(file.path, { pin: true });
15845
- },
15901
+ onClick: openFile,
15846
15902
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FileInput, { className: "size-3.5" })
15847
15903
  })
15848
15904
  }) : null,
@@ -15856,10 +15912,7 @@ function ReviewFileAccordionItem({ viewerContextId, cwd, active, diffStyle, file
15856
15912
  "aria-label": `Discard changes to ${file.path}`,
15857
15913
  className: "rounded-none border-0 border-l border-border/70 text-muted-foreground hover:text-destructive",
15858
15914
  disabled: actionPending || !viewerContextId || !normalizedCwd,
15859
- onClick: (event) => {
15860
- event.stopPropagation();
15861
- discardMutation.mutate();
15862
- },
15915
+ onClick: discardFileChanges,
15863
15916
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Undo2, { className: "size-3.5" })
15864
15917
  })
15865
15918
  }),
@@ -15873,18 +15926,45 @@ function ReviewFileAccordionItem({ viewerContextId, cwd, active, diffStyle, file
15873
15926
  "aria-label": `Stage changes to ${file.path}`,
15874
15927
  className: "rounded-none border-0 border-l border-border/70 text-muted-foreground hover:text-emerald-500",
15875
15928
  disabled: actionPending || !canStage || !viewerContextId || !normalizedCwd,
15876
- onClick: (event) => {
15877
- event.stopPropagation();
15878
- stageMutation.mutate();
15879
- },
15929
+ onClick: stageFileChanges,
15880
15930
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Plus, { className: "size-3.5" })
15881
15931
  })
15882
15932
  })
15883
15933
  ]
15884
15934
  })]
15885
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AccordionContent, {
15935
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(AccordionContent, {
15886
15936
  className: "bg-background p-0",
15887
- children: previewPatch ? diffQuery.isPending && !diffQuery.data ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
15937
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
15938
+ className: "flex gap-2 border-b border-border/70 bg-card/40 p-2 md:hidden",
15939
+ children: [
15940
+ onOpenFile ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Button$1, {
15941
+ type: "button",
15942
+ variant: "outline",
15943
+ "aria-label": `Open ${file.path}`,
15944
+ className: "min-w-0 flex-1",
15945
+ onClick: openFile,
15946
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(FileInput, { className: "size-3.5" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Open file" })]
15947
+ }) : null,
15948
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Button$1, {
15949
+ type: "button",
15950
+ variant: "outline",
15951
+ "aria-label": `Discard changes to ${file.path}`,
15952
+ className: "min-w-0 flex-1 text-muted-foreground hover:text-destructive",
15953
+ disabled: actionPending || !viewerContextId || !normalizedCwd,
15954
+ onClick: discardFileChanges,
15955
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Undo2, { className: "size-3.5" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Discard" })]
15956
+ }),
15957
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Button$1, {
15958
+ type: "button",
15959
+ variant: "outline",
15960
+ "aria-label": `Stage changes to ${file.path}`,
15961
+ className: "min-w-0 flex-1 text-muted-foreground hover:text-emerald-500",
15962
+ disabled: actionPending || !canStage || !viewerContextId || !normalizedCwd,
15963
+ onClick: stageFileChanges,
15964
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Plus, { className: "size-3.5" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Stage" })]
15965
+ })
15966
+ ]
15967
+ }), previewPatch ? diffQuery.isPending && !diffQuery.data ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
15888
15968
  className: "p-3",
15889
15969
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(GitSectionNote, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spinner, {}), " Loading hunk…"] })
15890
15970
  }) : diffQuery.error ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
@@ -15941,7 +16021,7 @@ function ReviewFileAccordionItem({ viewerContextId, cwd, active, diffStyle, file
15941
16021
  }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
15942
16022
  className: "p-3",
15943
16023
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(GitSectionNote, { children: "No line changes." })
15944
- })
16024
+ })]
15945
16025
  })]
15946
16026
  });
15947
16027
  }
@@ -20222,7 +20302,7 @@ function useAppShellShortcuts({ addDirectoryOpenRef, commandPaletteOpenRef, comp
20222
20302
  const handleGlobalShortcut = (event) => {
20223
20303
  const key = event.altKey && event.code.startsWith("Key") ? event.code.slice(3).toLowerCase() : event.key.toLowerCase();
20224
20304
  const context = getShortcutContext(event);
20225
- if (context.blockingModalOpen) return;
20305
+ if (context.blockingModalOpen || event.defaultPrevented) return;
20226
20306
  if (key === "\\") {
20227
20307
  event.preventDefault();
20228
20308
  closeCommandPaletteForShortcut(context.commandPaletteOpen);
@@ -21228,6 +21308,30 @@ var AppShellSessionWorkspace = import_react.forwardRef(function AppShellSessionW
21228
21308
  composerPanelRef.current?.openModelPicker();
21229
21309
  };
21230
21310
  const focusPromptRef = useLatestRef(focusPrompt);
21311
+ const promptFocusAfterDialogCloseTimeoutRef = import_react.useRef(null);
21312
+ import_react.useEffect(() => {
21313
+ const hasOpenDialogSurface = () => {
21314
+ if (addDirectoryOpenRef.current || authOpenRef.current || commandPaletteOpenRef.current || deleteOldDirectorySessionsOpenRef.current || deleteOpenRef.current || forkOpenRef.current || gitCommitOpenRef.current || renameOpenRef.current || sessionsOpenRef.current || settingsOpenRef.current || treeOpenRef.current || uiRequestOpenRef.current) return true;
21315
+ if (typeof document === "undefined") return false;
21316
+ return Boolean(document.querySelector("[data-slot=\"dialog-content\"][data-open], [data-slot=\"drawer-content\"][data-state=\"open\"]"));
21317
+ };
21318
+ const handleDialogClosed = () => {
21319
+ if (promptFocusAfterDialogCloseTimeoutRef.current !== null) window.clearTimeout(promptFocusAfterDialogCloseTimeoutRef.current);
21320
+ promptFocusAfterDialogCloseTimeoutRef.current = window.setTimeout(() => {
21321
+ promptFocusAfterDialogCloseTimeoutRef.current = null;
21322
+ if (hasOpenDialogSurface()) return;
21323
+ focusPromptRef.current();
21324
+ }, 0);
21325
+ };
21326
+ window.addEventListener("pico:dialog-closed", handleDialogClosed);
21327
+ return () => {
21328
+ window.removeEventListener("pico:dialog-closed", handleDialogClosed);
21329
+ if (promptFocusAfterDialogCloseTimeoutRef.current !== null) {
21330
+ window.clearTimeout(promptFocusAfterDialogCloseTimeoutRef.current);
21331
+ promptFocusAfterDialogCloseTimeoutRef.current = null;
21332
+ }
21333
+ };
21334
+ }, [focusPromptRef]);
21231
21335
  const [promptFocusRequest, setPromptFocusRequest] = import_react.useState({
21232
21336
  sessionId: "",
21233
21337
  nonce: 0
@@ -5,7 +5,7 @@ import { n as clsx } from "../_libs/class-variance-authority+clsx.mjs";
5
5
  import { t as twMerge } from "../_libs/tailwind-merge.mjs";
6
6
  import { A as Command, B as ArrowRight, H as ArrowDown, P as ChevronUp, R as ArrowUp, U as ArrowBigUp, V as ArrowLeft, h as Option } from "../_libs/lucide-react.mjs";
7
7
  import { n as string, t as object } from "../_libs/zod.mjs";
8
- //#region node_modules/.nitro/vite/services/ssr/assets/routes-BL4942vt.js
8
+ //#region node_modules/.nitro/vite/services/ssr/assets/routes-qGUeuiKT.js
9
9
  var import_react = /* @__PURE__ */ __toESM(require_react());
10
10
  var import_jsx_runtime = require_jsx_runtime();
11
11
  function cn(...inputs) {
@@ -1324,7 +1324,7 @@ function getSessionTitle(summary) {
1324
1324
  if (summary?.name?.trim()) return summary.name.trim();
1325
1325
  return "New session";
1326
1326
  }
1327
- var $$splitComponentImporter = () => import("./routes-CzdAbU4z.mjs");
1327
+ var $$splitComponentImporter = () => import("./routes-gwl6FDoG.mjs");
1328
1328
  var indexSearchSchema = object({ session: string().optional() });
1329
1329
  var Route = createFileRoute("/")({
1330
1330
  validateSearch: indexSearchSchema,
@@ -3813,7 +3813,7 @@ var defaultSerovalPlugins = [
3813
3813
  * the dev styles URL for route-scoped CSS collection.
3814
3814
  */
3815
3815
  async function getStartManifest(matchedRoutes) {
3816
- const { tsrStartManifest } = await import("../_tanstack-start-manifest_v-BdpuecpN.mjs");
3816
+ const { tsrStartManifest } = await import("../_tanstack-start-manifest_v-DEzOqkPh.mjs");
3817
3817
  const startManifest = tsrStartManifest();
3818
3818
  const rootRoute = startManifest.routes[rootRouteId] = startManifest.routes["__root__"] || {};
3819
3819
  rootRoute.assets = rootRoute.assets || [];
@@ -4799,7 +4799,7 @@ var baseManifestPromise;
4799
4799
  var cachedFinalManifestPromise;
4800
4800
  async function loadEntries() {
4801
4801
  const [routerEntry, startEntry, pluginAdapters] = await Promise.all([
4802
- import("./router-COJfGnhB.mjs"),
4802
+ import("./router-BK-D6up1.mjs"),
4803
4803
  import("./start-Captdpmb.mjs"),
4804
4804
  import("../__23tanstack-start-plugin-adapters-y_fshQDY.mjs")
4805
4805
  ]);
@@ -1,4 +1,4 @@
1
- //#region node_modules/.nitro/vite/services/ssr/assets/_tanstack-start-manifest_v-BdpuecpN.js
1
+ //#region node_modules/.nitro/vite/services/ssr/assets/_tanstack-start-manifest_v-DEzOqkPh.js
2
2
  var tsrStartManifest = () => ({
3
3
  routes: {
4
4
  __root__: {
@@ -52,16 +52,16 @@ var tsrStartManifest = () => ({
52
52
  "/api/ui/$id"
53
53
  ],
54
54
  assets: void 0,
55
- preloads: ["/assets/index-BUBmoV8I.js", "/assets/rolldown-runtime-S-ySWqyJ.js"]
55
+ preloads: ["/assets/index-C9EusdpB.js", "/assets/rolldown-runtime-S-ySWqyJ.js"]
56
56
  },
57
57
  "/": {
58
58
  filePath: "/home/runner/work/pico/pico/src/routes/index.tsx",
59
59
  children: void 0,
60
60
  assets: void 0,
61
- preloads: ["/assets/routes-HoM1cKp5.js"]
61
+ preloads: ["/assets/routes-BiyosNnj.js"]
62
62
  }
63
63
  },
64
- clientEntry: "/assets/index-BUBmoV8I.js"
64
+ clientEntry: "/assets/index-C9EusdpB.js"
65
65
  });
66
66
  //#endregion
67
67
  export { tsrStartManifest };