@alivault/pico 0.6.0 → 0.7.0

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,8 +1,8 @@
1
1
  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
- import { A as ChevronsUpDown, B as ArrowDown, C as FolderPlus, D as Copy, E as Download, F as Check, I as ArrowUp, L as ArrowUpToLine, N as ChevronRight, O as Command, P as ChevronDown, S as Folder, T as EllipsisVertical, _ as ListEnd, a as Square, b as GitBranch, c as Settings2, d as PanelLeft, f as PanelLeftOpen, g as ListStart, h as OctagonX, j as ChevronsDownUp, l as Search, n as WandSparkles, o as SquarePen, p as PanelLeftClose, r as Upload, s as SquareArrowOutUpRight, t as X, u as PanelRight, w as Ellipsis, x as GitCommitHorizontal, y as ImagePlus, z as ArrowLeft } 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-BpP7WwMR.mjs";
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";
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-BZ9cdmtL.js
25
+ //#region node_modules/.nitro/vite/services/ssr/assets/routes-CzdAbU4z.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;
@@ -2815,12 +2815,13 @@ function settingsCommandFilter(value, search, keywords) {
2815
2815
  if (!query) return 1;
2816
2816
  return [value, ...keywords ?? []].join(" ").toLowerCase().includes(query) ? 1 : 0;
2817
2817
  }
2818
- function AppShellSettingsDialog({ open, onOpenChange, currentTheme, currentThemeColorMode, onThemeChange, onThemeColorModeChange, systemTheme, hideThinkingBlocks, onHideThinkingBlocksChange, hideToolBlocks, onHideToolBlocksChange, centerMessages, onCenterMessagesChange, autoScrollEnabled, onAutoScrollEnabledChange, sessionDoneSoundEnabled, onSessionDoneSoundEnabledChange, sessionDoneDesktopNotificationsEnabled, onSessionDoneDesktopNotificationsEnabledChange, desktopNotificationPermission, onLoginProviders, onLogoutProviders }) {
2818
+ function AppShellSettingsDialog({ open, onOpenChange, currentTheme, currentThemeColorMode, onThemeChange, onThemeColorModeChange, onThemePreviewChange, systemTheme, hideThinkingBlocks, onHideThinkingBlocksChange, hideToolBlocks, onHideToolBlocksChange, centerMessages, onCenterMessagesChange, autoScrollEnabled, onAutoScrollEnabledChange, sessionDoneSoundEnabled, onSessionDoneSoundEnabledChange, sessionDoneDesktopNotificationsEnabled, onSessionDoneDesktopNotificationsEnabledChange, desktopNotificationPermission, onLoginProviders, onLogoutProviders }) {
2819
2819
  const [query, setQuery] = import_react.useState("");
2820
2820
  const [themeQuery, setThemeQuery] = import_react.useState("");
2821
2821
  const [stage, setStage] = import_react.useState("browse");
2822
2822
  const [selectedCommandId, setSelectedCommandId] = import_react.useState("theme");
2823
2823
  const [selectedTheme, setSelectedTheme] = import_react.useState(currentTheme);
2824
+ const themePreviewInitialRef = import_react.useRef(currentTheme);
2824
2825
  const isMobile = useIsMobile();
2825
2826
  const desktopNotificationDescription = desktopNotificationPermissionLabel(desktopNotificationPermission);
2826
2827
  const settingGroups = [
@@ -2837,7 +2838,11 @@ function AppShellSettingsDialog({ open, onOpenChange, currentTheme, currentTheme
2837
2838
  "default",
2838
2839
  "flexoki"
2839
2840
  ],
2840
- onSelect: () => setStage("theme")
2841
+ onSelect: () => {
2842
+ themePreviewInitialRef.current = currentTheme;
2843
+ setSelectedTheme(currentTheme);
2844
+ setStage("theme");
2845
+ }
2841
2846
  }, {
2842
2847
  id: "theme-color-mode",
2843
2848
  title: "Light/dark mode",
@@ -2974,15 +2979,16 @@ function AppShellSettingsDialog({ open, onOpenChange, currentTheme, currentTheme
2974
2979
  }
2975
2980
  ];
2976
2981
  import_react.useEffect(() => {
2977
- if (!open) {
2978
- if (query) setQuery("");
2979
- if (themeQuery) setThemeQuery("");
2980
- setStage("browse");
2981
- return;
2982
- }
2982
+ if (open) return;
2983
+ if (stage === "theme") onThemePreviewChange(themePreviewInitialRef.current);
2984
+ if (query) setQuery("");
2985
+ if (themeQuery) setThemeQuery("");
2986
+ setStage("browse");
2983
2987
  }, [
2988
+ onThemePreviewChange,
2984
2989
  open,
2985
2990
  query,
2991
+ stage,
2986
2992
  themeQuery
2987
2993
  ]);
2988
2994
  import_react.useEffect(() => {
@@ -2993,10 +2999,22 @@ function AppShellSettingsDialog({ open, onOpenChange, currentTheme, currentTheme
2993
2999
  console.error(error);
2994
3000
  });
2995
3001
  };
3002
+ const handleThemePreview = (theme) => {
3003
+ if (!THEME_OPTIONS.includes(theme)) return;
3004
+ setSelectedTheme(theme);
3005
+ onThemePreviewChange(theme);
3006
+ };
2996
3007
  const handleThemeSelect = (theme) => {
2997
3008
  setSelectedTheme(theme);
3009
+ themePreviewInitialRef.current = theme;
2998
3010
  onThemeChange(theme);
2999
3011
  };
3012
+ const cancelThemePreview = () => {
3013
+ const initialTheme = themePreviewInitialRef.current;
3014
+ setSelectedTheme(initialTheme);
3015
+ onThemePreviewChange(initialTheme);
3016
+ setStage("browse");
3017
+ };
3000
3018
  const settingsBrowseBody = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Command$1, {
3001
3019
  shouldFilter: true,
3002
3020
  filter: settingsCommandFilter,
@@ -3049,7 +3067,7 @@ function AppShellSettingsDialog({ open, onOpenChange, currentTheme, currentTheme
3049
3067
  if (event.key !== "Escape") return;
3050
3068
  event.preventDefault();
3051
3069
  event.stopPropagation();
3052
- setStage("browse");
3070
+ cancelThemePreview();
3053
3071
  },
3054
3072
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3055
3073
  className: "flex items-center gap-2 border-b border-border/70 px-3 py-2",
@@ -3057,7 +3075,7 @@ function AppShellSettingsDialog({ open, onOpenChange, currentTheme, currentTheme
3057
3075
  type: "button",
3058
3076
  variant: "ghost",
3059
3077
  size: "icon-sm",
3060
- onClick: () => setStage("browse"),
3078
+ onClick: cancelThemePreview,
3061
3079
  "aria-label": "Back to settings",
3062
3080
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ArrowLeft, {})
3063
3081
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
@@ -3074,7 +3092,7 @@ function AppShellSettingsDialog({ open, onOpenChange, currentTheme, currentTheme
3074
3092
  shouldFilter: true,
3075
3093
  loop: true,
3076
3094
  value: selectedTheme,
3077
- onValueChange: (value) => setSelectedTheme(value),
3095
+ onValueChange: (value) => handleThemePreview(value),
3078
3096
  className: "min-h-0 flex-1 rounded-none!",
3079
3097
  children: [
3080
3098
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CommandInput, {
@@ -3091,6 +3109,7 @@ function AppShellSettingsDialog({ open, onOpenChange, currentTheme, currentTheme
3091
3109
  children: THEME_OPTIONS.map((theme) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CommandItem, {
3092
3110
  value: theme,
3093
3111
  keywords: themeKeywords(theme),
3112
+ onMouseEnter: () => handleThemePreview(theme),
3094
3113
  onSelect: () => handleThemeSelect(theme),
3095
3114
  "data-checked": theme === currentTheme ? true : void 0,
3096
3115
  className: "items-start py-2",
@@ -7155,7 +7174,7 @@ var AppShellTreeDialogHost = import_react.memo(function AppShellTreeDialogHost({
7155
7174
  activeSessionStreaming: useSelector(sessionStore, (sessionState) => sessionState.streaming)
7156
7175
  });
7157
7176
  });
7158
- var AppShellSettingsDialogHost = import_react.memo(function AppShellSettingsDialogHost({ authDialogRef, currentTheme, currentThemeColorMode, displaySettingsStore, notificationStore, onAutoScrollEnabledChange, onCenterMessagesChange, onHideThinkingBlocksChange, onHideToolBlocksChange, onSessionDoneDesktopNotificationsEnabledChange, onSessionDoneSoundEnabledChange, onThemeChange, onThemeColorModeChange, sessionStore, settingsDialogRef, settingsOpenRef, systemTheme }) {
7177
+ var AppShellSettingsDialogHost = import_react.memo(function AppShellSettingsDialogHost({ authDialogRef, currentTheme, currentThemeColorMode, displaySettingsStore, notificationStore, onAutoScrollEnabledChange, onCenterMessagesChange, onHideThinkingBlocksChange, onHideToolBlocksChange, onSessionDoneDesktopNotificationsEnabledChange, onSessionDoneSoundEnabledChange, onThemeChange, onThemeColorModeChange, onThemePreviewChange, sessionStore, settingsDialogRef, settingsOpenRef, systemTheme }) {
7159
7178
  const hideThinkingBlocks = useSelector(sessionStore, (sessionState) => sessionState.hideThinkingBlock);
7160
7179
  const { autoScrollEnabled, centerMessages, hideToolBlocks } = useSelector(displaySettingsStore);
7161
7180
  const { desktopNotificationPermission, sessionDoneDesktopNotificationsEnabled, sessionDoneSoundEnabled } = useSelector(notificationStore, (state) => ({
@@ -7174,6 +7193,7 @@ var AppShellSettingsDialogHost = import_react.memo(function AppShellSettingsDial
7174
7193
  currentThemeColorMode,
7175
7194
  onThemeChange,
7176
7195
  onThemeColorModeChange,
7196
+ onThemePreviewChange,
7177
7197
  systemTheme,
7178
7198
  hideThinkingBlocks,
7179
7199
  onHideThinkingBlocksChange,
@@ -7201,7 +7221,7 @@ var AppShellUiRequestDialogHost = import_react.memo(function AppShellUiRequestDi
7201
7221
  onAuthBack: () => authDialogRef.current?.open("login")
7202
7222
  });
7203
7223
  });
7204
- var AppShellFloatingControllers = import_react.memo(function AppShellFloatingControllers({ activeSessionId, addDirectoryDialogRef, addDirectoryOpenRef, addDirectoryPath, baseSidebarDirectories, commandPaletteCommandsRef, commandPaletteOpenRef, commandPaletteRef, currentSessionQueryScope, currentTheme, currentThemeColorMode, authDialogRef, authOpenRef, deleteDialogRef, deleteOpenRef, deleteSessions, deleteOldDirectorySessionsDialogRef, deleteOldDirectorySessionsOpenRef, notificationStore, forkDialogRef, forkOpenRef, gitCommitDialogRef, gitCommitOpenRef, displaySettingsStore, knownDirectories, onAutoScrollEnabledChange, onCenterMessagesChange, onHideThinkingBlocksChange, onHideToolBlocksChange, onSessionDoneDesktopNotificationsEnabledChange, onSessionDoneSoundEnabledChange, onSessionDialogSelect, onThemeChange, onThemeColorModeChange, recentDirectoriesStore, renameDialogRef, renameOpenRef, renameSessionPath, sessionCwd, sessionsDialogDirectory, sessionsDialogRef, sessionsOpenRef, sessionStore, settingsDialogRef, settingsOpenRef, sidebarStore, treeDialogRef, treeOpenRef, uiRequestDialogRef, uiRequestOpenRef, viewerContextId, systemTheme }) {
7224
+ var AppShellFloatingControllers = import_react.memo(function AppShellFloatingControllers({ activeSessionId, addDirectoryDialogRef, addDirectoryOpenRef, addDirectoryPath, baseSidebarDirectories, commandPaletteCommandsRef, commandPaletteOpenRef, commandPaletteRef, currentSessionQueryScope, currentTheme, currentThemeColorMode, authDialogRef, authOpenRef, deleteDialogRef, deleteOpenRef, deleteSessions, deleteOldDirectorySessionsDialogRef, deleteOldDirectorySessionsOpenRef, notificationStore, forkDialogRef, forkOpenRef, gitCommitDialogRef, gitCommitOpenRef, displaySettingsStore, knownDirectories, onAutoScrollEnabledChange, onCenterMessagesChange, onHideThinkingBlocksChange, onHideToolBlocksChange, onSessionDoneDesktopNotificationsEnabledChange, onSessionDoneSoundEnabledChange, onSessionDialogSelect, onThemeChange, onThemeColorModeChange, onThemePreviewChange, recentDirectoriesStore, renameDialogRef, renameOpenRef, renameSessionPath, sessionCwd, sessionsDialogDirectory, sessionsDialogRef, sessionsOpenRef, sessionStore, settingsDialogRef, settingsOpenRef, sidebarStore, treeDialogRef, treeOpenRef, uiRequestDialogRef, uiRequestOpenRef, viewerContextId, systemTheme }) {
7205
7225
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
7206
7226
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AppShellCommandPaletteHost, {
7207
7227
  commandPaletteCommandsRef,
@@ -7288,6 +7308,7 @@ var AppShellFloatingControllers = import_react.memo(function AppShellFloatingCon
7288
7308
  onSessionDoneSoundEnabledChange,
7289
7309
  onThemeChange,
7290
7310
  onThemeColorModeChange,
7311
+ onThemePreviewChange,
7291
7312
  sessionStore,
7292
7313
  settingsDialogRef,
7293
7314
  settingsOpenRef,
@@ -15682,6 +15703,7 @@ function FileReviewContent({ viewerContextId, cwd, active, onOpenFile }) {
15682
15703
  }
15683
15704
  function ReviewFileAccordionItem({ viewerContextId, cwd, active, diffStyle, file, open, stuck, onOpenFile }) {
15684
15705
  const normalizedCwd = normalizeCwd(cwd);
15706
+ const queryClient = useQueryClient();
15685
15707
  const value = reviewFileValue(file);
15686
15708
  const [fullContextRequested, setFullContextRequested] = import_react.useState(false);
15687
15709
  const previewPatch = gitFileShouldPreviewPatch(file) && !fullContextRequested;
@@ -15715,6 +15737,53 @@ function ReviewFileAccordionItem({ viewerContextId, cwd, active, diffStyle, file
15715
15737
  const oldContent = reviewQuery.data?.oldContent ?? "";
15716
15738
  const newContent = reviewQuery.data?.newContent ?? "";
15717
15739
  const patch = diffQuery.data?.patch ?? "";
15740
+ const [indexStatus, worktreeStatus] = gitFileStatusCharacters(file.status);
15741
+ const canStage = worktreeStatus !== " " || indexStatus === "?";
15742
+ const invalidateChangedFileQueries = async () => {
15743
+ await invalidateGitQueries({
15744
+ queryClient,
15745
+ viewerContextId,
15746
+ cwd: normalizedCwd
15747
+ });
15748
+ };
15749
+ const stageMutation = useMutation({
15750
+ mutationFn: async () => await fetchJson(buildRequestUrl("/api/git-stage", { contextId: viewerContextId }), {
15751
+ method: "POST",
15752
+ headers: { "content-type": "application/json" },
15753
+ body: JSON.stringify({
15754
+ cwd: normalizedCwd,
15755
+ path: file.path,
15756
+ previousPath: file.previousPath
15757
+ })
15758
+ }),
15759
+ onSuccess: async () => {
15760
+ await invalidateChangedFileQueries();
15761
+ toast.success("Staged changes", { description: file.path });
15762
+ },
15763
+ onError: (error) => {
15764
+ toast.error(getErrorMessage(error, "Failed to stage changes"));
15765
+ }
15766
+ });
15767
+ const discardMutation = useMutation({
15768
+ mutationFn: async () => await fetchJson(buildRequestUrl("/api/git-discard", { contextId: viewerContextId }), {
15769
+ method: "POST",
15770
+ headers: { "content-type": "application/json" },
15771
+ body: JSON.stringify({
15772
+ cwd: normalizedCwd,
15773
+ path: file.path,
15774
+ previousPath: file.previousPath,
15775
+ status: file.status
15776
+ })
15777
+ }),
15778
+ onSuccess: async () => {
15779
+ await invalidateChangedFileQueries();
15780
+ toast.success("Discarded changes", { description: file.path });
15781
+ },
15782
+ onError: (error) => {
15783
+ toast.error(getErrorMessage(error, "Failed to discard changes"));
15784
+ }
15785
+ });
15786
+ const actionPending = stageMutation.isPending || discardMutation.isPending;
15718
15787
  import_react.useEffect(() => {
15719
15788
  setFullContextRequested(false);
15720
15789
  }, [value]);
@@ -15758,19 +15827,61 @@ function ReviewFileAccordionItem({ viewerContextId, cwd, active, diffStyle, file
15758
15827
  className: "pointer-events-none hidden size-4 shrink-0 group-aria-expanded/review-file-trigger:inline"
15759
15828
  })
15760
15829
  ]
15761
- }), onOpenFile ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$1, {
15762
- type: "button",
15763
- variant: "ghost",
15764
- size: "icon-xs",
15765
- "aria-label": `Open ${file.path}`,
15766
- title: "Open file",
15767
- className: "mr-2 self-center",
15768
- onClick: (event) => {
15769
- event.stopPropagation();
15770
- onOpenFile(file.path, { pin: true });
15771
- },
15772
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SquareArrowOutUpRight, { className: "size-3.5" })
15773
- }) : null]
15830
+ }), /* @__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",
15832
+ children: [
15833
+ onOpenFile ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TitleTooltip, {
15834
+ title: "Open file",
15835
+ side: "top",
15836
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$1, {
15837
+ type: "button",
15838
+ variant: "ghost",
15839
+ size: "icon-xs",
15840
+ "aria-label": `Open ${file.path}`,
15841
+ className: "rounded-none border-0",
15842
+ onClick: (event) => {
15843
+ event.stopPropagation();
15844
+ onOpenFile(file.path, { pin: true });
15845
+ },
15846
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FileInput, { className: "size-3.5" })
15847
+ })
15848
+ }) : null,
15849
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TitleTooltip, {
15850
+ title: "Discard changes",
15851
+ side: "top",
15852
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$1, {
15853
+ type: "button",
15854
+ variant: "ghost",
15855
+ size: "icon-xs",
15856
+ "aria-label": `Discard changes to ${file.path}`,
15857
+ className: "rounded-none border-0 border-l border-border/70 text-muted-foreground hover:text-destructive",
15858
+ disabled: actionPending || !viewerContextId || !normalizedCwd,
15859
+ onClick: (event) => {
15860
+ event.stopPropagation();
15861
+ discardMutation.mutate();
15862
+ },
15863
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Undo2, { className: "size-3.5" })
15864
+ })
15865
+ }),
15866
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TitleTooltip, {
15867
+ title: "Stage changes",
15868
+ side: "top",
15869
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$1, {
15870
+ type: "button",
15871
+ variant: "ghost",
15872
+ size: "icon-xs",
15873
+ "aria-label": `Stage changes to ${file.path}`,
15874
+ className: "rounded-none border-0 border-l border-border/70 text-muted-foreground hover:text-emerald-500",
15875
+ disabled: actionPending || !canStage || !viewerContextId || !normalizedCwd,
15876
+ onClick: (event) => {
15877
+ event.stopPropagation();
15878
+ stageMutation.mutate();
15879
+ },
15880
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Plus, { className: "size-3.5" })
15881
+ })
15882
+ })
15883
+ ]
15884
+ })]
15774
15885
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AccordionContent, {
15775
15886
  className: "bg-background p-0",
15776
15887
  children: previewPatch ? diffQuery.isPending && !diffQuery.data ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
@@ -16330,7 +16441,8 @@ function AppShellDesktopResizeHandle({ label, max, min, onResize, onResizeEnd, o
16330
16441
  }
16331
16442
  function AppShellTabsController({ actionsRef, appUiStore, awaitingFirstTurn, composerPanelRef, contextUsageStore, conversationFrameRef, conversationItemsStore, defaultNewSessionDirectory, displaySettingsStore, fileInputRef, gitPanelOpen, hiddenThinkingPreviewStore, isSessionViewLoading, isSubmitting, isMobile, newSessionDirectoryOptions, onCancelCompaction, onCreateSession, onOpenAddDirectoryDialog, onCloseAllFileViewTabs, onCloseFileViewTab, onCloseFileViewTabsToRight, onCloseOtherFileViewTabs, onOpenFileViewTab, onReorderFileViewTabs, onValueChange, rightSidebarStore, sessionStore, store, viewerContextId, workingStateStore }) {
16332
16443
  const currentTab = useSelector(appUiStore, (state) => state.currentTab);
16333
- const showTabsList = !useSelector(sessionStore, (sessionState) => sessionState.draft) || isSessionViewLoading;
16444
+ const isDraftSession = useSelector(sessionStore, (sessionState) => sessionState.draft);
16445
+ const showTabsList = isMobile || !isDraftSession || isSessionViewLoading;
16334
16446
  const sessionVisibleClassName = currentTab === "git" ? "hidden min-h-0 flex-1 flex-col md:flex" : "flex min-h-0 flex-1 flex-col";
16335
16447
  const mobileGitClassName = currentTab === "git" ? "min-h-0 flex-1 overflow-hidden md:hidden" : "hidden";
16336
16448
  const rightSidebarHasVisibleFiles = useSelector(rightSidebarStore, selectRightSidebarHasVisibleFiles);
@@ -17369,20 +17481,21 @@ function AppSidebarHeader({ onOpenSessionsDialog, onCreateSession }) {
17369
17481
  function AppSidebarDirectoriesHeader({ sessionSearch, visibleDirectories, matchingSessionCount, collapsed, collapsedDirectoryStore, onOpenAddDirectoryDialog }) {
17370
17482
  const searchActive = sessionSearch.trim().length > 0;
17371
17483
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(SidebarGroupLabel, {
17372
- render: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollapsibleTrigger, { className: "group/directories-label justify-between gap-3" }),
17373
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
17374
- className: "flex min-w-0 flex-1 items-center gap-2 text-left",
17484
+ className: "justify-between gap-3",
17485
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(CollapsibleTrigger, {
17486
+ type: "button",
17487
+ className: "group/directories-label flex min-w-0 flex-1 items-center gap-2 text-left outline-hidden",
17375
17488
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
17376
17489
  className: "min-w-0 truncate",
17377
17490
  children: searchActive ? `${matchingSessionCount} matching session${matchingSessionCount === 1 ? "" : "s"}` : "Directories"
17378
- }), !searchActive ? collapsed ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronRight, { className: "size-4 shrink-0 opacity-0 transition-opacity group-hover/directories-label:opacity-100 group-focus-visible/directories-label:opacity-100" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronDown, { className: "size-4 shrink-0 opacity-0 transition-opacity group-hover/directories-label:opacity-100 group-focus-visible/directories-label:opacity-100" }) : null]
17491
+ }), !searchActive ? collapsed ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronRight, { className: "size-4 shrink-0 text-sidebar-foreground/60" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronDown, { className: "size-4 shrink-0 text-sidebar-foreground/60" }) : null]
17379
17492
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
17380
17493
  className: "flex items-center gap-1",
17381
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DirectoryCollapseAllButton, {
17494
+ children: [!collapsed ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DirectoryCollapseAllButton, {
17382
17495
  searchActive,
17383
17496
  visibleDirectories,
17384
17497
  collapsedDirectoryStore
17385
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TitleTooltip, {
17498
+ }) : null, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TitleTooltip, {
17386
17499
  title: "Add directory",
17387
17500
  kbd: formatShortcutLabel("Control+D"),
17388
17501
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$1, {
@@ -19061,6 +19174,9 @@ function usePicoTheme() {
19061
19174
  setTheme(appliedTheme);
19062
19175
  safeLocalStorageSetItem(APPLIED_THEME_STORAGE_KEY, appliedTheme);
19063
19176
  }, [appliedTheme, setTheme]);
19177
+ const previewThemeFamily = (value) => {
19178
+ setThemeFamilyState(normalizeThemeFamily(value));
19179
+ };
19064
19180
  const setThemeFamily = (value) => {
19065
19181
  const nextTheme = normalizeThemeFamily(value);
19066
19182
  setThemeFamilyState(nextTheme);
@@ -19074,6 +19190,7 @@ function usePicoTheme() {
19074
19190
  return {
19075
19191
  appliedTheme,
19076
19192
  colorMode,
19193
+ previewThemeFamily,
19077
19194
  setColorMode,
19078
19195
  setThemeFamily,
19079
19196
  systemTheme,
@@ -20742,7 +20859,7 @@ var AppShellSessionWorkspace = import_react.forwardRef(function AppShellSessionW
20742
20859
  conversationItemsStore.setItems(nextItems);
20743
20860
  setSessionState(nextState);
20744
20861
  }, [conversationItemsStore]);
20745
- const { colorMode: currentThemeColorMode, setColorMode, setThemeFamily, systemTheme, themeFamily: currentTheme } = usePicoTheme();
20862
+ const { colorMode: currentThemeColorMode, previewThemeFamily, setColorMode, setThemeFamily, systemTheme, themeFamily: currentTheme } = usePicoTheme();
20746
20863
  const { initialLoadingSessionId, loadingSessionId } = useSelector(appUiStore, (state) => ({
20747
20864
  initialLoadingSessionId: state.initialLoadingSessionId,
20748
20865
  loadingSessionId: state.loadingSessionId
@@ -21659,6 +21776,9 @@ var AppShellSessionWorkspace = import_react.forwardRef(function AppShellSessionW
21659
21776
  const handleThemeChange = (value) => {
21660
21777
  setThemeFamily(value);
21661
21778
  };
21779
+ const handleThemePreviewChange = (value) => {
21780
+ previewThemeFamily(value);
21781
+ };
21662
21782
  const handleThemeColorModeChange = (value) => {
21663
21783
  setColorMode(value);
21664
21784
  };
@@ -22332,6 +22452,7 @@ var AppShellSessionWorkspace = import_react.forwardRef(function AppShellSessionW
22332
22452
  onSessionDialogSelect: handleSelectSession,
22333
22453
  onThemeChange: handleThemeChange,
22334
22454
  onThemeColorModeChange: handleThemeColorModeChange,
22455
+ onThemePreviewChange: handleThemePreviewChange,
22335
22456
  systemTheme,
22336
22457
  recentDirectoriesStore,
22337
22458
  renameDialogRef,
@@ -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-ByPcMc-9.mjs");
3816
+ const { tsrStartManifest } = await import("../_tanstack-start-manifest_v-BdpuecpN.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-Bc19lQoF.mjs"),
4802
+ import("./router-COJfGnhB.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-ByPcMc-9.js
1
+ //#region node_modules/.nitro/vite/services/ssr/assets/_tanstack-start-manifest_v-BdpuecpN.js
2
2
  var tsrStartManifest = () => ({
3
3
  routes: {
4
4
  __root__: {
@@ -17,9 +17,11 @@ var tsrStartManifest = () => ({
17
17
  "/api/git-commit",
18
18
  "/api/git-commit-message",
19
19
  "/api/git-diff",
20
+ "/api/git-discard",
20
21
  "/api/git-pull",
21
22
  "/api/git-push",
22
23
  "/api/git-review",
24
+ "/api/git-stage",
23
25
  "/api/git-status",
24
26
  "/api/highlight",
25
27
  "/api/model",
@@ -50,16 +52,16 @@ var tsrStartManifest = () => ({
50
52
  "/api/ui/$id"
51
53
  ],
52
54
  assets: void 0,
53
- preloads: ["/assets/index-relf5WuY.js", "/assets/rolldown-runtime-S-ySWqyJ.js"]
55
+ preloads: ["/assets/index-BUBmoV8I.js", "/assets/rolldown-runtime-S-ySWqyJ.js"]
54
56
  },
55
57
  "/": {
56
58
  filePath: "/home/runner/work/pico/pico/src/routes/index.tsx",
57
59
  children: void 0,
58
60
  assets: void 0,
59
- preloads: ["/assets/routes-D_oJExAc.js"]
61
+ preloads: ["/assets/routes-HoM1cKp5.js"]
60
62
  }
61
63
  },
62
- clientEntry: "/assets/index-relf5WuY.js"
64
+ clientEntry: "/assets/index-BUBmoV8I.js"
63
65
  });
64
66
  //#endregion
65
67
  export { tsrStartManifest };